Socket
Socket
Sign inDemoInstall

ow

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ow - npm Package Compare versions

Comparing version 0.25.0 to 0.26.0

4

dist/predicates/map.js

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

message: (_, label, error) => `(${label}) ${error}`,
validator: map => of_type_1.default(map.keys(), predicate)
validator: map => of_type_1.default(map.keys(), 'keys', predicate)
});

@@ -117,3 +117,3 @@ }

message: (_, label, error) => `(${label}) ${error}`,
validator: map => of_type_1.default(map.values(), predicate)
validator: map => of_type_1.default(map.values(), 'values', predicate)
});

@@ -120,0 +120,0 @@ }

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

message: (_, label, error) => `(${label}) ${error}`,
validator: object => of_type_1.default(Object.values(object), predicate, 'values')
validator: object => of_type_1.default(Object.values(object), 'values', predicate)
});

@@ -57,0 +57,0 @@ }

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

message: (_, label, error) => `(${label}) ${error}`,
validator: set => of_type_1.default(set, predicate)
validator: set => of_type_1.default(set, 'values', predicate)
});

@@ -83,0 +83,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const is_1 = require("@sindresorhus/is");
const __1 = require("..");
const test_1 = require("../test");
const ofTypeDeep = (object, predicate) => {
if (!is_1.default.plainObject(object)) {
__1.default(object, predicate);
test_1.default(object, 'deep values', predicate, false);
return true;

@@ -9,0 +9,0 @@ }

import { BasePredicate } from '../predicates/base-predicate';
declare const _default: <T>(source: IterableIterator<T> | Set<T> | T[], predicate: BasePredicate<T>, name?: string | undefined) => boolean | string;
declare const _default: <T>(source: IterableIterator<T> | Set<T> | T[], name: string, predicate: BasePredicate<T>) => boolean | string;
/**

@@ -8,5 +8,5 @@ Test all the values in the collection against a provided predicate.

@param source Source collection to test.
@param name The name to call the collection of values, such as `values` or `keys`.
@param predicate Predicate to test every item in the source collection against.
@param name The name to call the collection of values, such as `values` or `keys`. If it is `undefined`, it uses the call stack to infer the label.
*/
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
const test_1 = require("../test");
// TODO: After we migrate all usages of this function to specify the optional 'name' parameter, we can change the parameter to be required.
/**

@@ -11,14 +9,9 @@ Test all the values in the collection against a provided predicate.

@param source Source collection to test.
@param name The name to call the collection of values, such as `values` or `keys`.
@param predicate Predicate to test every item in the source collection against.
@param name The name to call the collection of values, such as `values` or `keys`. If it is `undefined`, it uses the call stack to infer the label.
*/
exports.default = (source, predicate, name) => {
exports.default = (source, name, predicate) => {
try {
for (const item of source) {
if (name) {
test_1.default(item, name, predicate, false);
}
else {
__1.default(item, predicate);
}
test_1.default(item, name, predicate, false);
}

@@ -25,0 +18,0 @@ return true;

{
"name": "ow",
"version": "0.25.0",
"version": "0.26.0",
"description": "Function argument validation for humans",
"license": "MIT",
"repository": "sindresorhus/ow",
"funding": "https://github.com/sponsors/sindresorhus",
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
},
"author": {

@@ -68,2 +70,3 @@ "name": "Sindre Sorhus",

"ts-node": "^10.0.0",
"typedoc": "^0.21.1",
"typescript": "^4.3.4",

@@ -70,0 +73,0 @@ "xo": "^0.38.2"

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