@stryke/path 0.24.4 → 0.25.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 +20 -0
- package/dist/append.cjs +59 -1
- package/dist/append.mjs +57 -1
- package/dist/append.mjs.map +1 -1
- package/dist/asset-extensions.cjs +40 -1
- package/dist/asset-extensions.mjs +39 -1
- package/dist/asset-extensions.mjs.map +1 -1
- package/dist/common.cjs +34 -1
- package/dist/common.mjs +34 -1
- package/dist/common.mjs.map +1 -1
- package/dist/correct-path.cjs +176 -1
- package/dist/correct-path.mjs +169 -1
- package/dist/correct-path.mjs.map +1 -1
- package/dist/cwd.cjs +17 -1
- package/dist/cwd.mjs +16 -1
- package/dist/cwd.mjs.map +1 -1
- package/dist/delimiter.cjs +27 -1
- package/dist/delimiter.mjs +24 -1
- package/dist/delimiter.mjs.map +1 -1
- package/dist/file-path-fns.cjs +332 -1
- package/dist/file-path-fns.mjs +311 -1
- package/dist/file-path-fns.mjs.map +1 -1
- package/dist/find.cjs +24 -1
- package/dist/find.mjs +3 -1
- package/dist/glob-to-regex.cjs +97 -0
- package/dist/glob-to-regex.d.cts +50 -0
- package/dist/glob-to-regex.d.cts.map +1 -0
- package/dist/glob-to-regex.d.mts +50 -0
- package/dist/glob-to-regex.d.mts.map +1 -0
- package/dist/glob-to-regex.mjs +98 -0
- package/dist/glob-to-regex.mjs.map +1 -0
- package/dist/index.cjs +73 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +17 -1
- package/dist/is-parent-path.cjs +32 -1
- package/dist/is-parent-path.mjs +32 -1
- package/dist/is-parent-path.mjs.map +1 -1
- package/dist/is-root-dir.cjs +14 -1
- package/dist/is-root-dir.mjs +13 -1
- package/dist/is-root-dir.mjs.map +1 -1
- package/dist/is-type.cjs +92 -1
- package/dist/is-type.mjs +87 -1
- package/dist/is-type.mjs.map +1 -1
- package/dist/join-paths.cjs +108 -1
- package/dist/join-paths.mjs +107 -1
- package/dist/join-paths.mjs.map +1 -1
- package/dist/join.cjs +4 -1
- package/dist/join.mjs +3 -1
- package/dist/normalize.cjs +10 -1
- package/dist/normalize.mjs +3 -1
- package/dist/regex.cjs +20 -1
- package/dist/regex.mjs +12 -1
- package/dist/regex.mjs.map +1 -1
- package/dist/replace.cjs +44 -1
- package/dist/replace.mjs +43 -1
- package/dist/replace.mjs.map +1 -1
- package/dist/resolve-parent-path.cjs +18 -1
- package/dist/resolve-parent-path.mjs +18 -1
- package/dist/resolve-parent-path.mjs.map +1 -1
- package/dist/slash.cjs +27 -1
- package/dist/slash.mjs +26 -1
- package/dist/slash.mjs.map +1 -1
- package/dist/type-checks/src/is-empty.cjs +20 -1
- package/dist/type-checks/src/is-empty.mjs +20 -1
- package/dist/type-checks/src/is-empty.mjs.map +1 -1
- package/dist/type-checks/src/is-null.cjs +12 -1
- package/dist/type-checks/src/is-null.mjs +11 -1
- package/dist/type-checks/src/is-null.mjs.map +1 -1
- package/dist/type-checks/src/is-set-string.cjs +20 -1
- package/dist/type-checks/src/is-set-string.mjs +20 -1
- package/dist/type-checks/src/is-set-string.mjs.map +1 -1
- package/dist/type-checks/src/is-set.cjs +19 -1
- package/dist/type-checks/src/is-set.mjs +19 -1
- package/dist/type-checks/src/is-set.mjs.map +1 -1
- package/dist/type-checks/src/is-string.cjs +12 -1
- package/dist/type-checks/src/is-string.mjs +11 -1
- package/dist/type-checks/src/is-string.mjs.map +1 -1
- package/dist/type-checks/src/is-undefined.cjs +8 -1
- package/dist/type-checks/src/is-undefined.mjs +7 -1
- package/dist/type-checks/src/is-undefined.mjs.map +1 -1
- package/dist/types/src/base.cjs +6 -1
- package/dist/types/src/base.mjs +5 -1
- package/dist/types/src/base.mjs.map +1 -1
- package/package.json +9 -5
package/dist/regex.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex.mjs","names":[],"sources":["../src/regex.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const DRIVE_LETTER_START_REGEX = /^[A-Z]:\\//i;\nexport const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;\n\nexport const UNC_REGEX = /^[/\\\\]{2}/;\n\nexport const ABSOLUTE_PATH_REGEX =\n /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^~[/\\\\]|^[A-Z]:[/\\\\]/i;\n\nexport const ROOT_FOLDER_REGEX = /^\\/([A-Z]:)?$/i;\n\nexport const FILE_EXTENSION_REGEX = /\\.[0-9a-z]+$/i;\n\nexport const PACKAGE_PATH_REGEX = /^@\\w+\\/.*$/;\nexport const NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\\w-]+\\/)?[\\w-]+$/;\n"],"mappings":"AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"regex.mjs","names":[],"sources":["../src/regex.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const DRIVE_LETTER_START_REGEX = /^[A-Z]:\\//i;\nexport const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;\n\nexport const UNC_REGEX = /^[/\\\\]{2}/;\n\nexport const ABSOLUTE_PATH_REGEX =\n /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^~[/\\\\]|^[A-Z]:[/\\\\]/i;\n\nexport const ROOT_FOLDER_REGEX = /^\\/([A-Z]:)?$/i;\n\nexport const FILE_EXTENSION_REGEX = /\\.[0-9a-z]+$/i;\n\nexport const PACKAGE_PATH_REGEX = /^@\\w+\\/.*$/;\nexport const NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\\w-]+\\/)?[\\w-]+$/;\n"],"mappings":";AAkBA,MAAa,2BAA2B;AACxC,MAAa,qBAAqB;AAElC,MAAa,YAAY;AAEzB,MAAa,sBACX;AAEF,MAAa,oBAAoB;AAEjC,MAAa,uBAAuB;AAEpC,MAAa,qBAAqB;AAClC,MAAa,2BAA2B"}
|
package/dist/replace.cjs
CHANGED
|
@@ -1 +1,44 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_cwd = require('./cwd.cjs');
|
|
2
|
+
const require_slash = require('./slash.cjs');
|
|
3
|
+
const require_is_parent_path = require('./is-parent-path.cjs');
|
|
4
|
+
const require_file_path_fns = require('./file-path-fns.cjs');
|
|
5
|
+
|
|
6
|
+
//#region src/replace.ts
|
|
7
|
+
/**
|
|
8
|
+
* Replace the base path from the beginning of the given path.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* replacePath("/home/user/project/src/index.ts", "/home/user/project");
|
|
13
|
+
* // returns "src/index.ts"
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param childPath - The child path to replace the {@link parentPath} substring from
|
|
17
|
+
* @param parentPath - The parent path to remove from the {@link childPath} parameter
|
|
18
|
+
* @returns The {@link childPath} with the {@link parentPath} path removed
|
|
19
|
+
*/
|
|
20
|
+
function replacePath(childPath, parentPath = require_cwd.cwd()) {
|
|
21
|
+
return require_is_parent_path.isParentPath(childPath, parentPath) ? require_slash.slash(childPath).replace(require_slash.slash(parentPath), "").replace(/^\//, "") : childPath;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Replace the extension of a given path with the provided value.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* replaceExtension("/home/user/project/src/index.ts", ".js");
|
|
29
|
+
* // returns "/home/user/project/src/index.js"
|
|
30
|
+
* replaceExtension("/home/user/project/src/index.ts");
|
|
31
|
+
* // returns "/home/user/project/src/index"
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param path - The path that will have its current extension replaced
|
|
35
|
+
* @param replacement - The value (or an empty string) to replace the current extension with
|
|
36
|
+
* @returns The path with the replaced extension
|
|
37
|
+
*/
|
|
38
|
+
function replaceExtension(path, replacement = "") {
|
|
39
|
+
return path.replace(!replacement || replacement.includes(".") ? require_file_path_fns.findFileDotExtensionSafe(path) : require_file_path_fns.findFileExtensionSafe(path), replacement);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.replaceExtension = replaceExtension;
|
|
44
|
+
exports.replacePath = replacePath;
|
package/dist/replace.mjs
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { cwd } from "./cwd.mjs";
|
|
2
|
+
import { slash } from "./slash.mjs";
|
|
3
|
+
import { isParentPath } from "./is-parent-path.mjs";
|
|
4
|
+
import { findFileDotExtensionSafe, findFileExtensionSafe } from "./file-path-fns.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/replace.ts
|
|
7
|
+
/**
|
|
8
|
+
* Replace the base path from the beginning of the given path.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* replacePath("/home/user/project/src/index.ts", "/home/user/project");
|
|
13
|
+
* // returns "src/index.ts"
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param childPath - The child path to replace the {@link parentPath} substring from
|
|
17
|
+
* @param parentPath - The parent path to remove from the {@link childPath} parameter
|
|
18
|
+
* @returns The {@link childPath} with the {@link parentPath} path removed
|
|
19
|
+
*/
|
|
20
|
+
function replacePath(childPath, parentPath = cwd()) {
|
|
21
|
+
return isParentPath(childPath, parentPath) ? slash(childPath).replace(slash(parentPath), "").replace(/^\//, "") : childPath;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Replace the extension of a given path with the provided value.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* replaceExtension("/home/user/project/src/index.ts", ".js");
|
|
29
|
+
* // returns "/home/user/project/src/index.js"
|
|
30
|
+
* replaceExtension("/home/user/project/src/index.ts");
|
|
31
|
+
* // returns "/home/user/project/src/index"
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param path - The path that will have its current extension replaced
|
|
35
|
+
* @param replacement - The value (or an empty string) to replace the current extension with
|
|
36
|
+
* @returns The path with the replaced extension
|
|
37
|
+
*/
|
|
38
|
+
function replaceExtension(path, replacement = "") {
|
|
39
|
+
return path.replace(!replacement || replacement.includes(".") ? findFileDotExtensionSafe(path) : findFileExtensionSafe(path), replacement);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { replaceExtension, replacePath };
|
|
2
44
|
//# sourceMappingURL=replace.mjs.map
|
package/dist/replace.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace.mjs","names":[],"sources":["../src/replace.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { cwd } from \"./cwd\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"./file-path-fns\";\nimport { isParentPath } from \"./is-parent-path\";\nimport { slash } from \"./slash\";\n\n/**\n * Replace the base path from the beginning of the given path.\n *\n * @example\n * ```ts\n * replacePath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n * // returns \"src/index.ts\"\n * ```\n *\n * @param childPath - The child path to replace the {@link parentPath} substring from\n * @param parentPath - The parent path to remove from the {@link childPath} parameter\n * @returns The {@link childPath} with the {@link parentPath} path removed\n */\nexport function replacePath(\n childPath: string,\n parentPath: string = cwd()\n): string {\n return isParentPath(childPath, parentPath)\n ? slash(childPath).replace(slash(parentPath), \"\").replace(/^\\//, \"\")\n : childPath;\n}\n\n/**\n * Replace the extension of a given path with the provided value.\n *\n * @example\n * ```ts\n * replaceExtension(\"/home/user/project/src/index.ts\", \".js\");\n * // returns \"/home/user/project/src/index.js\"\n * replaceExtension(\"/home/user/project/src/index.ts\");\n * // returns \"/home/user/project/src/index\"\n * ```\n *\n * @param path - The path that will have its current extension replaced\n * @param replacement - The value (or an empty string) to replace the current extension with\n * @returns The path with the replaced extension\n */\nexport function replaceExtension(path: string, replacement = \"\"): string {\n return path.replace(\n !replacement || replacement.includes(\".\")\n ? findFileDotExtensionSafe(path)\n : findFileExtensionSafe(path),\n replacement\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"replace.mjs","names":[],"sources":["../src/replace.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { cwd } from \"./cwd\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"./file-path-fns\";\nimport { isParentPath } from \"./is-parent-path\";\nimport { slash } from \"./slash\";\n\n/**\n * Replace the base path from the beginning of the given path.\n *\n * @example\n * ```ts\n * replacePath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n * // returns \"src/index.ts\"\n * ```\n *\n * @param childPath - The child path to replace the {@link parentPath} substring from\n * @param parentPath - The parent path to remove from the {@link childPath} parameter\n * @returns The {@link childPath} with the {@link parentPath} path removed\n */\nexport function replacePath(\n childPath: string,\n parentPath: string = cwd()\n): string {\n return isParentPath(childPath, parentPath)\n ? slash(childPath).replace(slash(parentPath), \"\").replace(/^\\//, \"\")\n : childPath;\n}\n\n/**\n * Replace the extension of a given path with the provided value.\n *\n * @example\n * ```ts\n * replaceExtension(\"/home/user/project/src/index.ts\", \".js\");\n * // returns \"/home/user/project/src/index.js\"\n * replaceExtension(\"/home/user/project/src/index.ts\");\n * // returns \"/home/user/project/src/index\"\n * ```\n *\n * @param path - The path that will have its current extension replaced\n * @param replacement - The value (or an empty string) to replace the current extension with\n * @returns The path with the replaced extension\n */\nexport function replaceExtension(path: string, replacement = \"\"): string {\n return path.replace(\n !replacement || replacement.includes(\".\")\n ? findFileDotExtensionSafe(path)\n : findFileExtensionSafe(path),\n replacement\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,YACd,WACA,aAAqB,KAAK,EAClB;AACR,QAAO,aAAa,WAAW,WAAW,GACtC,MAAM,UAAU,CAAC,QAAQ,MAAM,WAAW,EAAE,GAAG,CAAC,QAAQ,OAAO,GAAG,GAClE;;;;;;;;;;;;;;;;;AAkBN,SAAgB,iBAAiB,MAAc,cAAc,IAAY;AACvE,QAAO,KAAK,QACV,CAAC,eAAe,YAAY,SAAS,IAAI,GACrC,yBAAyB,KAAK,GAC9B,sBAAsB,KAAK,EAC/B,YACD"}
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_join_paths = require('./join-paths.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/resolve-parent-path.ts
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the parent path of the provided path.
|
|
6
|
+
*
|
|
7
|
+
* @param path - The path to resolve.
|
|
8
|
+
* @param count - The number of parent directories to traverse.
|
|
9
|
+
* @returns The parent path of the provided path.
|
|
10
|
+
*/
|
|
11
|
+
const resolveParentPath = (path, count = 1) => {
|
|
12
|
+
let parentPath = path.replaceAll(/\/+$/g, "");
|
|
13
|
+
for (let i = 0; i < count; i++) parentPath = require_join_paths.joinPaths(parentPath, "..");
|
|
14
|
+
return parentPath;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.resolveParentPath = resolveParentPath;
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import{joinPaths
|
|
1
|
+
import { joinPaths } from "./join-paths.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/resolve-parent-path.ts
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the parent path of the provided path.
|
|
6
|
+
*
|
|
7
|
+
* @param path - The path to resolve.
|
|
8
|
+
* @param count - The number of parent directories to traverse.
|
|
9
|
+
* @returns The parent path of the provided path.
|
|
10
|
+
*/
|
|
11
|
+
const resolveParentPath = (path, count = 1) => {
|
|
12
|
+
let parentPath = path.replaceAll(/\/+$/g, "");
|
|
13
|
+
for (let i = 0; i < count; i++) parentPath = joinPaths(parentPath, "..");
|
|
14
|
+
return parentPath;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { resolveParentPath };
|
|
2
19
|
//# sourceMappingURL=resolve-parent-path.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-parent-path.mjs","names":[],"sources":["../src/resolve-parent-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"./join-paths\";\n\n/**\n * Resolve the parent path of the provided path.\n *\n * @param path - The path to resolve.\n * @param count - The number of parent directories to traverse.\n * @returns The parent path of the provided path.\n */\nexport const resolveParentPath = (path: string, count: number = 1): string => {\n let parentPath = path.replaceAll(/\\/+$/g, \"\");\n for (let i = 0; i < count; i++) {\n parentPath = joinPaths(parentPath, \"..\");\n }\n return parentPath;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-parent-path.mjs","names":[],"sources":["../src/resolve-parent-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"./join-paths\";\n\n/**\n * Resolve the parent path of the provided path.\n *\n * @param path - The path to resolve.\n * @param count - The number of parent directories to traverse.\n * @returns The parent path of the provided path.\n */\nexport const resolveParentPath = (path: string, count: number = 1): string => {\n let parentPath = path.replaceAll(/\\/+$/g, \"\");\n for (let i = 0; i < count; i++) {\n parentPath = joinPaths(parentPath, \"..\");\n }\n return parentPath;\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,qBAAqB,MAAc,QAAgB,MAAc;CAC5E,IAAI,aAAa,KAAK,WAAW,SAAS,GAAG;AAC7C,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,IACzB,cAAa,UAAU,YAAY,KAAK;AAE1C,QAAO"}
|
package/dist/slash.cjs
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_type = require('./is-type.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/slash.ts
|
|
4
|
+
/**
|
|
5
|
+
* Replace backslash to slash
|
|
6
|
+
*
|
|
7
|
+
* @param path - The string to replace
|
|
8
|
+
* @returns The string with replaced backslashes
|
|
9
|
+
*/
|
|
10
|
+
function slash(path) {
|
|
11
|
+
if (path.startsWith("\\\\?\\")) return path;
|
|
12
|
+
return path.replace(/\\/g, "/");
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Replace backslash to slash and remove unneeded leading and trailing slashes
|
|
16
|
+
*
|
|
17
|
+
* @param path - The string to replace
|
|
18
|
+
* @returns The string with replaced backslashes
|
|
19
|
+
*/
|
|
20
|
+
function formatSlash(path) {
|
|
21
|
+
const formatted = slash(path);
|
|
22
|
+
return require_is_type.isAbsolutePath(formatted) ? formatted.replace(/\/+$/g, "") : formatted.replace(/^\.\//g, "").replace(/\/+$/g, "");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.formatSlash = formatSlash;
|
|
27
|
+
exports.slash = slash;
|
package/dist/slash.mjs
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
import{isAbsolutePath
|
|
1
|
+
import { isAbsolutePath } from "./is-type.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/slash.ts
|
|
4
|
+
/**
|
|
5
|
+
* Replace backslash to slash
|
|
6
|
+
*
|
|
7
|
+
* @param path - The string to replace
|
|
8
|
+
* @returns The string with replaced backslashes
|
|
9
|
+
*/
|
|
10
|
+
function slash(path) {
|
|
11
|
+
if (path.startsWith("\\\\?\\")) return path;
|
|
12
|
+
return path.replace(/\\/g, "/");
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Replace backslash to slash and remove unneeded leading and trailing slashes
|
|
16
|
+
*
|
|
17
|
+
* @param path - The string to replace
|
|
18
|
+
* @returns The string with replaced backslashes
|
|
19
|
+
*/
|
|
20
|
+
function formatSlash(path) {
|
|
21
|
+
const formatted = slash(path);
|
|
22
|
+
return isAbsolutePath(formatted) ? formatted.replace(/\/+$/g, "") : formatted.replace(/^\.\//g, "").replace(/\/+$/g, "");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { formatSlash, slash };
|
|
2
27
|
//# sourceMappingURL=slash.mjs.map
|
package/dist/slash.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash.mjs","names":[],"sources":["../src/slash.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isAbsolutePath } from \"./is-type\";\n\n/**\n * Replace backslash to slash\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function slash(path: string) {\n if (path.startsWith(\"\\\\\\\\?\\\\\")) {\n return path;\n }\n\n return path.replace(/\\\\/g, \"/\");\n}\n\n/**\n * Replace backslash to slash and remove unneeded leading and trailing slashes\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function formatSlash(path: string) {\n const formatted = slash(path);\n\n return isAbsolutePath(formatted)\n ? formatted.replace(/\\/+$/g, \"\")\n : formatted.replace(/^\\.\\//g, \"\").replace(/\\/+$/g, \"\");\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"slash.mjs","names":[],"sources":["../src/slash.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isAbsolutePath } from \"./is-type\";\n\n/**\n * Replace backslash to slash\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function slash(path: string) {\n if (path.startsWith(\"\\\\\\\\?\\\\\")) {\n return path;\n }\n\n return path.replace(/\\\\/g, \"/\");\n}\n\n/**\n * Replace backslash to slash and remove unneeded leading and trailing slashes\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function formatSlash(path: string) {\n const formatted = slash(path);\n\n return isAbsolutePath(formatted)\n ? formatted.replace(/\\/+$/g, \"\")\n : formatted.replace(/^\\.\\//g, \"\").replace(/\\/+$/g, \"\");\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,MAAM,MAAc;AAClC,KAAI,KAAK,WAAW,UAAU,CAC5B,QAAO;AAGT,QAAO,KAAK,QAAQ,OAAO,IAAI;;;;;;;;AASjC,SAAgB,YAAY,MAAc;CACxC,MAAM,YAAY,MAAM,KAAK;AAE7B,QAAO,eAAe,UAAU,GAC5B,UAAU,QAAQ,SAAS,GAAG,GAC9B,UAAU,QAAQ,UAAU,GAAG,CAAC,QAAQ,SAAS,GAAG"}
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_null = require('./is-null.cjs');
|
|
2
|
+
const require_is_undefined = require('./is-undefined.cjs');
|
|
3
|
+
|
|
4
|
+
//#region ../type-checks/src/is-empty.ts
|
|
5
|
+
/**
|
|
6
|
+
* Check if the provided value's type is `null` or `undefined`
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
10
|
+
*/
|
|
11
|
+
const isEmpty = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return require_is_undefined.isUndefined(value) || require_is_null.isNull(value);
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.isEmpty = isEmpty;
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import{isNull
|
|
1
|
+
import { isNull } from "./is-null.mjs";
|
|
2
|
+
import { isUndefined } from "./is-undefined.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../type-checks/src/is-empty.ts
|
|
5
|
+
/**
|
|
6
|
+
* Check if the provided value's type is `null` or `undefined`
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
10
|
+
*/
|
|
11
|
+
const isEmpty = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return isUndefined(value) || isNull(value);
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { isEmpty };
|
|
2
21
|
//# sourceMappingURL=is-empty.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty.mjs","names":[],"sources":["../../../../type-checks/src/is-empty.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-empty.mjs","names":[],"sources":["../../../../type-checks/src/is-empty.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n"],"mappings":";;;;;;;;;;AA+BA,MAAa,WAAW,UAAmB;AACzC,KAAI;AACF,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACpC;AACN,SAAO"}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region ../type-checks/src/is-null.ts
|
|
3
|
+
const isNull = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
return value === null;
|
|
6
|
+
} catch {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.isNull = isNull;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
//#region ../type-checks/src/is-null.ts
|
|
2
|
+
const isNull = (value) => {
|
|
3
|
+
try {
|
|
4
|
+
return value === null;
|
|
5
|
+
} catch {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { isNull };
|
|
2
12
|
//# sourceMappingURL=is-null.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-null.mjs","names":[],"sources":["../../../../type-checks/src/is-null.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"is-null.mjs","names":[],"sources":["../../../../type-checks/src/is-null.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,UAAU,UAAkC;AACvD,KAAI;AACF,SAAO,UAAU;SACX;AACN,SAAO"}
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_set = require('./is-set.cjs');
|
|
2
|
+
const require_is_string = require('./is-string.cjs');
|
|
3
|
+
|
|
4
|
+
//#region ../type-checks/src/is-set-string.ts
|
|
5
|
+
/**
|
|
6
|
+
* Determine if the type is string and is not empty (length greater than zero)
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the value provided is of type `string` and length greater than zero
|
|
10
|
+
*/
|
|
11
|
+
const isSetString = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return require_is_set.isSet(value) && require_is_string.isString(value) && value.length > 0;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.isSetString = isSetString;
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import{isSet
|
|
1
|
+
import { isSet } from "./is-set.mjs";
|
|
2
|
+
import { isString } from "./is-string.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../type-checks/src/is-set-string.ts
|
|
5
|
+
/**
|
|
6
|
+
* Determine if the type is string and is not empty (length greater than zero)
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the value provided is of type `string` and length greater than zero
|
|
10
|
+
*/
|
|
11
|
+
const isSetString = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return isSet(value) && isString(value) && value.length > 0;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { isSetString };
|
|
2
21
|
//# sourceMappingURL=is-set-string.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-set-string.mjs","names":[],"sources":["../../../../type-checks/src/is-set-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-set-string.mjs","names":[],"sources":["../../../../type-checks/src/is-set-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,MAAM,MAAM,IAAI,SAAS,MAAM,IAAI,MAAM,SAAS;SACnD;AACN,SAAO"}
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_empty = require('./is-empty.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../type-checks/src/is-set.ts
|
|
4
|
+
/**
|
|
5
|
+
* The inverse of the `isEmpty` function
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
9
|
+
*/
|
|
10
|
+
const isSet = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return !require_is_empty.isEmpty(value);
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.isSet = isSet;
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import{isEmpty
|
|
1
|
+
import { isEmpty } from "./is-empty.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../type-checks/src/is-set.ts
|
|
4
|
+
/**
|
|
5
|
+
* The inverse of the `isEmpty` function
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
9
|
+
*/
|
|
10
|
+
const isSet = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return !isEmpty(value);
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { isSet };
|
|
2
20
|
//# sourceMappingURL=is-set.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-set.mjs","names":[],"sources":["../../../../type-checks/src/is-set.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-set.mjs","names":[],"sources":["../../../../type-checks/src/is-set.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,SAAS,UAAkD;AACtE,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM;SAChB;AACN,SAAO"}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region ../type-checks/src/is-string.ts
|
|
3
|
+
const isString = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
return typeof value === "string";
|
|
6
|
+
} catch {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.isString = isString;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
//#region ../type-checks/src/is-string.ts
|
|
2
|
+
const isString = (value) => {
|
|
3
|
+
try {
|
|
4
|
+
return typeof value === "string";
|
|
5
|
+
} catch {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { isString };
|
|
2
12
|
//# sourceMappingURL=is-string.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-string.mjs","names":[],"sources":["../../../../type-checks/src/is-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"is-string.mjs","names":[],"sources":["../../../../type-checks/src/is-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SAAO,OAAO,UAAU;SAClB;AACN,SAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-undefined.mjs","names":[],"sources":["../../../../type-checks/src/is-undefined.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n"],"mappings":"AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"is-undefined.mjs","names":[],"sources":["../../../../type-checks/src/is-undefined.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n"],"mappings":";AAkBA,MAAa,eAAe,UAAuC;AACjE,QAAO,UAAU"}
|
package/dist/types/src/base.cjs
CHANGED