metaschema
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -42,3 +42,3 @@ 'use strict'; | ||
static isInstance(err) { | ||
return err && err.errors && Array.isArray(err.errors); | ||
return Array.isArray(err?.errors); | ||
} | ||
@@ -45,0 +45,0 @@ } |
@@ -31,3 +31,4 @@ 'use strict'; | ||
const schemaError = new SchemaError(path); | ||
if (!this.required && value === undefined) return schemaError; | ||
const isEmpty = value === null || value === undefined; | ||
if (!this.required && isEmpty) return schemaError; | ||
try { | ||
@@ -48,3 +49,3 @@ schemaError.add(this.checkType(value, path)); | ||
const { root, ...rest } = this; | ||
return rest; | ||
return root, rest; | ||
} | ||
@@ -51,0 +52,0 @@ } |
@@ -50,3 +50,3 @@ 'use strict'; | ||
isInstance(value) { | ||
return value && value.constructor && value.constructor.name === 'Map'; | ||
return value?.constructor?.name === 'Map'; | ||
}, | ||
@@ -95,3 +95,3 @@ | ||
isInstance(value) { | ||
return value && value.constructor && value.constructor.name === 'Set'; | ||
return value?.constructor?.name === 'Set'; | ||
}, | ||
@@ -98,0 +98,0 @@ }; |
@@ -110,3 +110,3 @@ 'use strict'; | ||
const { root, ...rest } = this.fields; | ||
return rest; | ||
return root, rest; | ||
} | ||
@@ -113,0 +113,0 @@ } |
@@ -42,4 +42,3 @@ 'use strict'; | ||
const isInstanceOf = (obj, constrName) => | ||
obj && obj.constructor && obj.constructor.name === constrName; | ||
const isInstanceOf = (obj, constrName) => obj?.constructor?.name === constrName; | ||
@@ -46,0 +45,0 @@ module.exports = { |
{ | ||
"name": "metaschema", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -46,12 +46,12 @@ "description": "Metadata Schema and Interface Definition Language (IDL)", | ||
"dependencies": { | ||
"metautil": "^3.5.20", | ||
"metavm": "^1.2.0" | ||
"metautil": "^3.5.23", | ||
"metavm": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.0.0", | ||
"eslint": "^8.18.0", | ||
"@types/node": "^18.7.6", | ||
"eslint": "^8.22.0", | ||
"eslint-config-metarhia": "^8.1.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"metatests": "^0.8.2", | ||
@@ -58,0 +58,0 @@ "prettier": "^2.7.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
40680
22
0
Updatedmetautil@^3.5.23
Updatedmetavm@^1.2.1