es-toolkit 1.22.0-dev.688 → 1.22.0-dev.691
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -49,7 +49,7 @@ declare function every<T>(arr: readonly T[], doesMatch: Partial<T>): boolean;
|
|
|
49
49
|
* Checks if every item in an array matches a property with a specific value.
|
|
50
50
|
*
|
|
51
51
|
* @template T
|
|
52
|
-
* @param {
|
|
52
|
+
* @param {T[]} arr - The array to check through.
|
|
53
53
|
* @param {[keyof T, unknown]} doesMatchProperty - An array where the first element is the property key and the second element is the value to match.
|
|
54
54
|
* @returns {boolean} - `true` if every item has the specified property value, or `false` if at least one item does not match.
|
|
55
55
|
*
|
|
@@ -64,7 +64,7 @@ declare function every<T>(arr: readonly T[], doesMatchProperty: [keyof T, unknow
|
|
|
64
64
|
* Checks if every item in an array has a specific property, where the property name is provided as a string.
|
|
65
65
|
*
|
|
66
66
|
* @template T
|
|
67
|
-
* @param {
|
|
67
|
+
* @param {T[]} arr - The array to check through.
|
|
68
68
|
* @param {string} propertyToCheck - The property name to check.
|
|
69
69
|
* @returns {boolean} - `true` if every item has the specified property, or `false` if at least one item does not match.
|
|
70
70
|
*
|
|
@@ -79,22 +79,22 @@ declare function every<T>(arr: readonly T[], propertyToCheck: string): boolean;
|
|
|
79
79
|
* Checks if every item in an object matches the given predicate function.
|
|
80
80
|
*
|
|
81
81
|
* @template T
|
|
82
|
-
* @param {T
|
|
83
|
-
* @param {(
|
|
82
|
+
* @param {T} object - The object to check through.
|
|
83
|
+
* @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.
|
|
84
84
|
* @returns {boolean} - `true` if every property value matches the predicate, or `false` if at least one does not match.
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
87
|
* // Using a predicate function
|
|
88
88
|
* const obj = { a: 1, b: 2, c: 3 };
|
|
89
|
-
* const result = every(obj, (
|
|
89
|
+
* const result = every(obj, (value) => value > 0);
|
|
90
90
|
* console.log(result); // true
|
|
91
91
|
*/
|
|
92
|
-
declare function every<T extends Record<string, unknown>>(object: T, doesMatch: (
|
|
92
|
+
declare function every<T extends Record<string, unknown>>(object: T, doesMatch: (value: T[keyof T], key: keyof T, object: T) => unknown): boolean;
|
|
93
93
|
/**
|
|
94
94
|
* Checks if every item in an object matches the given partial value.
|
|
95
95
|
*
|
|
96
96
|
* @template T
|
|
97
|
-
* @param {T
|
|
97
|
+
* @param {T} object - The object to check through.
|
|
98
98
|
* @param {Partial<T[keyof T]>} doesMatch - A partial value to match against the values of the object.
|
|
99
99
|
* @returns {boolean} - `true` if every property value matches the partial value, or `false` if at least one does not match.
|
|
100
100
|
*
|
|
@@ -109,14 +109,14 @@ declare function every<T extends Record<string, unknown>>(object: T, doesMatch:
|
|
|
109
109
|
* Checks if every item in an object matches a property with a specific value.
|
|
110
110
|
*
|
|
111
111
|
* @template T
|
|
112
|
-
* @param {
|
|
112
|
+
* @param {T[]} object - The object to check through.
|
|
113
113
|
* @param {[keyof T, unknown]} doesMatchProperty - An array where the first element is the property key and the second element is the value to match.
|
|
114
114
|
* @returns {boolean} - `true` if every item has the specified property value, or `false` if at least one item does not match.
|
|
115
115
|
*
|
|
116
116
|
* @example
|
|
117
117
|
* // Using a property-value pair
|
|
118
|
-
* const
|
|
119
|
-
* const result = every(
|
|
118
|
+
* const obj = { alice: { id: 1, name: 'Alice' }, bob: { id: 2, name: 'Bob' } };
|
|
119
|
+
* const result = every(obj, ['name', 'Alice']);
|
|
120
120
|
* console.log(result); // false
|
|
121
121
|
*/
|
|
122
122
|
declare function every<T extends Record<string, unknown>>(object: T, doesMatchProperty: [keyof T, unknown]): boolean;
|
|
@@ -124,7 +124,7 @@ declare function every<T extends Record<string, unknown>>(object: T, doesMatchPr
|
|
|
124
124
|
* Checks if every item in an object has a specific property, where the property name is provided as a string.
|
|
125
125
|
*
|
|
126
126
|
* @template T
|
|
127
|
-
* @param {T
|
|
127
|
+
* @param {T} object - The object to check through.
|
|
128
128
|
* @param {string} propertyToCheck - The property name to check.
|
|
129
129
|
* @returns {boolean} - `true` if every property value has the specified property, or `false` if at least one does not match.
|
|
130
130
|
*
|
|
@@ -49,7 +49,7 @@ declare function every<T>(arr: readonly T[], doesMatch: Partial<T>): boolean;
|
|
|
49
49
|
* Checks if every item in an array matches a property with a specific value.
|
|
50
50
|
*
|
|
51
51
|
* @template T
|
|
52
|
-
* @param {
|
|
52
|
+
* @param {T[]} arr - The array to check through.
|
|
53
53
|
* @param {[keyof T, unknown]} doesMatchProperty - An array where the first element is the property key and the second element is the value to match.
|
|
54
54
|
* @returns {boolean} - `true` if every item has the specified property value, or `false` if at least one item does not match.
|
|
55
55
|
*
|
|
@@ -64,7 +64,7 @@ declare function every<T>(arr: readonly T[], doesMatchProperty: [keyof T, unknow
|
|
|
64
64
|
* Checks if every item in an array has a specific property, where the property name is provided as a string.
|
|
65
65
|
*
|
|
66
66
|
* @template T
|
|
67
|
-
* @param {
|
|
67
|
+
* @param {T[]} arr - The array to check through.
|
|
68
68
|
* @param {string} propertyToCheck - The property name to check.
|
|
69
69
|
* @returns {boolean} - `true` if every item has the specified property, or `false` if at least one item does not match.
|
|
70
70
|
*
|
|
@@ -79,22 +79,22 @@ declare function every<T>(arr: readonly T[], propertyToCheck: string): boolean;
|
|
|
79
79
|
* Checks if every item in an object matches the given predicate function.
|
|
80
80
|
*
|
|
81
81
|
* @template T
|
|
82
|
-
* @param {T
|
|
83
|
-
* @param {(
|
|
82
|
+
* @param {T} object - The object to check through.
|
|
83
|
+
* @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.
|
|
84
84
|
* @returns {boolean} - `true` if every property value matches the predicate, or `false` if at least one does not match.
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
87
|
* // Using a predicate function
|
|
88
88
|
* const obj = { a: 1, b: 2, c: 3 };
|
|
89
|
-
* const result = every(obj, (
|
|
89
|
+
* const result = every(obj, (value) => value > 0);
|
|
90
90
|
* console.log(result); // true
|
|
91
91
|
*/
|
|
92
|
-
declare function every<T extends Record<string, unknown>>(object: T, doesMatch: (
|
|
92
|
+
declare function every<T extends Record<string, unknown>>(object: T, doesMatch: (value: T[keyof T], key: keyof T, object: T) => unknown): boolean;
|
|
93
93
|
/**
|
|
94
94
|
* Checks if every item in an object matches the given partial value.
|
|
95
95
|
*
|
|
96
96
|
* @template T
|
|
97
|
-
* @param {T
|
|
97
|
+
* @param {T} object - The object to check through.
|
|
98
98
|
* @param {Partial<T[keyof T]>} doesMatch - A partial value to match against the values of the object.
|
|
99
99
|
* @returns {boolean} - `true` if every property value matches the partial value, or `false` if at least one does not match.
|
|
100
100
|
*
|
|
@@ -109,14 +109,14 @@ declare function every<T extends Record<string, unknown>>(object: T, doesMatch:
|
|
|
109
109
|
* Checks if every item in an object matches a property with a specific value.
|
|
110
110
|
*
|
|
111
111
|
* @template T
|
|
112
|
-
* @param {
|
|
112
|
+
* @param {T[]} object - The object to check through.
|
|
113
113
|
* @param {[keyof T, unknown]} doesMatchProperty - An array where the first element is the property key and the second element is the value to match.
|
|
114
114
|
* @returns {boolean} - `true` if every item has the specified property value, or `false` if at least one item does not match.
|
|
115
115
|
*
|
|
116
116
|
* @example
|
|
117
117
|
* // Using a property-value pair
|
|
118
|
-
* const
|
|
119
|
-
* const result = every(
|
|
118
|
+
* const obj = { alice: { id: 1, name: 'Alice' }, bob: { id: 2, name: 'Bob' } };
|
|
119
|
+
* const result = every(obj, ['name', 'Alice']);
|
|
120
120
|
* console.log(result); // false
|
|
121
121
|
*/
|
|
122
122
|
declare function every<T extends Record<string, unknown>>(object: T, doesMatchProperty: [keyof T, unknown]): boolean;
|
|
@@ -124,7 +124,7 @@ declare function every<T extends Record<string, unknown>>(object: T, doesMatchPr
|
|
|
124
124
|
* Checks if every item in an object has a specific property, where the property name is provided as a string.
|
|
125
125
|
*
|
|
126
126
|
* @template T
|
|
127
|
-
* @param {T
|
|
127
|
+
* @param {T} object - The object to check through.
|
|
128
128
|
* @param {string} propertyToCheck - The property name to check.
|
|
129
129
|
* @returns {boolean} - `true` if every property value has the specified property, or `false` if at least one does not match.
|
|
130
130
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.22.0-dev.
|
|
4
|
+
"version": "1.22.0-dev.691+6fa1f00e",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|