Socket
Socket
Sign inDemoInstall

es-toolkit

Package Overview
Dependencies
Maintainers
0
Versions
722
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-toolkit - npm Package Compare versions

Comparing version 1.22.0-dev.690 to 1.22.0-dev.691

22

dist/compat/array/every.d.ts

@@ -52,3 +52,3 @@ /**

* @template T
* @param {readonly T[]} arr - The array to check through.
* @param {T[]} arr - The array to check through.
* @param {[keyof T, unknown]} doesMatchProperty - An array where the first element is the property key and the second element is the value to match.

@@ -68,3 +68,3 @@ * @returns {boolean} - `true` if every item has the specified property value, or `false` if at least one item does not match.

* @template T
* @param {readonly T[]} arr - The array to check through.
* @param {T[]} arr - The array to check through.
* @param {string} propertyToCheck - The property name to check.

@@ -84,4 +84,4 @@ * @returns {boolean} - `true` if every item has the specified property, or `false` if at least one item does not match.

* @template T
* @param {T extends Record<string, unknown> ? T : never} object - The object to check through.
* @param {(item: T[keyof T], index: keyof T, arr: T) => unknown} doesMatch - A function that takes an item, its key, and the object, and returns a truthy value if the item matches the criteria.
* @param {T} object - The object to check through.
* @param {(value: T[keyof T], key: keyof T, object: T) => unknown} doesMatch - A function that takes an value, its key, and the object, and returns a truthy value if the item matches the criteria.
* @returns {boolean} - `true` if every property value matches the predicate, or `false` if at least one does not match.

@@ -92,6 +92,6 @@ *

* const obj = { a: 1, b: 2, c: 3 };
* const result = every(obj, (item) => item > 0);
* const result = every(obj, (value) => value > 0);
* console.log(result); // true
*/
declare function every<T extends Record<string, unknown>>(object: T, doesMatch: (item: T[keyof T], index: keyof T, object: T) => unknown): boolean;
declare function every<T extends Record<string, unknown>>(object: T, doesMatch: (value: T[keyof T], key: keyof T, object: T) => unknown): boolean;
/**

@@ -101,3 +101,3 @@ * Checks if every item in an object matches the given partial value.

* @template T
* @param {T extends Record<string, unknown> ? T : never} object - The object to check through.
* @param {T} object - The object to check through.
* @param {Partial<T[keyof T]>} doesMatch - A partial value to match against the values of the object.

@@ -117,3 +117,3 @@ * @returns {boolean} - `true` if every property value matches the partial value, or `false` if at least one does not match.

* @template T
* @param {readonly T[]} object - The object to check through.
* @param {T[]} object - The object to check through.
* @param {[keyof T, unknown]} doesMatchProperty - An array where the first element is the property key and the second element is the value to match.

@@ -124,4 +124,4 @@ * @returns {boolean} - `true` if every item has the specified property value, or `false` if at least one item does not match.

* // Using a property-value pair
* const items = { alice: { id: 1, name: 'Alice' }, bob: { id: 2, name: 'Bob' } };
* const result = every(items, ['name', 'Alice']);
* const obj = { alice: { id: 1, name: 'Alice' }, bob: { id: 2, name: 'Bob' } };
* const result = every(obj, ['name', 'Alice']);
* console.log(result); // false

@@ -134,3 +134,3 @@ */

* @template T
* @param {T extends Record<string, unknown> ? T : never} object - The object to check through.
* @param {T} object - The object to check through.
* @param {string} propertyToCheck - The property name to check.

@@ -137,0 +137,0 @@ * @returns {boolean} - `true` if every property value has the specified property, or `false` if at least one does not match.

{
"name": "es-toolkit",
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
"version": "1.22.0-dev.690+93d256d2",
"version": "1.22.0-dev.691+6fa1f00e",
"homepage": "https://es-toolkit.slash.page",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/toss/es-toolkit/issues",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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