@splendidlabz/utils 1.10.7 → 1.11.1

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,17 @@
1
1
  # @splendidlabz/utils
2
2
 
3
+ ## 1.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix auth jwt secret
8
+
9
+ ## 1.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Utils: Add isFunction
14
+
3
15
  ## 1.10.7
4
16
 
5
17
  ### 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
  });
@@ -15,7 +15,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
15
  var node_exports = {};
16
16
  module.exports = __toCommonJS(node_exports);
17
17
  __reExport(node_exports, require("./dirname.js"), module.exports);
18
- __reExport(node_exports, require("./env.js"), module.exports);
19
18
  __reExport(node_exports, require("./file-cache.js"), module.exports);
20
19
  __reExport(node_exports, require("./hash.js"), module.exports);
21
20
  __reExport(node_exports, require("./pkce.js"), module.exports);
@@ -25,7 +24,6 @@ __reExport(node_exports, require("./uuid.js"), module.exports);
25
24
  // Annotate the CommonJS export names for ESM import in node:
26
25
  0 && (module.exports = {
27
26
  ...require("./dirname.js"),
28
- ...require("./env.js"),
29
27
  ...require("./file-cache.js"),
30
28
  ...require("./hash.js"),
31
29
  ...require("./pkce.js"),
@@ -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
  };
@@ -1,5 +1,4 @@
1
1
  export * from "./dirname.js";
2
- export * from "./env.js";
3
2
  export * from "./file-cache.js";
4
3
  export * from "./hash.js";
5
4
  export * from "./pkce.js";
@@ -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';
@@ -3,7 +3,7 @@
3
3
  * @param url — import.meta.url
4
4
  * @returns
5
5
  */
6
- declare function __dirname(url: any): string;
6
+ declare function __dirname$1(url: any): string;
7
7
  declare function dirname(url: any): string;
8
8
 
9
- export { __dirname, dirname };
9
+ export { __dirname$1 as __dirname, dirname };
@@ -1,5 +1,4 @@
1
1
  export { __dirname, dirname } from './dirname.cjs';
2
- export { env } from './env.cjs';
3
2
  export { createCache, fileCache, getLastModifiedTime, getLatestModifiedTime, removeFirstSlash } from './file-cache.cjs';
4
3
  export { sha256Hash } from './hash.cjs';
5
4
  export { PKCE } from './pkce.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.1",
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
+ }
package/src/node/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './dirname.js'
2
- export * from './env.js'
3
2
  export * from './file-cache.js'
4
3
  export * from './hash.js'
5
4
  export * from './pkce.js'
@@ -1,30 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var env_exports = {};
19
- __export(env_exports, {
20
- env: () => env
21
- });
22
- module.exports = __toCommonJS(env_exports);
23
- const import_meta = {};
24
- function env(key) {
25
- return process.env[key] || import_meta.env?.[key];
26
- }
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- env
30
- });
@@ -1,6 +0,0 @@
1
- function env(key) {
2
- return process.env[key] || import.meta.env?.[key];
3
- }
4
- export {
5
- env
6
- };
@@ -1,3 +0,0 @@
1
- declare function env(key: any): any;
2
-
3
- export { env };
package/src/node/env.js DELETED
@@ -1,3 +0,0 @@
1
- export function env(key) {
2
- return process.env[key] || import.meta.env?.[key]
3
- }