es-toolkit
Advanced tools
Comparing version 1.22.0-dev.690 to 1.22.0-dev.691
@@ -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
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1538490