@splendidlabz/utils 1.10.7 → 1.11.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @splendidlabz/utils
2
2
 
3
+ ## 1.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Utils: Add isFunction
8
+
3
9
  ## 1.10.7
4
10
 
5
11
  ### Patch Changes
@@ -19,6 +19,7 @@ var checks_exports = {};
19
19
  __export(checks_exports, {
20
20
  getType: () => getType,
21
21
  isArray: () => isArray,
22
+ isFunction: () => isFunction,
22
23
  isObject: () => isObject,
23
24
  notObject: () => notObject
24
25
  });
@@ -47,10 +48,14 @@ function getType(x) {
47
48
  if (typeof x === "object") return "object";
48
49
  return "unknown";
49
50
  }
51
+ function isFunction(x) {
52
+ return typeof x === "function";
53
+ }
50
54
  // Annotate the CommonJS export names for ESM import in node:
51
55
  0 && (module.exports = {
52
56
  getType,
53
57
  isArray,
58
+ isFunction,
54
59
  isObject,
55
60
  notObject
56
61
  });
@@ -22,9 +22,13 @@ function getType(x) {
22
22
  if (typeof x === "object") return "object";
23
23
  return "unknown";
24
24
  }
25
+ function isFunction(x) {
26
+ return typeof x === "function";
27
+ }
25
28
  export {
26
29
  getType,
27
30
  isArray,
31
+ isFunction,
28
32
  isObject,
29
33
  notObject
30
34
  };
@@ -28,5 +28,6 @@ declare function isArray(x: unknown): boolean;
28
28
  */
29
29
  declare function notObject(x: unknown): boolean;
30
30
  declare function getType(x: any): "string" | "integer" | "float" | "boolean" | "function" | "undefined" | "symbol" | "bigint" | "array" | "object" | "unknown";
31
+ declare function isFunction(x: any): boolean;
31
32
 
32
- export { getType, isArray, isObject, notObject };
33
+ export { getType, isArray, isFunction, isObject, notObject };
@@ -5,7 +5,7 @@ export { sort } from './arrays/sort.cjs';
5
5
  export { splitArray } from './arrays/split-array.cjs';
6
6
  export { uniqueArray } from './arrays/unique.cjs';
7
7
  export { AuthManager, RouteManager } from './auth/route-manager.cjs';
8
- export { getType, isArray, isObject, notObject } from './checks.cjs';
8
+ export { getType, isArray, isFunction, isObject, notObject } from './checks.cjs';
9
9
  export { DAYS } from './date/days.cjs';
10
10
  export { MONTHS } from './date/months.cjs';
11
11
  export { getTimeInMs, ms, toDays, toHours, toMinutes, toReadableTime, toSeconds, toWeeks } from './date/time.cjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splendidlabz/utils",
3
- "version": "1.10.7",
3
+ "version": "1.11.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "homepage": "https://splendidlabz.com/docs/utils",
package/src/lib/checks.js CHANGED
@@ -51,3 +51,7 @@ export function getType(x) {
51
51
  if (typeof x === 'object') return 'object'
52
52
  return 'unknown'
53
53
  }
54
+
55
+ export function isFunction(x) {
56
+ return typeof x === 'function'
57
+ }