validate-promise
Advanced tools
Comparing version 3.8.2 to 3.8.3
@@ -25,3 +25,3 @@ import after from './rules/after'; | ||
export declare type MsgFunc<T extends object, A = any> = (value: string, row: T, arg?: A | ArgFunc<T, A>) => string; | ||
export declare type ValidationPromise<T extends object = object, A = any, V = any> = (value: V, row: T, msg: MsgFunc<T, A>, arg?: A | ArgFunc<T, A>) => Promise<string | void>; | ||
export declare type ValidationPromise<T extends object = object, A = any, V = string | string[] | Record<string, number> | number | Date> = (value: V, row: T, msg: MsgFunc<T, A>, arg?: A | ArgFunc<T, A>) => Promise<string | void>; | ||
interface IAPromise<T extends object = object> { | ||
@@ -28,0 +28,0 @@ rule: ValidationPromise<T>; |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.whitelist = exports.url = exports.required = exports.regex = exports.notEquals = exports.lessthan = exports.int = exports.greaterthan = exports.float = exports.excludes = exports.equalto = exports.equals = exports.email = exports.domain = exports.blacklist = exports.before = exports.after = exports.longerThan = exports.shorterThan = exports.isUploaded = exports.atleastOneRequired = exports.generateContract = void 0; | ||
const lodash_get_1 = __importDefault(require("lodash.get")); | ||
const lodash_update_1 = __importDefault(require("lodash.update")); | ||
const get_1 = __importDefault(require("lodash/get")); | ||
const update_1 = __importDefault(require("lodash/update")); | ||
const after_1 = __importDefault(require("./rules/after")); | ||
@@ -57,3 +57,3 @@ exports.after = after_1.default; | ||
const setNestedValue = (object, propPath, value) => { | ||
return lodash_update_1.default(object, propPath, (arr) => arr ? [...arr, value] : [value]); | ||
return update_1.default(object, propPath, (arr) => arr ? [...arr, value] : [value]); | ||
}; | ||
@@ -91,3 +91,3 @@ const hashSettled = (promises) => { | ||
}); | ||
const values = propPaths.map((path) => lodash_get_1.default(data, path.join('.'))); | ||
const values = propPaths.map((path) => get_1.default(data, path.join('.'))); | ||
promises = promises.concat(validation.promises | ||
@@ -102,3 +102,3 @@ .filter(testCondition(values, data)) | ||
const propPath = Array.isArray(validation.key) ? validation.key : [validation.key]; | ||
const value = lodash_get_1.default(data, propPath.join('.')); | ||
const value = get_1.default(data, propPath.join('.')); | ||
promises = promises.concat(validation.promises | ||
@@ -105,0 +105,0 @@ .filter(testCondition(value, data)) |
{ | ||
"name": "validate-promise", | ||
"version": "3.8.2", | ||
"version": "3.8.3", | ||
"description": "Promised based validation library", | ||
@@ -30,2 +30,5 @@ "main": "dist/index.js", | ||
}, | ||
"peerDependencies": { | ||
"lodash": "^4.17.21" | ||
}, | ||
"repository": { | ||
@@ -36,5 +39,3 @@ "type": "git", | ||
"dependencies": { | ||
"is-email": "^1.0.1", | ||
"lodash.get": "^4.4.2", | ||
"lodash.update": "^4.10.2" | ||
"is-email": "^1.0.1" | ||
}, | ||
@@ -41,0 +42,0 @@ "nyc": { |
@@ -1,3 +0,3 @@ | ||
import get from 'lodash.get'; | ||
import update from 'lodash.update'; | ||
import get from 'lodash/get'; | ||
import update from 'lodash/update'; | ||
@@ -4,0 +4,0 @@ import after from './rules/after'; |
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
570503
2
139
3611
+ Addedlodash@4.17.21(transitive)
- Removedlodash.get@^4.4.2
- Removedlodash.update@^4.10.2
- Removedlodash.get@4.4.2(transitive)
- Removedlodash.update@4.10.2(transitive)