@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 +12 -0
- package/dist/cjs/lib/checks.cjs +5 -0
- package/dist/cjs/node/index.cjs +0 -2
- package/dist/esm/lib/checks.js +4 -0
- package/dist/esm/node/index.js +0 -1
- package/dist/types/lib/checks.d.cts +2 -1
- package/dist/types/lib/index.d.cts +1 -1
- package/dist/types/node/dirname.d.cts +2 -2
- package/dist/types/node/index.d.cts +0 -1
- package/package.json +1 -1
- package/src/lib/checks.js +4 -0
- package/src/node/index.js +0 -1
- package/dist/cjs/node/env.cjs +0 -30
- package/dist/esm/node/env.js +0 -6
- package/dist/types/node/env.d.cts +0 -3
- package/src/node/env.js +0 -3
package/CHANGELOG.md
CHANGED
package/dist/cjs/lib/checks.cjs
CHANGED
|
@@ -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
|
});
|
package/dist/cjs/node/index.cjs
CHANGED
|
@@ -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"),
|
package/dist/esm/lib/checks.js
CHANGED
package/dist/esm/node/index.js
CHANGED
|
@@ -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
package/src/lib/checks.js
CHANGED
package/src/node/index.js
CHANGED
package/dist/cjs/node/env.cjs
DELETED
|
@@ -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
|
-
});
|
package/dist/esm/node/env.js
DELETED
package/src/node/env.js
DELETED