Socket
Socket
Sign inDemoInstall

objection

Package Overview
Dependencies
Maintainers
2
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

objection - npm Package Compare versions

Comparing version 2.2.15 to 3.0.0-alpha.1

25

lib/model/AjvValidator.js

@@ -19,8 +19,10 @@ 'use strict';

self.ajvOptions = Object.assign({ errorDataPath: 'property' }, conf.options, {
self.ajvOptions = Object.assign({}, conf.options, {
allErrors: true,
});
const Ajv = getAjv();
// Create a normal Ajv instance.
self.ajv = new getAjv()(
self.ajv = new Ajv(
Object.assign(

@@ -36,3 +38,3 @@ {

// to validate `patch` objects (objects that have a subset of properties).
self.ajvNoDefaults = new getAjv()(
self.ajvNoDefaults = new Ajv(
Object.assign({}, self.ajvOptions, {

@@ -156,4 +158,2 @@ useDefaults: false,

for (const error of errors) {
const dataPath = `${options.dataPath || ''}${error.dataPath}`;
// If additionalProperties = false, relations can pop up as additionalProperty

@@ -169,7 +169,14 @@ // errors. Skip those.

// Unknown properties are reported in `['propertyName']` notation,
// so replace those with dot-notation, see:
// https://github.com/epoberezkin/ajv/issues/671
const key = dataPath.replace(/\['([^' ]*)'\]/g, '.$1').substring(1);
let path = error.instancePath.replace(/\//g, '.');
if (error.params) {
if (error.params.missingProperty) {
path += `.${error.params.missingProperty}`;
} else if (error.params.additionalProperty) {
path += `.${error.params.additionalProperty}`;
}
}
const key = `${options.dataPath || ''}${path}`.substring(1);
// More than one error can occur for the same key in Ajv, merge them in the array:

@@ -176,0 +183,0 @@ const array = errorHash[key] || (errorHash[key] = []);

@@ -160,5 +160,6 @@ 'use strict';

whereJsonbRefOnLeftJsonbValOrRefOnRight: whereJsonbRefOnLeftJsonbValOrRefOnRight,
whereJsonbRefOnLeftJsonbValOrRefOnRightRawQueryParams: whereJsonbRefOnLeftJsonbValOrRefOnRightRawQueryParams,
whereJsonbRefOnLeftJsonbValOrRefOnRightRawQueryParams:
whereJsonbRefOnLeftJsonbValOrRefOnRightRawQueryParams,
whereJsonFieldRightStringArrayOnLeftQuery: whereJsonFieldRightStringArrayOnLeftQuery,
whereJsonFieldQuery: whereJsonFieldQuery,
};

@@ -116,8 +116,6 @@ 'use strict';

convertedJson[
parsed.column
] = knex.raw(`jsonb_set(??, '${jsonRefs}', ${valuePlaceholder}, true)`, [
convertedJson[parsed.column] || parsed.column,
val,
]);
convertedJson[parsed.column] = knex.raw(
`jsonb_set(??, '${jsonRefs}', ${valuePlaceholder}, true)`,
[convertedJson[parsed.column] || parsed.column, val]
);

@@ -124,0 +122,0 @@ delete model[key];

@@ -9,3 +9,4 @@ 'use strict';

const AllSelector = () => true;
const SelectSelector = /^(select|columns|column|distinct|count|countDistinct|min|max|sum|sumDistinct|avg|avgDistinct)$/;
const SelectSelector =
/^(select|columns|column|distinct|count|countDistinct|min|max|sum|sumDistinct|avg|avgDistinct)$/;
const WhereSelector = /^(where|orWhere|andWhere|find\w+)/;

@@ -12,0 +13,0 @@ const OnSelector = /^(on|orOn|andOn)/;

{
"name": "objection",
"version": "2.2.15",
"version": "3.0.0-alpha.1",
"description": "An SQL-friendly ORM for Node.js",

@@ -44,3 +44,3 @@ "main": "lib/objection.js",

"engines": {
"node": ">=8.0.0"
"node": ">=12.0.0"
},

@@ -65,30 +65,28 @@ "keywords": [

"dependencies": {
"ajv": "^6.12.6",
"ajv": "^8.6.2",
"db-errors": "^0.2.3"
},
"peerDependencies": {
"knex": "<0.95.0"
"knex": ">=0.95.0"
},
"devDependencies": {
"@types/node": "^14.14.13",
"chai": "^4.2.0",
"@types/node": "^16.3.2",
"chai": "^4.3.4",
"chai-subset": "^1.6.0",
"coveralls": "^3.1.0",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"eslint": "^7.15.0",
"eslint-plugin-prettier": "^3.2.0",
"eslint": "^7.30.0",
"eslint-plugin-prettier": "^3.4.0",
"expect.js": "^0.3.1",
"fs-extra": "^9.0.1",
"glob": "^7.1.6",
"husky": "^4.3.6",
"knex": "0.21.15",
"lint-staged": "^10.5.3",
"mocha": "^8.2.1",
"fs-extra": "^10.0.0",
"glob": "^7.1.7",
"knex": "0.95.7",
"mocha": "^9.0.2",
"mysql": "^2.18.1",
"nyc": "^15.1.0",
"pg": "^8.5.1",
"prettier": "2.2.1",
"sqlite3": "^5.0.0",
"typescript": "^4.1.3",
"vuepress": "1.7.1"
"pg": "^8.6.0",
"prettier": "2.3.2",
"sqlite3": "^5.0.2",
"typescript": "^4.3.5",
"vuepress": "1.8.2"
},

@@ -108,19 +106,3 @@ "nyc": {

"report-dir": "./testCoverage"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"prettier --write",
"eslint --fix",
"git add"
],
"*.{yml,ts}": [
"prettier --write",
"git add"
]
}
}

@@ -17,3 +17,3 @@ /// <reference types="node" />

import * as dbErrors from 'db-errors';
import * as Knex from 'knex';
import { Knex } from 'knex';

@@ -758,3 +758,3 @@ // Export the entire Objection namespace.

separator?: string;
aliases?: {[key: string]: string};
aliases?: { [key: string]: string };
joinOperation?: string;

@@ -761,0 +761,0 @@ maxBatchSize?: number;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc