Skip to content

Commit

Permalink
minor bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Himanshu authored and Himanshu committed Oct 30, 2023
1 parent a6ace40 commit ba38d86
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
17 changes: 8 additions & 9 deletions lib/knex-builder/Knex.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ knex.SchemaBuilder = {
},
};

Knex.Raw = {
(knex.Raw = {
extend: function (methodName, fn) {
Raw.extend(methodName, fn);
},
};

knex.ViewBuilder = {
extend: function (methodName, fn) {
ViewBuilder.extend(methodName, fn);
SchemaBuilder.extend(methodName, fn);
},
};
}),
(knex.ViewBuilder = {
extend: function (methodName, fn) {
ViewBuilder.extend(methodName, fn);
},
});

knex.ColumnBuilder = {
extend: function (methodName, fn) {
Expand Down
6 changes: 2 additions & 4 deletions lib/raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ Raw.prototype.isRawInstance = true;
//Extending raw feature
Raw.extend = (methodName, fn) => {
if (Object.prototype.hasOwnProperty.call(Raw.prototype, methodName)) {
throw new Error(
`Can't extend Raw with existing method ('${methodName}').`
);
throw new Error(`Can't extend Raw with existing method ('${methodName}').`);
}

assign(Raw.prototype, {[methodName]: fn});
assign(Raw.prototype, { [methodName]: fn });
};

// Allow the `Raw` object to be utilized with full access to the relevant
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"debug:test": "mocha --inspect-brk --exit -t 0 test/all-tests-suite.js",
"debug:tape": "node --inspect-brk test/tape/index.js",
"coveralls": "nyc report --reporter=lcov",
"lint": "eslint --cache **/*.js",
"lint": "eslint --cache '**/*.js'",
"lint:fix": "eslint --cache --fix '**/*.js'",
"lint:types": "tsd && dtslint types",
"lint:everything": "npm run lint && npm run lint:types",
Expand Down Expand Up @@ -116,7 +116,6 @@
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"dtslint": "4.2.1",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-mocha-no-only": "^1.1.1",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "@tsconfig/node12/tsconfig.json",
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
Expand Down

0 comments on commit ba38d86

Please sign in to comment.