es-toolkit 1.13.1-dev.378 → 1.13.1-dev.380

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.
@@ -87,6 +87,7 @@ export { isArrayLike } from '../predicate/isArrayLike.mjs';
87
87
  export { isPrimitive } from '../predicate/isPrimitive.mjs';
88
88
  export { isObjectLike } from '../predicate/isObjectLike.mjs';
89
89
  export { isArguments } from '../predicate/isArguments.mjs';
90
+ export { isBoolean } from '../predicate/isBoolean.mjs';
90
91
  export { delay } from '../promise/delay.mjs';
91
92
  export { withTimeout } from '../promise/withTimeout.mjs';
92
93
  export { camelCase } from '../string/camelCase.mjs';
@@ -87,6 +87,7 @@ export { isArrayLike } from '../predicate/isArrayLike.js';
87
87
  export { isPrimitive } from '../predicate/isPrimitive.js';
88
88
  export { isObjectLike } from '../predicate/isObjectLike.js';
89
89
  export { isArguments } from '../predicate/isArguments.js';
90
+ export { isBoolean } from '../predicate/isBoolean.js';
90
91
  export { delay } from '../promise/delay.js';
91
92
  export { withTimeout } from '../promise/withTimeout.js';
92
93
  export { camelCase } from '../string/camelCase.js';
@@ -499,6 +499,7 @@ exports.pick = object_index.pick;
499
499
  exports.pickBy = object_index.pickBy;
500
500
  exports.isArguments = predicate_index.isArguments;
501
501
  exports.isArrayLike = predicate_index.isArrayLike;
502
+ exports.isBoolean = predicate_index.isBoolean;
502
503
  exports.isEqual = predicate_index.isEqual;
503
504
  exports.isFunction = predicate_index.isFunction;
504
505
  exports.isLength = predicate_index.isLength;
@@ -87,6 +87,7 @@ export { isArrayLike } from '../predicate/isArrayLike.mjs';
87
87
  export { isPrimitive } from '../predicate/isPrimitive.mjs';
88
88
  export { isObjectLike } from '../predicate/isObjectLike.mjs';
89
89
  export { isArguments } from '../predicate/isArguments.mjs';
90
+ export { isBoolean } from '../predicate/isBoolean.mjs';
90
91
  export { delay } from '../promise/delay.mjs';
91
92
  export { withTimeout } from '../promise/withTimeout.mjs';
92
93
  export { camelCase } from '../string/camelCase.mjs';
package/dist/index.d.mts CHANGED
@@ -96,6 +96,7 @@ export { isTypedArray } from './predicate/isTypedArray.mjs';
96
96
  export { isPrimitive } from './predicate/isPrimitive.mjs';
97
97
  export { isObjectLike } from './predicate/isObjectLike.mjs';
98
98
  export { isArguments } from './predicate/isArguments.mjs';
99
+ export { isBoolean } from './predicate/isBoolean.mjs';
99
100
  export { delay } from './promise/delay.mjs';
100
101
  export { withTimeout } from './promise/withTimeout.mjs';
101
102
  export { camelCase } from './string/camelCase.mjs';
package/dist/index.d.ts CHANGED
@@ -96,6 +96,7 @@ export { isTypedArray } from './predicate/isTypedArray.js';
96
96
  export { isPrimitive } from './predicate/isPrimitive.js';
97
97
  export { isObjectLike } from './predicate/isObjectLike.js';
98
98
  export { isArguments } from './predicate/isArguments.js';
99
+ export { isBoolean } from './predicate/isBoolean.js';
99
100
  export { delay } from './promise/delay.js';
100
101
  export { withTimeout } from './promise/withTimeout.js';
101
102
  export { camelCase } from './string/camelCase.js';
package/dist/index.js CHANGED
@@ -105,6 +105,7 @@ exports.pick = object_index.pick;
105
105
  exports.pickBy = object_index.pickBy;
106
106
  exports.isArguments = predicate_index.isArguments;
107
107
  exports.isArrayLike = predicate_index.isArrayLike;
108
+ exports.isBoolean = predicate_index.isBoolean;
108
109
  exports.isEqual = predicate_index.isEqual;
109
110
  exports.isFunction = predicate_index.isFunction;
110
111
  exports.isLength = predicate_index.isLength;
package/dist/index.mjs CHANGED
@@ -96,6 +96,7 @@ export { isTypedArray } from './predicate/isTypedArray.mjs';
96
96
  export { isPrimitive } from './predicate/isPrimitive.mjs';
97
97
  export { isObjectLike } from './predicate/isObjectLike.mjs';
