From 87a949ba336246fd30926e651d362bc327c9ac46 Mon Sep 17 00:00:00 2001 From: Alex H Date: Sun, 3 Mar 2024 17:05:58 +0100 Subject: [PATCH] ci: Change branch for start job --- .eslintrc.json | 2 +- .github/workflows/ci.yml | 2 +- .../json-api-nestjs/src/lib/helper/bind-controller.ts | 2 +- .../json-api-nestjs/src/lib/helper/create-controller.ts | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 1f84846..b83a165 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,7 +8,7 @@ "error", { "enforceBuildableLibDependency": true, - "allow": [], + "allow": ["json-shared-type", "shared-utils"], "depConstraints": [ { "sourceTag": "*", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6723b4..46c663d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: # This line is needed for nx affected to work when CI is running on a PR - run: git branch --track main origin/master - name: Test and build - run: npx nx affected -t lint test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,shared-utils,json-shared-type,database' + run: npx nx affected -t test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source' - name: Cache npm dependencies id: cache-dependencies-save uses: actions/cache/save@v4 diff --git a/libs/json-api/json-api-nestjs/src/lib/helper/bind-controller.ts b/libs/json-api/json-api-nestjs/src/lib/helper/bind-controller.ts index 71b15ff..4b46aa1 100644 --- a/libs/json-api/json-api-nestjs/src/lib/helper/bind-controller.ts +++ b/libs/json-api/json-api-nestjs/src/lib/helper/bind-controller.ts @@ -42,7 +42,7 @@ export function bindController( if (!allowMethod.includes(name)) continue; } - if (!controller.prototype.hasOwnProperty(name)) { + if (!Object.prototype.hasOwnProperty.call(controller, name)) { // need uniq descriptor for correct work swagger Reflect.defineProperty(controller.prototype, name, { value: function ( diff --git a/libs/json-api/json-api-nestjs/src/lib/helper/create-controller.ts b/libs/json-api/json-api-nestjs/src/lib/helper/create-controller.ts index 48cc471..d4ca807 100644 --- a/libs/json-api/json-api-nestjs/src/lib/helper/create-controller.ts +++ b/libs/json-api/json-api-nestjs/src/lib/helper/create-controller.ts @@ -27,7 +27,9 @@ export function createController( const entityName = entity instanceof Function ? entity.name : entity.options.name; - if (!JsonBaseController.isPrototypeOf(controllerClass)) { + if ( + !Object.prototype.isPrototypeOf.call(JsonBaseController, controllerClass) + ) { throw new Error( `Controller "${controller?.name}" should be inherited of "JsonBaseController"` );