@stryke/fs 0.33.78 → 0.33.80
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 +24 -0
- package/dist/_virtual/_rolldown/runtime.cjs +14 -0
- package/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/buffer.cjs +12 -0
- package/dist/buffer.mjs +8 -1
- package/dist/buffer.mjs.map +1 -1
- package/dist/buffer.test.cjs +13 -0
- package/dist/buffer.test.d.cts +1 -0
- package/dist/buffer.test.d.mts +1 -0
- package/dist/buffer.test.mjs +14 -0
- package/dist/buffer.test.mjs.map +1 -0
- package/dist/chmod-x.cjs +14 -0
- package/dist/chmod-x.mjs +10 -1
- package/dist/chmod-x.mjs.map +1 -1
- package/dist/chmod-x.test.cjs +13 -0
- package/dist/chmod-x.test.d.cts +1 -0
- package/dist/chmod-x.test.d.mts +1 -0
- package/dist/chmod-x.test.mjs +14 -0
- package/dist/chmod-x.test.mjs.map +1 -0
- package/dist/command-exists.cjs +11 -1
- package/dist/command-exists.mjs +6 -1
- package/dist/command-exists.mjs.map +1 -1
- package/dist/command-exists.test.cjs +13 -0
- package/dist/command-exists.test.d.cts +1 -0
- package/dist/command-exists.test.d.mts +1 -0
- package/dist/command-exists.test.mjs +14 -0
- package/dist/command-exists.test.mjs.map +1 -0
- package/dist/compress.cjs +8 -1
- package/dist/compress.mjs +3 -1
- package/dist/compress.mjs.map +1 -1
- package/dist/compress.test.cjs +13 -0
- package/dist/compress.test.d.cts +1 -0
- package/dist/compress.test.d.mts +1 -0
- package/dist/compress.test.mjs +14 -0
- package/dist/compress.test.mjs.map +1 -0
- package/dist/constants.cjs +13 -0
- package/dist/constants.mjs +8 -1
- package/dist/constants.mjs.map +1 -0
- package/dist/constants.test.cjs +13 -0
- package/dist/constants.test.d.cts +1 -0
- package/dist/constants.test.d.mts +1 -0
- package/dist/constants.test.mjs +14 -0
- package/dist/constants.test.mjs.map +1 -0
- package/dist/copy-file.cjs +13 -1
- package/dist/copy-file.mjs +8 -1
- package/dist/copy-file.mjs.map +1 -1
- package/dist/copy-file.test.cjs +13 -0
- package/dist/copy-file.test.d.cts +1 -0
- package/dist/copy-file.test.d.mts +1 -0
- package/dist/copy-file.test.mjs +14 -0
- package/dist/copy-file.test.mjs.map +1 -0
- package/dist/exists.cjs +11 -1
- package/dist/exists.mjs +6 -1
- package/dist/exists.mjs.map +1 -1
- package/dist/exists.test.cjs +13 -0
- package/dist/exists.test.d.cts +1 -0
- package/dist/exists.test.d.mts +1 -0
- package/dist/exists.test.mjs +14 -0
- package/dist/exists.test.mjs.map +1 -0
- package/dist/get-parent-path.cjs +8 -1
- package/dist/get-parent-path.mjs +3 -1
- package/dist/get-parent-path.mjs.map +1 -1
- package/dist/get-parent-path.test.cjs +13 -0
- package/dist/get-parent-path.test.d.cts +1 -0
- package/dist/get-parent-path.test.d.mts +1 -0
- package/dist/get-parent-path.test.mjs +14 -0
- package/dist/get-parent-path.test.mjs.map +1 -0
- package/dist/get-workspace-root.cjs +16 -0
- package/dist/get-workspace-root.mjs +12 -1
- package/dist/get-workspace-root.mjs.map +1 -1
- package/dist/get-workspace-root.test.cjs +13 -0
- package/dist/get-workspace-root.test.d.cts +1 -0
- package/dist/get-workspace-root.test.d.mts +1 -0
- package/dist/get-workspace-root.test.mjs +14 -0
- package/dist/get-workspace-root.test.mjs.map +1 -0
- package/dist/helpers.cjs +14 -0
- package/dist/helpers.mjs +10 -1
- package/dist/helpers.mjs.map +1 -1
- package/dist/helpers.test.cjs +13 -0
- package/dist/helpers.test.d.cts +1 -0
- package/dist/helpers.test.d.mts +1 -0
- package/dist/helpers.test.mjs +14 -0
- package/dist/helpers.test.mjs.map +1 -0
- package/dist/index.cjs +111 -0
- package/dist/index.mjs +107 -1
- package/dist/index.mjs.map +1 -0
- package/dist/index.test.cjs +13 -0
- package/dist/index.test.d.cts +1 -0
- package/dist/index.test.d.mts +1 -0
- package/dist/index.test.mjs +14 -0
- package/dist/index.test.mjs.map +1 -0
- package/dist/install.cjs +10 -0
- package/dist/install.mjs +6 -1
- package/dist/install.mjs.map +1 -1
- package/dist/install.test.cjs +13 -0
- package/dist/install.test.d.cts +1 -0
- package/dist/install.test.d.mts +1 -0
- package/dist/install.test.mjs +14 -0
- package/dist/install.test.mjs.map +1 -0
- package/dist/is-file.cjs +13 -1
- package/dist/is-file.mjs +8 -1
- package/dist/is-file.mjs.map +1 -1
- package/dist/is-file.test.cjs +13 -0
- package/dist/is-file.test.d.cts +1 -0
- package/dist/is-file.test.d.mts +1 -0
- package/dist/is-file.test.mjs +14 -0
- package/dist/is-file.test.mjs.map +1 -0
- package/dist/json.cjs +12 -0
- package/dist/json.mjs +8 -1
- package/dist/json.mjs.map +1 -1
- package/dist/json.test.cjs +13 -0
- package/dist/json.test.d.cts +1 -0
- package/dist/json.test.d.mts +1 -0
- package/dist/json.test.mjs +14 -0
- package/dist/json.test.mjs.map +1 -0
- package/dist/list-files.cjs +15 -1
- package/dist/list-files.mjs +10 -1
- package/dist/list-files.mjs.map +1 -1
- package/dist/list-files.test.cjs +13 -0
- package/dist/list-files.test.d.cts +1 -0
- package/dist/list-files.test.d.mts +1 -0
- package/dist/list-files.test.mjs +14 -0
- package/dist/list-files.test.mjs.map +1 -0
- package/dist/package-fns.cjs +16 -1
- package/dist/package-fns.mjs +11 -1
- package/dist/package-fns.mjs.map +1 -1
- package/dist/package-fns.test.cjs +13 -0
- package/dist/package-fns.test.d.cts +1 -0
- package/dist/package-fns.test.d.mts +1 -0
- package/dist/package-fns.test.mjs +14 -0
- package/dist/package-fns.test.mjs.map +1 -0
- package/dist/read-file.cjs +13 -1
- package/dist/read-file.mjs +8 -1
- package/dist/read-file.mjs.map +1 -1
- package/dist/read-file.test.cjs +13 -0
- package/dist/read-file.test.d.cts +1 -0
- package/dist/read-file.test.d.mts +1 -0
- package/dist/read-file.test.mjs +14 -0
- package/dist/read-file.test.mjs.map +1 -0
- package/dist/registry.cjs +13 -0
- package/dist/registry.mjs +9 -1
- package/dist/registry.mjs.map +1 -1
- package/dist/registry.test.cjs +13 -0
- package/dist/registry.test.d.cts +1 -0
- package/dist/registry.test.d.mts +1 -0
- package/dist/registry.test.mjs +14 -0
- package/dist/registry.test.mjs.map +1 -0
- package/dist/remove-file.cjs +11 -1
- package/dist/remove-file.mjs +6 -1
- package/dist/remove-file.mjs.map +1 -1
- package/dist/remove-file.test.cjs +13 -0
- package/dist/remove-file.test.d.cts +1 -0
- package/dist/remove-file.test.d.mts +1 -0
- package/dist/remove-file.test.mjs +14 -0
- package/dist/remove-file.test.mjs.map +1 -0
- package/dist/resolve.cjs +20 -1
- package/dist/resolve.mjs +15 -1
- package/dist/resolve.mjs.map +1 -1
- package/dist/resolve.test.cjs +13 -0
- package/dist/resolve.test.d.cts +1 -0
- package/dist/resolve.test.d.mts +1 -0
- package/dist/resolve.test.mjs +14 -0
- package/dist/resolve.test.mjs.map +1 -0
- package/dist/semver-fns.cjs +20 -1
- package/dist/semver-fns.mjs +15 -1
- package/dist/semver-fns.mjs.map +1 -1
- package/dist/semver-fns.test.cjs +13 -0
- package/dist/semver-fns.test.d.cts +1 -0
- package/dist/semver-fns.test.d.mts +1 -0
- package/dist/semver-fns.test.mjs +14 -0
- package/dist/semver-fns.test.mjs.map +1 -0
- package/dist/toml.cjs +12 -0
- package/dist/toml.mjs +8 -1
- package/dist/toml.mjs.map +1 -1
- package/dist/toml.test.cjs +13 -0
- package/dist/toml.test.d.cts +1 -0
- package/dist/toml.test.d.mts +1 -0
- package/dist/toml.test.mjs +14 -0
- package/dist/toml.test.mjs.map +1 -0
- package/dist/tsconfig.cjs +8 -1
- package/dist/tsconfig.mjs +3 -1
- package/dist/tsconfig.mjs.map +1 -1
- package/dist/tsconfig.test.cjs +13 -0
- package/dist/tsconfig.test.d.cts +1 -0
- package/dist/tsconfig.test.d.mts +1 -0
- package/dist/tsconfig.test.mjs +14 -0
- package/dist/tsconfig.test.mjs.map +1 -0
- package/dist/write-file.cjs +11 -1
- package/dist/write-file.mjs +6 -1
- package/dist/write-file.mjs.map +1 -1
- package/dist/write-file.test.cjs +13 -0
- package/dist/write-file.test.d.cts +1 -0
- package/dist/write-file.test.d.mts +1 -0
- package/dist/write-file.test.mjs +14 -0
- package/dist/write-file.test.mjs.map +1 -0
- package/dist/yaml.cjs +11 -1
- package/dist/yaml.mjs +6 -1
- package/dist/yaml.mjs.map +1 -1
- package/dist/yaml.test.cjs +13 -0
- package/dist/yaml.test.d.cts +1 -0
- package/dist/yaml.test.d.mts +1 -0
- package/dist/yaml.test.mjs +14 -0
- package/dist/yaml.test.mjs.map +1 -0
- package/package.json +110 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Stryke - Fs
|
|
4
4
|
|
|
5
|
+
## [0.33.79](https://github.com/storm-software/stryke/releases/tag/fs%400.33.79) (05/27/2026)
|
|
6
|
+
|
|
7
|
+
### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated **convert** to **v0.7.10**
|
|
10
|
+
- Updated **helpers** to **v0.10.19**
|
|
11
|
+
- Updated **json** to **v0.15.3**
|
|
12
|
+
- Updated **path** to **v0.29.6**
|
|
13
|
+
- Updated **string-format** to **v0.17.21**
|
|
14
|
+
- Updated **type-checks** to **v0.6.12**
|
|
15
|
+
- Updated **types** to **v0.12.7**
|
|
16
|
+
|
|
17
|
+
## [0.33.78](https://github.com/storm-software/stryke/releases/tag/fs%400.33.78) (05/27/2026)
|
|
18
|
+
|
|
19
|
+
### Updated Dependencies
|
|
20
|
+
|
|
21
|
+
- Updated **convert** to **v0.7.9**
|
|
22
|
+
- Updated **helpers** to **v0.10.18**
|
|
23
|
+
- Updated **json** to **v0.15.2**
|
|
24
|
+
- Updated **path** to **v0.29.5**
|
|
25
|
+
- Updated **string-format** to **v0.17.20**
|
|
26
|
+
- Updated **type-checks** to **v0.6.11**
|
|
27
|
+
- Updated **types** to **v0.12.6**
|
|
28
|
+
|
|
5
29
|
## [0.33.77](https://github.com/storm-software/stryke/releases/tag/fs%400.33.77) (05/25/2026)
|
|
6
30
|
|
|
7
31
|
### Updated Dependencies
|
|
@@ -5,6 +5,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
10
|
+
for (var name in all) {
|
|
11
|
+
__defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (!no_symbols) {
|
|
17
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
8
21
|
var __copyProps = (to, from, except, desc) => {
|
|
9
22
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
23
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -26,4 +39,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
39
|
|
|
27
40
|
//#endregion
|
|
28
41
|
|
|
42
|
+
exports.__exportAll = __exportAll;
|
|
29
43
|
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) {
|
|
6
|
+
__defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!no_symbols) {
|
|
12
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { __exportAll };
|
package/dist/buffer.cjs
CHANGED
|
@@ -7,6 +7,12 @@ let node_fs = require("node:fs");
|
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
8
8
|
|
|
9
9
|
//#region src/buffer.ts
|
|
10
|
+
var buffer_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
11
|
+
readFileBuffer: () => readFileBuffer,
|
|
12
|
+
readFileBufferSync: () => readFileBufferSync,
|
|
13
|
+
writeFileBuffer: () => writeFileBuffer,
|
|
14
|
+
writeFileBufferSync: () => writeFileBufferSync
|
|
15
|
+
});
|
|
10
16
|
/**
|
|
11
17
|
* Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.
|
|
12
18
|
*
|
|
@@ -55,6 +61,12 @@ function writeFileBufferSync(filePath, data) {
|
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
//#endregion
|
|
64
|
+
Object.defineProperty(exports, 'buffer_exports', {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return buffer_exports;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
58
70
|
exports.readFileBuffer = readFileBuffer;
|
|
59
71
|
exports.readFileBufferSync = readFileBufferSync;
|
|
60
72
|
exports.writeFileBuffer = writeFileBuffer;
|
package/dist/buffer.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { createDirectory, createDirectorySync } from "./helpers.mjs";
|
|
2
3
|
import { findFilePath } from "@stryke/path";
|
|
3
4
|
import { Buffer } from "node:buffer";
|
|
@@ -5,6 +6,12 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
5
6
|
import { readFile, writeFile } from "node:fs/promises";
|
|
6
7
|
|
|
7
8
|
//#region src/buffer.ts
|
|
9
|
+
var buffer_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
readFileBuffer: () => readFileBuffer,
|
|
11
|
+
readFileBufferSync: () => readFileBufferSync,
|
|
12
|
+
writeFileBuffer: () => writeFileBuffer,
|
|
13
|
+
writeFileBufferSync: () => writeFileBufferSync
|
|
14
|
+
});
|
|
8
15
|
/**
|
|
9
16
|
* Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.
|
|
10
17
|
*
|
|
@@ -53,5 +60,5 @@ function writeFileBufferSync(filePath, data) {
|
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
//#endregion
|
|
56
|
-
export { readFileBuffer, readFileBufferSync, writeFileBuffer, writeFileBufferSync };
|
|
63
|
+
export { buffer_exports, readFileBuffer, readFileBufferSync, writeFileBuffer, writeFileBufferSync };
|
|
57
64
|
//# sourceMappingURL=buffer.mjs.map
|
package/dist/buffer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.mjs","names":[],"sources":["../src/buffer.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 { findFilePath } from \"@stryke/path\";\nimport { Buffer } from \"node:buffer\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport async function readFileBuffer(filePath: string): Promise<ArrayBuffer> {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = await readFile(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport function readFileBufferSync(filePath: string): ArrayBuffer {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = readFileSync(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport async function writeFileBuffer(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n await createDirectory(findFilePath(filePath));\n }\n\n await writeFile(filePath, Buffer.from(data));\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport function writeFileBufferSync(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n createDirectorySync(findFilePath(filePath));\n }\n\n writeFileSync(filePath, Buffer.from(data));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer.mjs","names":[],"sources":["../src/buffer.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 { findFilePath } from \"@stryke/path\";\nimport { Buffer } from \"node:buffer\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport async function readFileBuffer(filePath: string): Promise<ArrayBuffer> {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = await readFile(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport function readFileBufferSync(filePath: string): ArrayBuffer {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = readFileSync(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport async function writeFileBuffer(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n await createDirectory(findFilePath(filePath));\n }\n\n await writeFile(filePath, Buffer.from(data));\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport function writeFileBufferSync(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n createDirectorySync(findFilePath(filePath));\n }\n\n writeFileSync(filePath, Buffer.from(data));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA,eAAsB,eAAe,UAAwC;AAC3E,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,qCAAqC;AAEvD,KAAI,CAAC,WAAW,SAAS,CACvB,OAAM,IAAI,MAAM,gCAAgC,WAAW;CAG7D,MAAM,IAAI,MAAM,SAAS,SAAS;AAElC,QAAO,EAAE,OAAO,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW;;;;;;;;AASlE,SAAgB,mBAAmB,UAA+B;AAChE,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,qCAAqC;AAEvD,KAAI,CAAC,WAAW,SAAS,CACvB,OAAM,IAAI,MAAM,gCAAgC,WAAW;CAG7D,MAAM,IAAI,aAAa,SAAS;AAEhC,QAAO,EAAE,OAAO,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW;;;;;;;;AASlE,eAAsB,gBAAgB,UAAkB,MAAmB;AACzE,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,sCAAsC;AAExD,KAAI,CAAC,WAAW,aAAa,SAAS,CAAC,CACrC,OAAM,gBAAgB,aAAa,SAAS,CAAC;AAG/C,OAAM,UAAU,UAAU,OAAO,KAAK,KAAK,CAAC;;;;;;;;AAS9C,SAAgB,oBAAoB,UAAkB,MAAmB;AACvE,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,sCAAsC;AAExD,KAAI,CAAC,WAAW,aAAa,SAAS,CAAC,CACrC,qBAAoB,aAAa,SAAS,CAAC;AAG7C,eAAc,UAAU,OAAO,KAAK,KAAK,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_buffer = require('./buffer.cjs');
|
|
3
|
+
let vitest = require("vitest");
|
|
4
|
+
|
|
5
|
+
//#region src/buffer.test.ts
|
|
6
|
+
(0, vitest.describe)("buffer.ts exports", () => {
|
|
7
|
+
(0, vitest.it)("loads module exports", () => {
|
|
8
|
+
(0, vitest.expect)(require_buffer.buffer_exports).toBeDefined();
|
|
9
|
+
(0, vitest.expect)(typeof require_buffer.buffer_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { buffer_exports } from "./buffer.mjs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
//#region src/buffer.test.ts
|
|
5
|
+
describe("buffer.ts exports", () => {
|
|
6
|
+
it("loads module exports", () => {
|
|
7
|
+
expect(buffer_exports).toBeDefined();
|
|
8
|
+
expect(typeof buffer_exports).toBe("object");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { };
|
|
14
|
+
//# sourceMappingURL=buffer.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buffer.test.mjs","names":["moduleExports"],"sources":["../src/buffer.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./buffer.ts\";\n\ndescribe(\"buffer.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,2BAA2B;AAClC,IAAG,8BAA8B;AAC/B,SAAOA,eAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,eAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
|
package/dist/chmod-x.cjs
CHANGED
|
@@ -4,6 +4,14 @@ let node_fs = require("node:fs");
|
|
|
4
4
|
let node_fs_promises = require("node:fs/promises");
|
|
5
5
|
|
|
6
6
|
//#region src/chmod-x.ts
|
|
7
|
+
var chmod_x_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
8
|
+
chmodX: () => chmodX,
|
|
9
|
+
chmodXSync: () => chmodXSync,
|
|
10
|
+
isExecutable: () => isExecutable,
|
|
11
|
+
isExecutableSync: () => isExecutableSync,
|
|
12
|
+
isWritable: () => isWritable,
|
|
13
|
+
isWritableSync: () => isWritableSync
|
|
14
|
+
});
|
|
7
15
|
/**
|
|
8
16
|
* Adds execute permissions to a file
|
|
9
17
|
*
|
|
@@ -88,6 +96,12 @@ function isExecutableSync(filename) {
|
|
|
88
96
|
//#endregion
|
|
89
97
|
exports.chmodX = chmodX;
|
|
90
98
|
exports.chmodXSync = chmodXSync;
|
|
99
|
+
Object.defineProperty(exports, 'chmod_x_exports', {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function () {
|
|
102
|
+
return chmod_x_exports;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
91
105
|
exports.isExecutable = isExecutable;
|
|
92
106
|
exports.isExecutableSync = isExecutableSync;
|
|
93
107
|
exports.isWritable = isWritable;
|
package/dist/chmod-x.mjs
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { accessSync, chmodSync, constants, statSync } from "node:fs";
|
|
2
3
|
import { access, chmod } from "node:fs/promises";
|
|
3
4
|
|
|
4
5
|
//#region src/chmod-x.ts
|
|
6
|
+
var chmod_x_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
chmodX: () => chmodX,
|
|
8
|
+
chmodXSync: () => chmodXSync,
|
|
9
|
+
isExecutable: () => isExecutable,
|
|
10
|
+
isExecutableSync: () => isExecutableSync,
|
|
11
|
+
isWritable: () => isWritable,
|
|
12
|
+
isWritableSync: () => isWritableSync
|
|
13
|
+
});
|
|
5
14
|
/**
|
|
6
15
|
* Adds execute permissions to a file
|
|
7
16
|
*
|
|
@@ -84,5 +93,5 @@ function isExecutableSync(filename) {
|
|
|
84
93
|
}
|
|
85
94
|
|
|
86
95
|
//#endregion
|
|
87
|
-
export { chmodX, chmodXSync, isExecutable, isExecutableSync, isWritable, isWritableSync };
|
|
96
|
+
export { chmodX, chmodXSync, chmod_x_exports, isExecutable, isExecutableSync, isWritable, isWritableSync };
|
|
88
97
|
//# sourceMappingURL=chmod-x.mjs.map
|
package/dist/chmod-x.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chmod-x.mjs","names":[],"sources":["../src/chmod-x.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 { accessSync, chmodSync, constants, statSync } from \"node:fs\";\nimport { access, chmod } from \"node:fs/promises\";\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport function chmodXSync(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n chmodSync(file, base8);\n}\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport async function chmodX(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n return chmod(file, base8);\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is writable, false otherwise\n */\nexport async function isWritable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is writable, false otherwise\n */\nexport function isWritableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is executable, false otherwise\n */\nexport async function isExecutable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is executable, false otherwise\n */\nexport function isExecutableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chmod-x.mjs","names":[],"sources":["../src/chmod-x.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 { accessSync, chmodSync, constants, statSync } from \"node:fs\";\nimport { access, chmod } from \"node:fs/promises\";\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport function chmodXSync(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n chmodSync(file, base8);\n}\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport async function chmodX(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n return chmod(file, base8);\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is writable, false otherwise\n */\nexport async function isWritable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is writable, false otherwise\n */\nexport function isWritableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is executable, false otherwise\n */\nexport async function isExecutable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is executable, false otherwise\n */\nexport function isExecutableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,SAAgB,WAAW,MAAc;AAGvC,KAAI,QAAQ,aAAa,QACvB;CAGF,MAAM,IAAI,SAAS,KAAK;CACxB,MAAM,UAAU,EAAE,OAAO;AAEzB,KAAI,EAAE,SAAS,QACb;AAIF,WAAU,MAFI,QAAQ,SAAS,EAAE,CAAC,MAAM,GAEnB,CAAC;;;;;;;AAQxB,eAAsB,OAAO,MAAc;AAGzC,KAAI,QAAQ,aAAa,QACvB;CAGF,MAAM,IAAI,SAAS,KAAK;CACxB,MAAM,UAAU,EAAE,OAAO;AAEzB,KAAI,EAAE,SAAS,QACb;AAIF,QAAO,MAAM,MAFC,QAAQ,SAAS,EAAE,CAAC,MAAM,GAEhB,CAAC;;;;;;;;AAS3B,eAAsB,WAAW,UAAoC;AACnE,KAAI;AACF,QAAM,OAAO,UAAU,UAAU,KAAK;AACtC,SAAO;SACD;AACN,SAAO;;;;;;;;;AAUX,SAAgB,eAAe,UAA2B;AACxD,KAAI;AACF,aAAW,UAAU,UAAU,KAAK;AACpC,SAAO;SACD;AACN,SAAO;;;;;;;;;AAUX,eAAsB,aAAa,UAAoC;AACrE,KAAI;AACF,QAAM,OAAO,UAAU,UAAU,KAAK;AACtC,SAAO;SACD;AACN,SAAO;;;;;;;;;AAUX,SAAgB,iBAAiB,UAA2B;AAC1D,KAAI;AACF,aAAW,UAAU,UAAU,KAAK;AACpC,SAAO;SACD;AACN,SAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_chmod_x = require('./chmod-x.cjs');
|
|
3
|
+
let vitest = require("vitest");
|
|
4
|
+
|
|
5
|
+
//#region src/chmod-x.test.ts
|
|
6
|
+
(0, vitest.describe)("chmod-x.ts exports", () => {
|
|
7
|
+
(0, vitest.it)("loads module exports", () => {
|
|
8
|
+
(0, vitest.expect)(require_chmod_x.chmod_x_exports).toBeDefined();
|
|
9
|
+
(0, vitest.expect)(typeof require_chmod_x.chmod_x_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { chmod_x_exports } from "./chmod-x.mjs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
//#region src/chmod-x.test.ts
|
|
5
|
+
describe("chmod-x.ts exports", () => {
|
|
6
|
+
it("loads module exports", () => {
|
|
7
|
+
expect(chmod_x_exports).toBeDefined();
|
|
8
|
+
expect(typeof chmod_x_exports).toBe("object");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { };
|
|
14
|
+
//# sourceMappingURL=chmod-x.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chmod-x.test.mjs","names":["moduleExports"],"sources":["../src/chmod-x.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./chmod-x.ts\";\n\ndescribe(\"chmod-x.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,4BAA4B;AACnC,IAAG,8BAA8B;AAC/B,SAAOA,gBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,gBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
|
package/dist/command-exists.cjs
CHANGED
|
@@ -6,6 +6,10 @@ let node_child_process = require("node:child_process");
|
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
|
|
8
8
|
//#region src/command-exists.ts
|
|
9
|
+
var command_exists_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
10
|
+
commandExists: () => commandExists,
|
|
11
|
+
commandExistsSync: () => commandExistsSync
|
|
12
|
+
});
|
|
9
13
|
const isUsingWindows = process.platform == "win32";
|
|
10
14
|
async function fileNotExists(commandName) {
|
|
11
15
|
try {
|
|
@@ -100,4 +104,10 @@ function commandExistsSync(commandName) {
|
|
|
100
104
|
|
|
101
105
|
//#endregion
|
|
102
106
|
exports.commandExists = commandExists;
|
|
103
|
-
exports.commandExistsSync = commandExistsSync;
|
|
107
|
+
exports.commandExistsSync = commandExistsSync;
|
|
108
|
+
Object.defineProperty(exports, 'command_exists_exports', {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return command_exists_exports;
|
|
112
|
+
}
|
|
113
|
+
});
|
package/dist/command-exists.mjs
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { accessSync } from "node:fs";
|
|
2
3
|
import { access, constants as constants$1 } from "node:fs/promises";
|
|
3
4
|
import { exec, execSync } from "node:child_process";
|
|
4
5
|
import { basename, dirname } from "node:path";
|
|
5
6
|
|
|
6
7
|
//#region src/command-exists.ts
|
|
8
|
+
var command_exists_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
commandExists: () => commandExists,
|
|
10
|
+
commandExistsSync: () => commandExistsSync
|
|
11
|
+
});
|
|
7
12
|
const isUsingWindows = process.platform == "win32";
|
|
8
13
|
async function fileNotExists(commandName) {
|
|
9
14
|
try {
|
|
@@ -97,5 +102,5 @@ function commandExistsSync(commandName) {
|
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
//#endregion
|
|
100
|
-
export { commandExists, commandExistsSync };
|
|
105
|
+
export { commandExists, commandExistsSync, command_exists_exports };
|
|
101
106
|
//# sourceMappingURL=command-exists.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-exists.mjs","names":["constants"],"sources":["../src/command-exists.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 { exec, execSync } from \"node:child_process\";\nimport { accessSync } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\nimport { basename, dirname } from \"node:path\";\n\nconst isUsingWindows = process.platform == \"win32\";\n\nasync function fileNotExists(commandName: string) {\n try {\n await access(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nfunction fileNotExistsSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nasync function localExecutable(commandName: string) {\n return access(commandName, constants.F_OK | constants.X_OK);\n}\n\nfunction localExecutableSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK | constants.X_OK);\n return true;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nasync function commandExistsUnix(\n commandName: string,\n cleanedCommandName: string\n) {\n const isFile = await fileNotExists(commandName);\n\n if (!isFile) {\n exec(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n await localExecutable(commandName);\n }\n}\n\nasync function commandExistsWindows(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return;\n }\n\n exec(`where ${cleanedCommandName}`);\n}\n\nfunction commandExistsUnixSync(\n commandName: string,\n cleanedCommandName: string\n): boolean {\n if (fileNotExistsSync(commandName)) {\n try {\n const stdout = execSync(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n }\n return localExecutableSync(commandName);\n}\n\nfunction commandExistsWindowsSync(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return false;\n }\n try {\n const stdout = execSync(`where ${cleanedCommandName}`, { stdio: [] });\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nfunction cleanInput(s: string) {\n if (/[^\\w/:=-]/.test(s)) {\n s = `'${s.replace(/'/g, \"'\\\\''\")}'`;\n s = s\n .replace(/^(?:'')+/g, \"\") // un-duplicate single-quote at the beginning\n .replace(/\\\\'''/g, \"\\\\'\"); // remove non-escaped single-quote if there are enclosed between 2 escaped\n }\n return s;\n}\n\nconst cleanWindowsInput = (s: string) => {\n const isPathName = /\\\\/.test(s);\n if (isPathName) {\n return `\"${dirname(s)}:${basename(s)}\"`;\n }\n return `\"${s}\"`;\n};\n\n/**\n * Asynchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns A promise that resolves to `true` if the command exists and is executable, `false` otherwise\n */\nexport async function commandExists(commandName: string) {\n const cleanedCommandName = cleanInput(commandName);\n\n if (typeof Promise !== \"undefined\") {\n return commandExists(commandName);\n }\n if (isUsingWindows) {\n return commandExistsWindows(commandName, cleanedCommandName);\n } else {\n return commandExistsUnix(commandName, cleanedCommandName);\n }\n}\n\n/**\n * Synchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns `true` if the command exists and is executable, `false` otherwise\n */\nexport function commandExistsSync(commandName: string): boolean {\n if (isUsingWindows) {\n return commandExistsWindowsSync(\n commandName,\n cleanWindowsInput(commandName)\n );\n } else {\n return commandExistsUnixSync(commandName, cleanInput(commandName));\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-exists.mjs","names":["constants"],"sources":["../src/command-exists.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 { exec, execSync } from \"node:child_process\";\nimport { accessSync } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\nimport { basename, dirname } from \"node:path\";\n\nconst isUsingWindows = process.platform == \"win32\";\n\nasync function fileNotExists(commandName: string) {\n try {\n await access(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nfunction fileNotExistsSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nasync function localExecutable(commandName: string) {\n return access(commandName, constants.F_OK | constants.X_OK);\n}\n\nfunction localExecutableSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK | constants.X_OK);\n return true;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nasync function commandExistsUnix(\n commandName: string,\n cleanedCommandName: string\n) {\n const isFile = await fileNotExists(commandName);\n\n if (!isFile) {\n exec(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n await localExecutable(commandName);\n }\n}\n\nasync function commandExistsWindows(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return;\n }\n\n exec(`where ${cleanedCommandName}`);\n}\n\nfunction commandExistsUnixSync(\n commandName: string,\n cleanedCommandName: string\n): boolean {\n if (fileNotExistsSync(commandName)) {\n try {\n const stdout = execSync(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n }\n return localExecutableSync(commandName);\n}\n\nfunction commandExistsWindowsSync(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return false;\n }\n try {\n const stdout = execSync(`where ${cleanedCommandName}`, { stdio: [] });\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nfunction cleanInput(s: string) {\n if (/[^\\w/:=-]/.test(s)) {\n s = `'${s.replace(/'/g, \"'\\\\''\")}'`;\n s = s\n .replace(/^(?:'')+/g, \"\") // un-duplicate single-quote at the beginning\n .replace(/\\\\'''/g, \"\\\\'\"); // remove non-escaped single-quote if there are enclosed between 2 escaped\n }\n return s;\n}\n\nconst cleanWindowsInput = (s: string) => {\n const isPathName = /\\\\/.test(s);\n if (isPathName) {\n return `\"${dirname(s)}:${basename(s)}\"`;\n }\n return `\"${s}\"`;\n};\n\n/**\n * Asynchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns A promise that resolves to `true` if the command exists and is executable, `false` otherwise\n */\nexport async function commandExists(commandName: string) {\n const cleanedCommandName = cleanInput(commandName);\n\n if (typeof Promise !== \"undefined\") {\n return commandExists(commandName);\n }\n if (isUsingWindows) {\n return commandExistsWindows(commandName, cleanedCommandName);\n } else {\n return commandExistsUnix(commandName, cleanedCommandName);\n }\n}\n\n/**\n * Synchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns `true` if the command exists and is executable, `false` otherwise\n */\nexport function commandExistsSync(commandName: string): boolean {\n if (isUsingWindows) {\n return commandExistsWindowsSync(\n commandName,\n cleanWindowsInput(commandName)\n );\n } else {\n return commandExistsUnixSync(commandName, cleanInput(commandName));\n }\n}\n"],"mappings":";;;;;;;;;;;AAuBA,MAAM,iBAAiB,QAAQ,YAAY;AAE3C,eAAe,cAAc,aAAqB;AAChD,KAAI;AACF,QAAM,OAAO,aAAaA,YAAU,KAAK;AACzC,SAAO;UAEA,GAAG;AACV,SAAO;;;AAIX,SAAS,kBAAkB,aAAqB;AAC9C,KAAI;AACF,aAAW,aAAaA,YAAU,KAAK;AACvC,SAAO;UAEA,GAAG;AACV,SAAO;;;AAIX,eAAe,gBAAgB,aAAqB;AAClD,QAAO,OAAO,aAAaA,YAAU,OAAOA,YAAU,KAAK;;AAG7D,SAAS,oBAAoB,aAAqB;AAChD,KAAI;AACF,aAAW,aAAaA,YAAU,OAAOA,YAAU,KAAK;AACxD,SAAO;UAEA,GAAG;AACV,SAAO;;;AAIX,eAAe,kBACb,aACA,oBACA;AAGA,KAAI,CAAC,MAFgB,cAAc,YAAY,EAElC;AACX,OACE,cAAc,mBAAmB,6BACb,mBAAmB,aACxC;AAED,QAAM,gBAAgB,YAAY;;;AAItC,eAAe,qBACb,aACA,oBACA;AAEA,KAAI,CAAC,qDAAqD,KAAK,YAAY,CACzE;AAGF,MAAK,SAAS,qBAAqB;;AAGrC,SAAS,sBACP,aACA,oBACS;AACT,KAAI,kBAAkB,YAAY,CAChC,KAAI;AAMF,SAAO,CAAC,CALO,SACb,cAAc,mBAAmB,6BACb,mBAAmB,aAG1B;UAER,GAAG;AACV,SAAO;;AAGX,QAAO,oBAAoB,YAAY;;AAGzC,SAAS,yBACP,aACA,oBACA;AAEA,KAAI,CAAC,qDAAqD,KAAK,YAAY,CACzE,QAAO;AAET,KAAI;AAGF,SAAO,CAAC,CAFO,SAAS,SAAS,sBAAsB,EAAE,OAAO,EAAE,EAAE,CAErD;UAER,GAAG;AACV,SAAO;;;AAIX,SAAS,WAAW,GAAW;AAC7B,KAAI,YAAY,KAAK,EAAE,EAAE;AACvB,MAAI,IAAI,EAAE,QAAQ,MAAM,QAAQ,CAAC;AACjC,MAAI,EACD,QAAQ,aAAa,GAAG,CACxB,QAAQ,UAAU,MAAM;;AAE7B,QAAO;;AAGT,MAAM,qBAAqB,MAAc;AAEvC,KADmB,KAAK,KAAK,EACf,CACZ,QAAO,IAAI,QAAQ,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC;AAEvC,QAAO,IAAI,EAAE;;;;;;;;;;AAWf,eAAsB,cAAc,aAAqB;CACvD,MAAM,qBAAqB,WAAW,YAAY;AAElD,KAAI,OAAO,YAAY,YACrB,QAAO,cAAc,YAAY;AAEnC,KAAI,eACF,QAAO,qBAAqB,aAAa,mBAAmB;KAE5D,QAAO,kBAAkB,aAAa,mBAAmB;;;;;;;;;;AAY7D,SAAgB,kBAAkB,aAA8B;AAC9D,KAAI,eACF,QAAO,yBACL,aACA,kBAAkB,YAAY,CAC/B;KAED,QAAO,sBAAsB,aAAa,WAAW,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_command_exists = require('./command-exists.cjs');
|
|
3
|
+
let vitest = require("vitest");
|
|
4
|
+
|
|
5
|
+
//#region src/command-exists.test.ts
|
|
6
|
+
(0, vitest.describe)("command-exists.ts exports", () => {
|
|
7
|
+
(0, vitest.it)("loads module exports", () => {
|
|
8
|
+
(0, vitest.expect)(require_command_exists.command_exists_exports).toBeDefined();
|
|
9
|
+
(0, vitest.expect)(typeof require_command_exists.command_exists_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { command_exists_exports } from "./command-exists.mjs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
//#region src/command-exists.test.ts
|
|
5
|
+
describe("command-exists.ts exports", () => {
|
|
6
|
+
it("loads module exports", () => {
|
|
7
|
+
expect(command_exists_exports).toBeDefined();
|
|
8
|
+
expect(typeof command_exists_exports).toBe("object");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { };
|
|
14
|
+
//# sourceMappingURL=command-exists.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-exists.test.mjs","names":["moduleExports"],"sources":["../src/command-exists.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./command-exists.ts\";\n\ndescribe(\"command-exists.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,mCAAmC;AAC1C,IAAG,8BAA8B;AAC/B,SAAOA,uBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,uBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
|
package/dist/compress.cjs
CHANGED
|
@@ -10,6 +10,7 @@ let _stryke_convert_uint8_array_to_string = require("@stryke/convert/uint8-array
|
|
|
10
10
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
11
11
|
|
|
12
12
|
//#region src/compress.ts
|
|
13
|
+
var compress_exports = /* @__PURE__ */ require_runtime.__exportAll({ compressDirectory: () => compressDirectory });
|
|
13
14
|
/**
|
|
14
15
|
* Compress a directory or file into a tar.gz archive.
|
|
15
16
|
*
|
|
@@ -26,4 +27,10 @@ async function compressDirectory(directory, options) {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
//#endregion
|
|
29
|
-
exports.compressDirectory = compressDirectory;
|
|
30
|
+
exports.compressDirectory = compressDirectory;
|
|
31
|
+
Object.defineProperty(exports, 'compress_exports', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return compress_exports;
|
|
35
|
+
}
|
|
36
|
+
});
|
package/dist/compress.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { isDirectory } from "./is-file.mjs";
|
|
2
3
|
import { listFiles } from "./list-files.mjs";
|
|
3
4
|
import { readFileIfExisting } from "./read-file.mjs";
|
|
@@ -8,6 +9,7 @@ import { uint8ArrayToString } from "@stryke/convert/uint8-array-to-string";
|
|
|
8
9
|
import { joinPaths as joinPaths$1 } from "@stryke/path/join-paths";
|
|
9
10
|
|
|
10
11
|
//#region src/compress.ts
|
|
12
|
+
var compress_exports = /* @__PURE__ */ __exportAll({ compressDirectory: () => compressDirectory });
|
|
11
13
|
/**
|
|
12
14
|
* Compress a directory or file into a tar.gz archive.
|
|
13
15
|
*
|
|
@@ -24,5 +26,5 @@ async function compressDirectory(directory, options) {
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
//#endregion
|
|
27
|
-
export { compressDirectory };
|
|
29
|
+
export { compressDirectory, compress_exports };
|
|
28
30
|
//# sourceMappingURL=compress.mjs.map
|
package/dist/compress.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress.mjs","names":["joinPaths"],"sources":["../src/compress.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 { uint8ArrayToString } from \"@stryke/convert/uint8-array-to-string\";\nimport { findFolderName, resolveParentPath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { GlobOptions } from \"glob\";\nimport { createTarGzip } from \"nanotar\";\nimport { isDirectory } from \"./is-file\";\nimport { listFiles } from \"./list-files\";\nimport { readFileIfExisting } from \"./read-file\";\nimport { writeFile } from \"./write-file\";\n\nexport interface CompressDirectoryOptions extends GlobOptions {\n destination?: string;\n}\n\n/**\n * Compress a directory or file into a tar.gz archive.\n *\n * @param directory - The source directory or file/glob to compress.\n * @param options - Options for the compression.\n */\nexport async function compressDirectory(\n directory: string,\n options?: CompressDirectoryOptions\n): Promise<void> {\n const files = await listFiles(\n isDirectory(directory) ? joinPaths(directory, \"**/*\") : directory,\n options\n );\n const data = await createTarGzip(\n await Promise.all(\n files.map(async file => ({\n name: file,\n data: await readFileIfExisting(file)\n }))\n ),\n {\n attrs: { group: \"storm-software\" }\n }\n );\n\n return writeFile(\n options?.destination\n ? isDirectory(options.destination)\n ? joinPaths(options.destination, `${new Date().getTime()}.tar.gz`)\n : options.destination\n : isDirectory(directory)\n ? `${joinPaths(resolveParentPath(directory), findFolderName(directory))}.tar.gz`\n : directory,\n uint8ArrayToString(data)\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"compress.mjs","names":["joinPaths"],"sources":["../src/compress.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 { uint8ArrayToString } from \"@stryke/convert/uint8-array-to-string\";\nimport { findFolderName, resolveParentPath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { GlobOptions } from \"glob\";\nimport { createTarGzip } from \"nanotar\";\nimport { isDirectory } from \"./is-file\";\nimport { listFiles } from \"./list-files\";\nimport { readFileIfExisting } from \"./read-file\";\nimport { writeFile } from \"./write-file\";\n\nexport interface CompressDirectoryOptions extends GlobOptions {\n destination?: string;\n}\n\n/**\n * Compress a directory or file into a tar.gz archive.\n *\n * @param directory - The source directory or file/glob to compress.\n * @param options - Options for the compression.\n */\nexport async function compressDirectory(\n directory: string,\n options?: CompressDirectoryOptions\n): Promise<void> {\n const files = await listFiles(\n isDirectory(directory) ? joinPaths(directory, \"**/*\") : directory,\n options\n );\n const data = await createTarGzip(\n await Promise.all(\n files.map(async file => ({\n name: file,\n data: await readFileIfExisting(file)\n }))\n ),\n {\n attrs: { group: \"storm-software\" }\n }\n );\n\n return writeFile(\n options?.destination\n ? isDirectory(options.destination)\n ? joinPaths(options.destination, `${new Date().getTime()}.tar.gz`)\n : options.destination\n : isDirectory(directory)\n ? `${joinPaths(resolveParentPath(directory), findFolderName(directory))}.tar.gz`\n : directory,\n uint8ArrayToString(data)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,eAAsB,kBACpB,WACA,SACe;CACf,MAAM,QAAQ,MAAM,UAClB,YAAY,UAAU,GAAGA,YAAU,WAAW,OAAO,GAAG,WACxD,QACD;CACD,MAAM,OAAO,MAAM,cACjB,MAAM,QAAQ,IACZ,MAAM,IAAI,OAAM,UAAS;EACvB,MAAM;EACN,MAAM,MAAM,mBAAmB,KAAK;EACrC,EAAE,CACJ,EACD,EACE,OAAO,EAAE,OAAO,kBAAkB,EACnC,CACF;AAED,QAAO,UACL,SAAS,cACL,YAAY,QAAQ,YAAY,GAC9BA,YAAU,QAAQ,aAAa,oBAAG,IAAI,MAAM,EAAC,SAAS,CAAC,SAAS,GAChE,QAAQ,cACV,YAAY,UAAU,GACpB,GAAGA,YAAU,kBAAkB,UAAU,EAAE,eAAe,UAAU,CAAC,CAAC,WACtE,WACN,mBAAmB,KAAK,CACzB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_compress = require('./compress.cjs');
|
|
3
|
+
let vitest = require("vitest");
|
|
4
|
+
|
|
5
|
+
//#region src/compress.test.ts
|
|
6
|
+
(0, vitest.describe)("compress.ts exports", () => {
|
|
7
|
+
(0, vitest.it)("loads module exports", () => {
|
|
8
|
+
(0, vitest.expect)(require_compress.compress_exports).toBeDefined();
|
|
9
|
+
(0, vitest.expect)(typeof require_compress.compress_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { compress_exports } from "./compress.mjs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
//#region src/compress.test.ts
|
|
5
|
+
describe("compress.ts exports", () => {
|
|
6
|
+
it("loads module exports", () => {
|
|
7
|
+
expect(compress_exports).toBeDefined();
|
|
8
|
+
expect(typeof compress_exports).toBe("object");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { };
|
|
14
|
+
//# sourceMappingURL=compress.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress.test.mjs","names":["moduleExports"],"sources":["../src/compress.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./compress.ts\";\n\ndescribe(\"compress.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,6BAA6B;AACpC,IAAG,8BAA8B;AAC/B,SAAOA,iBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,iBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
|
package/dist/constants.cjs
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/constants.ts
|
|
5
|
+
var constants_exports = /* @__PURE__ */ require_runtime.__exportAll({});
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
Object.defineProperty(exports, 'constants_exports', {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return constants_exports;
|
|
12
|
+
}
|
|
13
|
+
});
|
package/dist/constants.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../src/constants.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 type Encoding =\n | \"ascii\"\n | \"utf8\"\n | \"utf-8\"\n | \"utf16le\"\n | \"utf-16le\"\n | \"ucs2\"\n | \"ucs-2\"\n | \"base64\"\n | \"base64url\"\n | \"latin1\"\n | \"binary\"\n | \"hex\";\n"],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_constants = require('./constants.cjs');
|
|
3
|
+
let vitest = require("vitest");
|
|
4
|
+
|
|
5
|
+
//#region src/constants.test.ts
|
|
6
|
+
(0, vitest.describe)("constants.ts exports", () => {
|
|
7
|
+
(0, vitest.it)("loads module exports", () => {
|
|
8
|
+
(0, vitest.expect)(require_constants.constants_exports).toBeDefined();
|
|
9
|
+
(0, vitest.expect)(typeof require_constants.constants_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { constants_exports } from "./constants.mjs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
//#region src/constants.test.ts
|
|
5
|
+
describe("constants.ts exports", () => {
|
|
6
|
+
it("loads module exports", () => {
|
|
7
|
+
expect(constants_exports).toBeDefined();
|
|
8
|
+
expect(typeof constants_exports).toBe("object");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { };
|
|
14
|
+
//# sourceMappingURL=constants.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.test.mjs","names":["moduleExports"],"sources":["../src/constants.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./constants.ts\";\n\ndescribe(\"constants.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,8BAA8B;AACrC,IAAG,8BAA8B;AAC/B,SAAOA,kBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,kBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
|