98
98
  export { isArguments } from './predicate/isArguments.mjs';
99
+ export { isBoolean } from './predicate/isBoolean.mjs';
99
100
  export { delay } from './promise/delay.mjs';
100
101
  export { withTimeout } from './promise/withTimeout.mjs';
101
102
  export { camelCase } from './string/camelCase.mjs';
@@ -11,3 +11,4 @@ export { isTypedArray } from './isTypedArray.mjs';
11
11
  export { isPrimitive } from './isPrimitive.mjs';
12
12
  export { isObjectLike } from './isObjectLike.mjs';
13
13
  export { isArguments } from './isArguments.mjs';
14
+ export { isBoolean } from './isBoolean.mjs';
@@ -11,3 +11,4 @@ export { isTypedArray } from './isTypedArray.js';
11
11
  export { isPrimitive } from './isPrimitive.js';
12
12
  export { isObjectLike } from './isObjectLike.js';
13
13
  export { isArguments } from './isArguments.js';
14
+ export { isBoolean } from './isBoolean.js';
@@ -252,12 +252,17 @@ function isArguments(value) {
252
252
  return value !== null && typeof value === 'object' && getTag(value) === '[object Arguments]';
253
253
  }
254
254
 
255
+ function isBoolean(x) {
256
+ return x === false || x === true || (x !== null && typeof x === 'object' && getTag(x) === '[object Boolean]');
257
+ }
258
+
255
259
  exports.isPlainObject = isTypedArray.isPlainObject;
256
260
  exports.isPrimitive = isTypedArray.isPrimitive;
257
261
  exports.isTypedArray = isTypedArray.isTypedArray;
258
262
  exports.isNil = isNil.isNil;
259
263
  exports.isArguments = isArguments;
260
264
  exports.isArrayLike = isArrayLike;
265
+ exports.isBoolean = isBoolean;
261
266
  exports.isEqual = isEqual;
262
267
  exports.isFunction = isFunction;
263
268
  exports.isLength = isLength;
@@ -11,3 +11,4 @@ export { isTypedArray } from './isTypedArray.mjs';
11
11
  export { isPrimitive } from './isPrimitive.mjs';
12
12
  export { isObjectLike } from './isObjectLike.mjs';
13
13
  export { isArguments } from './isArguments.mjs';
14
+ export { isBoolean } from './isBoolean.mjs';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Checks if the given value is boolean.
3
+ *
4
+ * This function tests whether the provided value is strictly `boolean`.
5
+ * It returns `true` if the value is `boolean`, and `false` otherwise.
6
+ *
7
+ * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `boolean`.
8
+ *
9
+ * @param {unknown} x - The Value to test if it is boolean.
10
+ * @returns {x is boolean} True if the value is booelan, false otherwise.
11
+ *
12
+ * @example
13
+ *
14
+ * const value1 = true;
15
+ * const value2 = 0;
16
+ * const value3 = 'abc';
17
+ *
18
+ * console.log(isBoolean(value1)); // true
19
+ * console.log(isBoolean(value2)); // false
20
+ * console.log(isBoolean(value3)); // false
21
+ *
22
+ */
23
+ declare function isBoolean(x: unknown): x is boolean;
24
+
25
+ export { isBoolean };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Checks if the given value is boolean.
3
+ *
4
+ * This function tests whether the provided value is strictly `boolean`.
5
+ * It returns `true` if the value is `boolean`, and `false` otherwise.
6
+ *
7
+ * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `boolean`.
8
+ *
9
+ * @param {unknown} x - The Value to test if it is boolean.
10
+ * @returns {x is boolean} True if the value is booelan, false otherwise.
11
+ *
12
+ * @example
13
+ *
14
+ * const value1 = true;
15
+ * const value2 = 0;
16
+ * const value3 = 'abc';
17
+ *
18
+ * console.log(isBoolean(value1)); // true
19
+ * console.log(isBoolean(value2)); // false
20
+ * console.log(isBoolean(value3)); // false
21
+ *
22
+ */
23
+ declare function isBoolean(x: unknown): x is boolean;
24
+
25
+ export { isBoolean };
@@ -0,0 +1,7 @@
1
+ import { getTag } from '../compat/_internal/getTag.mjs';
2
+
3
+ function isBoolean(x) {
4
+ return x === false || x === true || (x !== null && typeof x === 'object' && getTag(x) === '[object Boolean]');
5
+ }
6
+
7
+ export { isBoolean };
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.378+b2427e1f",
4
+ "version": "1.13.1-dev.380+5ef7f3e2",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {