Comparing version 3.0.4 to 3.0.5
{ | ||
"name": "abolish", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "A javascript object validator.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -159,3 +150,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
*/ | ||
let validated = Object.assign({}, object); | ||
let validated = { ...object }; | ||
/** | ||
@@ -222,3 +213,3 @@ * Get Keys to be validated | ||
*/ | ||
ruleData = Object.assign(Object.assign({}, internalWildcardRules), ruleData); | ||
ruleData = { ...internalWildcardRules, ...ruleData }; | ||
/** | ||
@@ -369,3 +360,3 @@ * Loop through ruleData to check if validators defined exists | ||
*/ | ||
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { | ||
return new Promise(async (resolve) => { | ||
/** | ||
@@ -386,3 +377,3 @@ * Loop through jobs and run their validators | ||
*/ | ||
validationResult = yield validator.validator(objectValue, validatorOption, { | ||
validationResult = await validator.validator(objectValue, validatorOption, { | ||
error: (message, data) => new AbolishError_1.default(message, data), | ||
@@ -441,5 +432,5 @@ modifier: new ObjectModifier_1.default(validated, rule) | ||
return resolve([false, Functions_1.Pick(validated, keysToBeValidated)]); | ||
})); | ||
}); | ||
} | ||
} | ||
module.exports = Abolish; |
@@ -58,3 +58,3 @@ "use strict"; | ||
rule = StringToRules_1.default(rule); | ||
generatedRule = Object.assign(Object.assign({}, generatedRule), rule); | ||
generatedRule = { ...generatedRule, ...rule }; | ||
} | ||
@@ -61,0 +61,0 @@ return generatedRule; |
47043
1332