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

validate-promise

Package Overview
Dependencies
Maintainers
5
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validate-promise - npm Package Compare versions

Comparing version 3.8.2 to 3.8.3

.nyc_output/2f6346c5-8980-439f-a39d-e3864258b95e.json

2

dist/index.d.ts

@@ -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';

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