@t007/utils 0.0.9 → 0.0.10

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/index.cjs CHANGED
@@ -31,6 +31,7 @@ __export(index_exports, {
31
31
  initScrollAssist: () => initScrollAssist,
32
32
  initVScrollerator: () => initVScrollerator,
33
33
  isArr: () => isArr,
34
+ isBool: () => isBool,
34
35
  isDef: () => import_utils.isDef,
35
36
  isFunc: () => isFunc,
36
37
  isIter: () => isIter,
@@ -53,6 +54,9 @@ var import_utils2 = require("sia-reactor/utils");
53
54
  function isSym(val) {
54
55
  return "symbol" === typeof val;
55
56
  }
57
+ function isBool(val) {
58
+ return "boolean" === typeof val;
59
+ }
56
60
  function isNum(val) {
57
61
  return "number" === typeof val;
58
62
  }
@@ -281,6 +285,7 @@ if ((0, import_utils.isDef)(window)) {
281
285
  initScrollAssist,
282
286
  initVScrollerator,
283
287
  isArr,
288
+ isBool,
284
289
  isDef,
285
290
  isFunc,
286
291
  isIter,
package/dist/index.d.cts CHANGED
@@ -52,13 +52,14 @@ declare global {
52
52
  var t007: T007Namespace;
53
53
  }
54
54
 
55
- declare function isSym<T = symbol>(val: any): val is T;
56
- declare function isNum<T = number>(val: any): val is T;
57
- declare function isStr<T = string>(val: any): val is T;
55
+ declare function isSym<T extends symbol = symbol>(val: any): val is T;
56
+ declare function isBool<T extends boolean = boolean>(val: any): val is T;
57
+ declare function isNum<T extends number = number>(val: any): val is T;
58
+ declare function isStr<T extends string = string>(val: any): val is T;
58
59
  declare function isArr<T = unknown>(obj: any): obj is T[];
59
60
 
60
61
  declare function isIter<T = unknown>(obj: any): obj is Iterable<T>;
61
- declare function isFunc<T = Function>(val: any): val is T;
62
+ declare function isFunc<T extends Function = Function>(val: any): val is T;
62
63
  declare function inBoolArrOpt(opt: any, str: string): boolean;
63
64
 
64
65
  declare function clamp(min: number | undefined, val: number, max?: number): number;
@@ -92,4 +93,4 @@ declare function bindAllMethods(owner: any): void;
92
93
  declare function guardAllMethods(owner: any, guardFn?: (fn: Function) => Function, bound?: boolean): void;
93
94
  declare function guardMethod<T extends Function>(fn: T, onError?: (e: any) => void): T;
94
95
 
95
- export { type Dataset, type LoadResourceOptions, type ResourceType, type ScrollAssistControl, type Style, VIRTUAL_RESOURCE, assignEl, bindAllMethods, clamp, createEl, guardAllMethods, guardMethod, inBoolArrOpt, initScrollAssist, initVScrollerator, isArr, isFunc, isIter, isNum, isSameURL, isStr, isSym, loadResource, onAllMethods, removeScrollAssist, uid };
96
+ export { type Dataset, type LoadResourceOptions, type ResourceType, type ScrollAssistControl, type Style, VIRTUAL_RESOURCE, assignEl, bindAllMethods, clamp, createEl, guardAllMethods, guardMethod, inBoolArrOpt, initScrollAssist, initVScrollerator, isArr, isBool, isFunc, isIter, isNum, isSameURL, isStr, isSym, loadResource, onAllMethods, removeScrollAssist, uid };
package/dist/index.d.ts CHANGED
@@ -52,13 +52,14 @@ declare global {
52
52
  var t007: T007Namespace;
53
53
  }
54
54
 
55
- declare function isSym<T = symbol>(val: any): val is T;
56
- declare function isNum<T = number>(val: any): val is T;
57
- declare function isStr<T = string>(val: any): val is T;
55
+ declare function isSym<T extends symbol = symbol>(val: any): val is T;
56
+ declare function isBool<T extends boolean = boolean>(val: any): val is T;
57
+ declare function isNum<T extends number = number>(val: any): val is T;
58
+ declare function isStr<T extends string = string>(val: any): val is T;
58
59
  declare function isArr<T = unknown>(obj: any): obj is T[];
59
60
 
60
61
  declare function isIter<T = unknown>(obj: any): obj is Iterable<T>;
61
- declare function isFunc<T = Function>(val: any): val is T;
62
+ declare function isFunc<T extends Function = Function>(val: any): val is T;
62
63
  declare function inBoolArrOpt(opt: any, str: string): boolean;
63
64
 
64
65
  declare function clamp(min: number | undefined, val: number, max?: number): number;
@@ -92,4 +93,4 @@ declare function bindAllMethods(owner: any): void;
92
93
  declare function guardAllMethods(owner: any, guardFn?: (fn: Function) => Function, bound?: boolean): void;
93
94
  declare function guardMethod<T extends Function>(fn: T, onError?: (e: any) => void): T;
94
95
 
95
- export { type Dataset, type LoadResourceOptions, type ResourceType, type ScrollAssistControl, type Style, VIRTUAL_RESOURCE, assignEl, bindAllMethods, clamp, createEl, guardAllMethods, guardMethod, inBoolArrOpt, initScrollAssist, initVScrollerator, isArr, isFunc, isIter, isNum, isSameURL, isStr, isSym, loadResource, onAllMethods, removeScrollAssist, uid };
96
+ export { type Dataset, type LoadResourceOptions, type ResourceType, type ScrollAssistControl, type Style, VIRTUAL_RESOURCE, assignEl, bindAllMethods, clamp, createEl, guardAllMethods, guardMethod, inBoolArrOpt, initScrollAssist, initVScrollerator, isArr, isBool, isFunc, isIter, isNum, isSameURL, isStr, isSym, loadResource, onAllMethods, removeScrollAssist, uid };
package/dist/index.js CHANGED
@@ -4,6 +4,9 @@ import { isObj, isStrictObj } from "sia-reactor/utils";
4
4
  function isSym(val) {
5
5
  return "symbol" === typeof val;
6
6
  }
7
+ function isBool(val) {
8
+ return "boolean" === typeof val;
9
+ }
7
10
  function isNum(val) {
8
11
  return "number" === typeof val;
9
12
  }
@@ -231,6 +234,7 @@ export {
231
234
  initScrollAssist,
232
235
  initVScrollerator,
233
236
  isArr,
237
+ isBool,
234
238
  isDef,
235
239
  isFunc,
236
240
  isIter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t007/utils",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "High-performance, zero-dependency utility functions for the t007 ecosystem.",
5
5
  "author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
6
6
  "license": "MIT",
@@ -45,6 +45,6 @@
45
45
  "performance"
46
46
  ],
47
47
  "dependencies": {
48
- "sia-reactor": "^0.0.10"
48
+ "sia-reactor": "^0.0.12"
49
49
  }
50
50
  }