es-toolkit 1.13.1-dev.348 → 1.13.1-dev.349
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.
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/_internal/getTag.mjs +9 -0
- package/dist/compat/_internal/getTag.mjs.map +1 -0
- package/dist/compat/index.d.mts +2 -0
- package/dist/compat/index.d.ts +2 -0
- package/dist/compat/index.js +2 -0
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +2 -0
- package/dist/compat/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/index.d.mts +2 -0
- package/dist/predicate/index.d.ts +2 -0
- package/dist/predicate/index.js +17 -0
- package/dist/predicate/index.js.map +1 -1
- package/dist/predicate/index.mjs +2 -0
- package/dist/predicate/index.mjs.map +1 -1
- package/dist/predicate/isArguments.d.mts +23 -0
- package/dist/predicate/isArguments.d.ts +23 -0
- package/dist/predicate/isArguments.mjs +8 -0
- package/dist/predicate/isArguments.mjs.map +1 -0
- package/dist/predicate/isObjectLike.d.mts +27 -0
- package/dist/predicate/isObjectLike.d.ts +27 -0
- package/dist/predicate/isObjectLike.mjs +6 -0
- package/dist/predicate/isObjectLike.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the given value is an object-like.
|
|
3
|
+
*
|
|
4
|
+
* This function tests whether the provided value is an object-like or not.
|
|
5
|
+
* It returns `true` if the value is an object-like, and `false` otherwise.
|
|
6
|
+
*
|
|
7
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object-like.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of value.
|
|
10
|
+
* @param {T} value - The value to test if it is an object-like.
|
|
11
|
+
* @returns {value is Extract<T, object>} `true` if the value is an object-like, `false` otherwise.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const value1 = { a: 1 };
|
|
15
|
+
* const value2 = [1, 2, 3];
|
|
16
|
+
* const value3 = 'abc';
|
|
17
|
+
* const value4 = () => {};
|
|
18
|
+
* const value5 = null;
|
|
19
|
+
*
|
|
20
|
+
* console.log(isObjectLike(value1)); // true
|
|
21
|
+
* console.log(isObjectLike(value2)); // true
|
|
22
|
+
* console.log(isObjectLike(value3)); // false
|
|
23
|
+
* console.log(isObjectLike(value4)); // false
|
|
24
|
+
*/
|
|
25
|
+
declare function isObjectLike<T>(value: T): value is Extract<T, object>;
|
|
26
|
+
|
|
27
|
+
export { isObjectLike };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the given value is an object-like.
|
|
3
|
+
*
|
|
4
|
+
* This function tests whether the provided value is an object-like or not.
|
|
5
|
+
* It returns `true` if the value is an object-like, and `false` otherwise.
|
|
6
|
+
*
|
|
7
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object-like.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of value.
|
|
10
|
+
* @param {T} value - The value to test if it is an object-like.
|
|
11
|
+
* @returns {value is Extract<T, object>} `true` if the value is an object-like, `false` otherwise.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const value1 = { a: 1 };
|
|
15
|
+
* const value2 = [1, 2, 3];
|
|
16
|
+
* const value3 = 'abc';
|
|
17
|
+
* const value4 = () => {};
|
|
18
|
+
* const value5 = null;
|
|
19
|
+
*
|
|
20
|
+
* console.log(isObjectLike(value1)); // true
|
|
21
|
+
* console.log(isObjectLike(value2)); // true
|
|
22
|
+
* console.log(isObjectLike(value3)); // false
|
|
23
|
+
* console.log(isObjectLike(value4)); // false
|
|
24
|
+
*/
|
|
25
|
+
declare function isObjectLike<T>(value: T): value is Extract<T, object>;
|
|
26
|
+
|
|
27
|
+
export { isObjectLike };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isObjectLike.mjs","sources":["../../src/predicate/isObjectLike.ts"],"sourcesContent":["/**\n * Checks if the given value is an object-like.\n *\n * This function tests whether the provided value is an object-like or not.\n * It returns `true` if the value is an object-like, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object-like.\n *\n * @template T - The type of value.\n * @param {T} value - The value to test if it is an object-like.\n * @returns {value is Extract<T, object>} `true` if the value is an object-like, `false` otherwise.\n *\n * @example\n * const value1 = { a: 1 };\n * const value2 = [1, 2, 3];\n * const value3 = 'abc';\n * const value4 = () => {};\n * const value5 = null;\n *\n * console.log(isObjectLike(value1)); // true\n * console.log(isObjectLike(value2)); // true\n * console.log(isObjectLike(value3)); // false\n * console.log(isObjectLike(value4)); // false\n */\n\nexport function isObjectLike<T>(value: T): value is Extract<T, object> {\n return typeof value === 'object' && value !== null;\n}\n"],"names":[],"mappings":"AAyBM,SAAU,YAAY,CAAI,KAAQ,EAAA;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD;;;;"}
|
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.13.1-dev.
|
|
4
|
+
"version": "1.13.1-dev.349+a02b4158",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|