Skip to content

Commit

Permalink
chore: remove unused express decorators
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove CaseSensitive, MergeParams, RouterSettings and Strict decorators
  • Loading branch information
Romakita committed Jul 25, 2022
1 parent 5251249 commit ceec965
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 169 deletions.
1 change: 0 additions & 1 deletion packages/di/src/decorators/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export interface ControllerMiddlewares {
export interface ControllerOptions extends Partial<ProviderOpts<any>> {
path?: PathType;
children?: Type<any>[];
routerOptions?: any;
middlewares?: Partial<ControllerMiddlewares>;
}

Expand Down
4 changes: 0 additions & 4 deletions packages/di/src/domain/ControllerProvider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ describe("ControllerProvider", () => {
expect(controllerProvider.scope).toEqual("request");
});

it("should get routerOptions", () => {
expect(controllerProvider.routerOptions).toBeInstanceOf(Object);
});

it("should have children", () => {
expect(controllerProvider.hasChildren()).toEqual(false);
});
Expand Down
10 changes: 0 additions & 10 deletions packages/platform/common/src/services/FakeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ export class FakeAdapter implements PlatformAdapter<any> {
return {} as any;
}

router(routerOptions: any): {router: any; callback(): any} {
const router = FakeAdapter.createFakeRawDriver();
return {
router,
callback() {
return router;
}
};
}

statics(endpoint: string, options: PlatformStaticsOptions): any {
return {};
}
Expand Down
28 changes: 0 additions & 28 deletions packages/platform/platform-express/src/decorators/caseSensitive.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/platform/platform-express/src/decorators/mergeParams.ts

This file was deleted.

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions packages/platform/platform-express/src/decorators/strict.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/platform/platform-express/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

export * from "./exports";
export * from "./components/PlatformExpress";
export * from "./decorators/caseSensitive";
export * from "./decorators/mergeParams";
export * from "./decorators/routerSettings";
export * from "./decorators/strict";
export * from "./interfaces/PlatformExpressSettings";
export * from "./interfaces/PlatformExpressStaticsOptions";
export * from "./interfaces/interfaces";
Expand Down
3 changes: 1 addition & 2 deletions packages/platform/platform-express/test/merge-params.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Controller, Get, PathParams, PlatformTest} from "@tsed/common";
import {MergeParams, PlatformExpress} from "@tsed/platform-express";
import {PlatformExpress} from "@tsed/platform-express";
import {PlatformTestUtils} from "@tsed/platform-test-utils";
import SuperTest from "supertest";
import {rootDir, Server} from "./app/Server";
Expand All @@ -11,7 +11,6 @@ const utils = PlatformTestUtils.create({
});

@Controller("/merge-params/:parentId")
@MergeParams(true)
class TestMergeParamsCtrl {
@Get("/:id")
get(@PathParams("parentId") parentId: string, @PathParams("id") id: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export function testStatics(options: PlatformTestOptions) {
beforeEach(
PlatformTest.bootstrap(options.server, {
...options,
logger: {
level: "info"
},
mount: {
"/rest": [CustomStaticsCtrl]
}
Expand Down

0 comments on commit ceec965

Please sign in to comment.