@spinajs/validation
Advanced tools
Comparing version 1.2.127 to 1.2.135
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -9,8 +15,11 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const validation_1 = __importDefault(require("./schemas/validation")); | ||
class ValidatorBootstraper extends di_1.Bootstrapper { | ||
let ValidatorBootstraper = class ValidatorBootstraper extends di_1.Bootstrapper { | ||
bootstrap() { | ||
di_1.DI.register(validation_1.default).asValue('__configurationSchema__'); | ||
} | ||
} | ||
}; | ||
ValidatorBootstraper = __decorate([ | ||
(0, di_1.Injectable)(di_1.Bootstrapper) | ||
], ValidatorBootstraper); | ||
exports.ValidatorBootstraper = ValidatorBootstraper; | ||
//# sourceMappingURL=bootstrap.js.map |
@@ -38,3 +38,3 @@ import { SyncModule, Container } from '@spinajs/di'; | ||
* Validate given data. When failed, exception is thrown | ||
* | ||
*s | ||
* @param data - data to validate. Function will try to extract schema attached to object via `@Schema` decorator | ||
@@ -41,0 +41,0 @@ * @throws {@link InvalidArgument | ValidationFailed } |
@@ -100,13 +100,2 @@ "use strict"; | ||
if (schema) { | ||
// return [ | ||
// false, | ||
// [ | ||
// { | ||
// keyword: 'empty_schema', | ||
// instancePath: './', | ||
// schemaPath: '', | ||
// params: { data: '' }, | ||
// }, | ||
// ], | ||
// ]; | ||
const result = this.Validator.validate(schema, data ? data : schemaOrData); | ||
@@ -113,0 +102,0 @@ if (!result) { |
{ | ||
"name": "@spinajs/validation", | ||
"version": "1.2.127", | ||
"version": "1.2.135", | ||
"description": "validation library for spinajs framework", | ||
@@ -51,3 +51,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "53b022d0e70b7f2689ac984578b52afb0fd9e967" | ||
"gitHead": "8a7fde1b1fbada9c1b6fb65603ba1aadd5bb1126" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
26829
463