Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spinajs/validation

Package Overview
Dependencies
Maintainers
1
Versions
278
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/validation - npm Package Compare versions

Comparing version 1.2.88 to 1.2.103

3

lib/sources.js

@@ -44,6 +44,7 @@ "use strict";

Load() {
if (!this.SchemaDirs)
return [];
return this.SchemaDirs.filter((dir) => fs.existsSync(dir))
.flatMap((d) => glob.sync(path.join(d, '/**/*.+(json|js)')))
.map((f) => {
//Log.trace(`Found schema at: ${f}`, 'validation');
return {

@@ -50,0 +51,0 @@ schema: require(f),

@@ -84,3 +84,3 @@ "use strict";

let schema = null;
if (!data) {
if (data === null || data === undefined) {
schema = Reflect.getMetadata(decorators_1.SCHEMA_SYMBOL, schemaOrData);

@@ -100,21 +100,19 @@ }

}
if (!schema) {
if (!schema) {
return [
false,
[
{
keyword: 'empty_schema',
instancePath: './',
schemaPath: '',
params: { data: '' },
},
],
];
if (schema) {
// return [
// false,
// [
// {
// keyword: 'empty_schema',
// instancePath: './',
// schemaPath: '',
// params: { data: '' },
// },
// ],
// ];
const result = this.Validator.validate(schema, data ? data : schemaOrData);
if (!result) {
return [false, (_c = this.Validator.errors) !== null && _c !== void 0 ? _c : null];
}
}
const result = this.Validator.validate(schema, data ? data : schemaOrData);
if (!result) {
return [false, (_c = this.Validator.errors) !== null && _c !== void 0 ? _c : null];
}
return [true, null];

@@ -121,0 +119,0 @@ }

{
"name": "@spinajs/validation",
"version": "1.2.88",
"version": "1.2.103",
"description": "validation library for spinajs framework",

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

"@spinajs/exceptions": "^1.2.81",
"@spinajs/log": "^1.2.88",
"@spinajs/log": "^1.2.103",
"ajv": "^8.8.2",

@@ -52,3 +52,3 @@ "ajv-formats": "^2.1.1",

},
"gitHead": "7c42b937cd76ac16d6af25d7d503eb1a93ce5271"
"gitHead": "18a08cf4cd3e4d2c728d2d372e3a42ddde071be8"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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