@kizenapps/cli 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-4OYGMEFM.js +3675 -0
- package/dist/chunk-4OYGMEFM.js.map +1 -0
- package/dist/chunk-4Z6S6LWP.js +6134 -0
- package/dist/chunk-4Z6S6LWP.js.map +1 -0
- package/dist/chunk-5WPGAZLP.js +6136 -0
- package/dist/chunk-5WPGAZLP.js.map +1 -0
- package/dist/chunk-6XGFZ4W5.js +3673 -0
- package/dist/chunk-6XGFZ4W5.js.map +1 -0
- package/dist/chunk-KMKDY2I6.js +46 -0
- package/dist/chunk-KMKDY2I6.js.map +1 -0
- package/dist/chunk-LSHHXCC6.js +3639 -0
- package/dist/chunk-LSHHXCC6.js.map +1 -0
- package/dist/chunk-NNDSADQG.js +3641 -0
- package/dist/chunk-NNDSADQG.js.map +1 -0
- package/dist/chunk-SEGVTWSK.js +44 -0
- package/dist/chunk-SEGVTWSK.js.map +1 -0
- package/dist/devtools-HNR7DD7Q.js +68 -0
- package/dist/devtools-HNR7DD7Q.js.map +1 -0
- package/dist/devtools-HW3UQAHH.js +69 -0
- package/dist/devtools-HW3UQAHH.js.map +1 -0
- package/dist/devtools-KXIXZGBY.js +64 -0
- package/dist/devtools-KXIXZGBY.js.map +1 -0
- package/dist/devtools-PDXM3L35.js +67 -0
- package/dist/devtools-PDXM3L35.js.map +1 -0
- package/dist/devtools-SDEASRYI.js +66 -0
- package/dist/devtools-SDEASRYI.js.map +1 -0
- package/dist/devtools-XBEEGBQ4.js +66 -0
- package/dist/devtools-XBEEGBQ4.js.map +1 -0
- package/dist/dist-4P5P64FK.js +8474 -0
- package/dist/dist-4P5P64FK.js.map +1 -0
- package/dist/dist-AVHDSU4X.js +137 -0
- package/dist/dist-AVHDSU4X.js.map +1 -0
- package/dist/dist-NUJOSN7W.js +8472 -0
- package/dist/dist-NUJOSN7W.js.map +1 -0
- package/dist/dist-QHDMIBVE.js +135 -0
- package/dist/dist-QHDMIBVE.js.map +1 -0
- package/dist/electron/icon.png +0 -0
- package/dist/electron/main.js +65 -3
- package/dist/electron/main.js.map +1 -1
- package/dist/electron/preload.cjs +5 -0
- package/dist/gzip-size-K37OQCQ2.js +137 -0
- package/dist/gzip-size-K37OQCQ2.js.map +1 -0
- package/dist/gzip-size-SHZBT5GU.js +139 -0
- package/dist/gzip-size-SHZBT5GU.js.map +1 -0
- package/dist/index.js +588 -171
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/calendarSource.worker-C9iglnKD.js +24 -0
- package/dist/viewer/assets/expression.worker-Cin-WNVB.js +5 -0
- package/dist/viewer/assets/floatingFrame.worker-CWLtchq3.js +23 -0
- package/dist/viewer/assets/generic.worker-DRXu0-5B.js +23 -0
- package/dist/viewer/assets/index-B0d3If0o.js +582 -0
- package/dist/viewer/assets/index-B1mMv9H8.css +2 -0
- package/dist/viewer/assets/index-BTLnOfRu.css +2 -0
- package/dist/viewer/assets/index-B_uo-pdA.js +582 -0
- package/dist/viewer/assets/index-Bp6umXGR.js +582 -0
- package/dist/viewer/assets/index-Bsja5bOD.js +582 -0
- package/dist/viewer/assets/index-CAej9s9R.js +582 -0
- package/dist/viewer/assets/index-CCMFzDS-.css +2 -0
- package/dist/viewer/assets/index-Ci4aelpQ.js +582 -0
- package/dist/viewer/assets/index-CuVHD6vO.css +2 -0
- package/dist/viewer/assets/index-DQZ1fN2j.js +582 -0
- package/dist/viewer/assets/index-DSeA5UDI.js +582 -0
- package/dist/viewer/assets/index-w7OW3o4t.js +582 -0
- package/dist/viewer/assets/recordDetail.worker-BIHPFt8Y.js +23 -0
- package/dist/viewer/icon.png +0 -0
- package/dist/viewer/index.html +2 -2
- package/package.json +17 -13
- package/dist/viewer/assets/calendarSource.worker-DF0wAwJR.js +0 -24
- package/dist/viewer/assets/expression.worker-_W4VR2xe.js +0 -5
- package/dist/viewer/assets/floatingFrame.worker-DXcDBfqJ.js +0 -23
- package/dist/viewer/assets/generic.worker-CsqlYndL.js +0 -23
- package/dist/viewer/assets/index-CW_UqFf3.css +0 -1
- package/dist/viewer/assets/index-DaB01Qok.js +0 -637
- package/dist/viewer/assets/recordDetail.worker-Ccm59Np6.js +0 -23
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
compressSingleFile,
|
|
6
|
+
getContentFromFilesAsync,
|
|
7
|
+
isImageFile,
|
|
8
|
+
readFileAsync,
|
|
9
|
+
run,
|
|
10
|
+
setFileNameMin,
|
|
11
|
+
setPublicFolder,
|
|
12
|
+
wildcards
|
|
13
|
+
} from "./chunk-5WPGAZLP.js";
|
|
14
|
+
import "./chunk-KMKDY2I6.js";
|
|
15
|
+
|
|
16
|
+
// node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/dist/index.js
|
|
17
|
+
import { mkdir } from "fs/promises";
|
|
18
|
+
import path from "path";
|
|
19
|
+
async function compress(settings) {
|
|
20
|
+
if (Array.isArray(settings.output)) {
|
|
21
|
+
if (!Array.isArray(settings.input)) throw new Error("When output is an array, input must also be an array");
|
|
22
|
+
if (settings.input.length !== settings.output.length) throw new Error(`Input and output arrays must have the same length (input: ${settings.input.length}, output: ${settings.output.length})`);
|
|
23
|
+
}
|
|
24
|
+
if (settings.output) await createDirectory(settings.output);
|
|
25
|
+
if (Array.isArray(settings.output)) return compressArrayOfFiles(settings);
|
|
26
|
+
return compressSingleFile(settings);
|
|
27
|
+
}
|
|
28
|
+
async function compressArrayOfFiles(settings) {
|
|
29
|
+
const inputs = settings.input;
|
|
30
|
+
inputs.forEach((input, index) => {
|
|
31
|
+
if (!input || typeof input !== "string") throw new Error(`Invalid input at index ${index}: expected non-empty string, got ${typeof input === "string" ? "empty string" : typeof input}`);
|
|
32
|
+
});
|
|
33
|
+
const compressionTasks = inputs.map(async (input, index) => {
|
|
34
|
+
return run({
|
|
35
|
+
settings,
|
|
36
|
+
content: isImageFile(input) ? await readFileAsync(input, true) : await getContentFromFilesAsync(input),
|
|
37
|
+
index
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
const results = await Promise.all(compressionTasks);
|
|
41
|
+
return results[results.length - 1] ?? "";
|
|
42
|
+
}
|
|
43
|
+
async function createDirectory(filePath) {
|
|
44
|
+
if (!filePath) return;
|
|
45
|
+
const paths = Array.isArray(filePath) ? filePath : [filePath];
|
|
46
|
+
const uniqueDirs = /* @__PURE__ */ new Set();
|
|
47
|
+
for (const outputPath of paths) {
|
|
48
|
+
if (typeof outputPath !== "string") continue;
|
|
49
|
+
const dirPath = getDirectoryPath(outputPath);
|
|
50
|
+
if (!dirPath) continue;
|
|
51
|
+
uniqueDirs.add(dirPath);
|
|
52
|
+
}
|
|
53
|
+
await Promise.all(Array.from(uniqueDirs).map((dir) => mkdir(dir, { recursive: true })));
|
|
54
|
+
}
|
|
55
|
+
function getDirectoryPath(outputPath) {
|
|
56
|
+
const dirPath = path.dirname(outputPath);
|
|
57
|
+
if (dirPath && dirPath !== ".") return dirPath;
|
|
58
|
+
const windowsDirPath = path.win32.dirname(outputPath);
|
|
59
|
+
if (windowsDirPath && windowsDirPath !== ".") return windowsDirPath;
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
var defaultSettings = {
|
|
63
|
+
options: {},
|
|
64
|
+
buffer: 1e3 * 1024
|
|
65
|
+
};
|
|
66
|
+
function setup(inputSettings) {
|
|
67
|
+
const settings = {
|
|
68
|
+
...structuredClone(defaultSettings),
|
|
69
|
+
...inputSettings
|
|
70
|
+
};
|
|
71
|
+
if (settings.content !== void 0) {
|
|
72
|
+
validateMandatoryFields(inputSettings, ["compressor"]);
|
|
73
|
+
return settings;
|
|
74
|
+
}
|
|
75
|
+
validateMandatoryFields(inputSettings, [
|
|
76
|
+
"compressor",
|
|
77
|
+
"input",
|
|
78
|
+
"output"
|
|
79
|
+
]);
|
|
80
|
+
if (Array.isArray(settings.input)) settings.input.forEach((input, index) => {
|
|
81
|
+
if (!input || typeof input !== "string") throw new Error(`Invalid input at index ${index}: expected non-empty string, got ${typeof input === "string" ? "empty string" : typeof input}`);
|
|
82
|
+
});
|
|
83
|
+
return enhanceSettings(settings);
|
|
84
|
+
}
|
|
85
|
+
function enhanceSettings(settings) {
|
|
86
|
+
let enhancedSettings = settings;
|
|
87
|
+
if (enhancedSettings.input) enhancedSettings = {
|
|
88
|
+
...enhancedSettings,
|
|
89
|
+
...wildcards(enhancedSettings.input, enhancedSettings.publicFolder)
|
|
90
|
+
};
|
|
91
|
+
const optionsWithFormats = enhancedSettings.options;
|
|
92
|
+
const shouldPreserveBareDollarOneOutput = enhancedSettings.output === "$1" && !enhancedSettings.publicFolder && !enhancedSettings.replaceInPlace && Array.isArray(optionsWithFormats?.formats) && optionsWithFormats.formats.length > 0;
|
|
93
|
+
if (Array.isArray(enhancedSettings.input) && shouldPreserveBareDollarOneOutput) enhancedSettings = {
|
|
94
|
+
...enhancedSettings,
|
|
95
|
+
output: enhancedSettings.input.map((file) => setFileNameMin(file, "$1", void 0, true))
|
|
96
|
+
};
|
|
97
|
+
else if (enhancedSettings.input && enhancedSettings.output && !Array.isArray(enhancedSettings.output) && !shouldPreserveBareDollarOneOutput) enhancedSettings = {
|
|
98
|
+
...enhancedSettings,
|
|
99
|
+
...checkOutput(enhancedSettings.input, enhancedSettings.output, enhancedSettings.publicFolder, enhancedSettings.replaceInPlace)
|
|
100
|
+
};
|
|
101
|
+
if (enhancedSettings.input && enhancedSettings.publicFolder) enhancedSettings = {
|
|
102
|
+
...enhancedSettings,
|
|
103
|
+
...setPublicFolder(enhancedSettings.input, enhancedSettings.publicFolder)
|
|
104
|
+
};
|
|
105
|
+
return enhancedSettings;
|
|
106
|
+
}
|
|
107
|
+
function checkOutput(input, output, publicFolder, replaceInPlace) {
|
|
108
|
+
if (Array.isArray(output)) return;
|
|
109
|
+
if (!/\$1/.test(output)) return;
|
|
110
|
+
const effectivePublicFolder = replaceInPlace ? void 0 : publicFolder;
|
|
111
|
+
if (Array.isArray(input)) return { output: input.map((file) => setFileNameMin(file, output, effectivePublicFolder, replaceInPlace)) };
|
|
112
|
+
return { output: setFileNameMin(input, output, effectivePublicFolder, replaceInPlace) };
|
|
113
|
+
}
|
|
114
|
+
function validateMandatoryFields(settings, fields) {
|
|
115
|
+
for (const field of fields) mandatory(field, settings);
|
|
116
|
+
if (typeof settings.compressor !== "function") throw new Error("compressor should be a function, maybe you forgot to install the compressor");
|
|
117
|
+
}
|
|
118
|
+
function mandatory(setting, settings) {
|
|
119
|
+
if (!settings[setting]) throw new Error(`${setting} is mandatory.`);
|
|
120
|
+
}
|
|
121
|
+
async function minify(settings) {
|
|
122
|
+
const compressorSettings = setup(settings);
|
|
123
|
+
return await (compressorSettings.content !== void 0 ? compressSingleFile : compress)(compressorSettings);
|
|
124
|
+
}
|
|
125
|
+
export {
|
|
126
|
+
minify
|
|
127
|
+
};
|
|
128
|
+
/*! Bundled license information:
|
|
129
|
+
|
|
130
|
+
@node-minify/core/dist/index.js:
|
|
131
|
+
(*!
|
|
132
|
+
* node-minify
|
|
133
|
+
* Copyright (c) 2011-2026 Rodolphe Stoclin
|
|
134
|
+
* MIT Licensed
|
|
135
|
+
*)
|
|
136
|
+
*/
|
|
137
|
+
//# sourceMappingURL=dist-AVHDSU4X.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/src/compress.ts","../node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/src/setup.ts","../node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\nimport { mkdir } from \"node:fs/promises\";\nimport path from \"node:path\";\n/**\n * Module dependencies.\n */\nimport type {\n CompressorOptions,\n MinifierOptions,\n Settings,\n} from \"@node-minify/types\";\nimport {\n compressSingleFile,\n getContentFromFilesAsync,\n isImageFile,\n readFileAsync,\n run,\n} from \"@node-minify/utils\";\n\n/**\n * Run the compressor using the provided settings.\n *\n * Validates settings when `output` is an array (requires `input` to be an array with the same length) and ensures target output directories exist before processing. Dispatches either multi-file or single-file compression based on `settings.output`.\n *\n * @param settings - Compression settings including `input`, `output`, and compressor-specific options\n * @returns The resulting compressed output string for a single output, or the last result produced when processing multiple outputs (or an empty string if no results were produced)\n * @throws Error - If `output` is an array but `input` is not, or if `input` and `output` arrays have differing lengths\n */\nexport async function compress<T extends CompressorOptions = CompressorOptions>(\n settings: Settings<T>\n): Promise<string> {\n if (Array.isArray(settings.output)) {\n if (!Array.isArray(settings.input)) {\n throw new Error(\n \"When output is an array, input must also be an array\"\n );\n }\n if (settings.input.length !== settings.output.length) {\n throw new Error(\n `Input and output arrays must have the same length (input: ${settings.input.length}, output: ${settings.output.length})`\n );\n }\n }\n\n if (settings.output) {\n await createDirectory(settings.output);\n }\n\n // Handle array outputs (from user input or created internally by checkOutput when processing $1 pattern)\n if (Array.isArray(settings.output)) {\n return compressArrayOfFiles(settings);\n }\n\n return compressSingleFile(settings as Settings);\n}\n\n/**\n * Compress multiple input files specified in the settings.\n *\n * @param settings - Configuration object where `settings.input` and `settings.output` are arrays of equal length; each `settings.input[i]` is a file path to compress and corresponds to `settings.output[i]`.\n * @returns The result of the last compression task, or an empty string if no tasks ran.\n * @throws Error if any entry in `settings.input` is not a non-empty string.\n */\nasync function compressArrayOfFiles<\n T extends CompressorOptions = CompressorOptions,\n>(settings: Settings<T>): Promise<string> {\n const inputs = settings.input as string[];\n\n inputs.forEach((input, index) => {\n if (!input || typeof input !== \"string\") {\n throw new Error(\n `Invalid input at index ${index}: expected non-empty string, got ${\n typeof input === \"string\" ? \"empty string\" : typeof input\n }`\n );\n }\n });\n\n const compressionTasks = inputs.map(async (input, index) => {\n const content = isImageFile(input)\n ? await readFileAsync(input, true)\n : await getContentFromFilesAsync(input);\n return run({ settings, content, index } as MinifierOptions<T>);\n });\n\n const results = await Promise.all(compressionTasks);\n return results[results.length - 1] ?? \"\";\n}\n\n/**\n * Create folder of the target file.\n * @param filePath Full path of the file (can be string or array when $1 pattern is used)\n */\nasync function createDirectory(filePath: string | string[]) {\n // Early return if no file path provided\n if (!filePath) {\n return;\n }\n\n // Handle array (created internally by checkOutput when processing $1 pattern)\n const paths = Array.isArray(filePath) ? filePath : [filePath];\n const uniqueDirs = new Set<string>();\n\n for (const outputPath of paths) {\n if (typeof outputPath !== \"string\") {\n continue;\n }\n\n // Use platform dirname first, then fallback for Windows-style separators on POSIX.\n const dirPath = getDirectoryPath(outputPath);\n\n // Early return if no directory path\n if (!dirPath) {\n continue;\n }\n\n uniqueDirs.add(dirPath);\n }\n\n // Create directories in parallel\n await Promise.all(\n Array.from(uniqueDirs).map((dir) => mkdir(dir, { recursive: true }))\n );\n}\n\n/**\n * Resolve the directory path from an output file path.\n * @param outputPath Full path to the output file\n * @returns A directory path when resolvable, or an empty string\n */\nfunction getDirectoryPath(outputPath: string): string {\n const dirPath = path.dirname(outputPath);\n if (dirPath && dirPath !== \".\") {\n return dirPath;\n }\n\n const windowsDirPath = path.win32.dirname(outputPath);\n if (windowsDirPath && windowsDirPath !== \".\") {\n return windowsDirPath;\n }\n\n return \"\";\n}\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { CompressorOptions, Settings } from \"@node-minify/types\";\nimport { setFileNameMin, setPublicFolder, wildcards } from \"@node-minify/utils\";\n\n/**\n * Default settings.\n */\nconst defaultSettings: Partial<Settings> = {\n options: {},\n buffer: 1000 * 1024,\n};\n\n/**\n * Builds and validates the final Settings object by merging defaults with user input.\n *\n * @param inputSettings - User-provided settings that override defaults\n * @returns The validated and enhanced Settings object ready for use\n */\nfunction setup<T extends CompressorOptions = CompressorOptions>(\n inputSettings: Settings<T>\n): Settings<T> {\n const settings: Settings<T> = {\n ...structuredClone(defaultSettings),\n ...inputSettings,\n } as Settings<T>;\n\n // In memory\n if (settings.content !== undefined) {\n validateMandatoryFields(inputSettings, [\"compressor\"]);\n return settings;\n }\n\n validateMandatoryFields(inputSettings, [\"compressor\", \"input\", \"output\"]);\n\n if (Array.isArray(settings.input)) {\n settings.input.forEach((input, index) => {\n if (!input || typeof input !== \"string\") {\n throw new Error(\n `Invalid input at index ${index}: expected non-empty string, got ${\n typeof input === \"string\"\n ? \"empty string\"\n : typeof input\n }`\n );\n }\n });\n }\n\n return enhanceSettings(settings);\n}\n\n/**\n * Augments a Settings object with derived values and normalized path outputs.\n *\n * Enhancements performed when applicable:\n * - Expands input patterns into concrete input entries.\n * - Computes output paths when a single output string contains the `$1` placeholder, producing per-input outputs.\n * - Resolves and attaches public-folder-related values derived from input and publicFolder.\n *\n * @param settings - The initial settings to enhance\n * @returns The enhanced Settings object with derived inputs, outputs, and public-folder values applied\n */\nfunction enhanceSettings<T extends CompressorOptions = CompressorOptions>(\n settings: Settings<T>\n): Settings<T> {\n let enhancedSettings = settings;\n\n if (enhancedSettings.input) {\n enhancedSettings = {\n ...enhancedSettings,\n ...wildcards(enhancedSettings.input, enhancedSettings.publicFolder),\n };\n }\n const optionsWithFormats = enhancedSettings.options as\n | { formats?: unknown[] }\n | undefined;\n const shouldPreserveBareDollarOneOutput =\n enhancedSettings.output === \"$1\" &&\n !enhancedSettings.publicFolder &&\n !enhancedSettings.replaceInPlace &&\n Array.isArray(optionsWithFormats?.formats) &&\n optionsWithFormats.formats.length > 0;\n\n if (\n Array.isArray(enhancedSettings.input) &&\n shouldPreserveBareDollarOneOutput\n ) {\n enhancedSettings = {\n ...enhancedSettings,\n output: enhancedSettings.input.map((file) =>\n setFileNameMin(file, \"$1\", undefined, true)\n ),\n };\n } else if (\n enhancedSettings.input &&\n enhancedSettings.output &&\n !Array.isArray(enhancedSettings.output) &&\n !shouldPreserveBareDollarOneOutput\n ) {\n enhancedSettings = {\n ...enhancedSettings,\n ...checkOutput(\n enhancedSettings.input,\n enhancedSettings.output,\n enhancedSettings.publicFolder,\n enhancedSettings.replaceInPlace\n ),\n };\n }\n if (enhancedSettings.input && enhancedSettings.publicFolder) {\n enhancedSettings = {\n ...enhancedSettings,\n ...setPublicFolder(\n enhancedSettings.input,\n enhancedSettings.publicFolder\n ),\n };\n }\n\n return enhancedSettings;\n}\n\n/**\n * Check the output path, searching for $1\n * if exist, returns the path replacing $1 by file name\n * @param input Path file\n * @param output Path to the output file\n * @param publicFolder Path to the public folder\n * @param replaceInPlace True to replace file in same folder\n * @returns Enhanced settings with processed output, or undefined if no processing needed\n */\nfunction checkOutput(\n input: string | string[],\n output: string | string[],\n publicFolder?: string,\n replaceInPlace?: boolean\n): { output: string | string[] } | undefined {\n // Arrays don't use the $1 placeholder pattern - they're handled directly in compress()\n if (Array.isArray(output)) {\n return undefined;\n }\n\n const PLACEHOLDER_PATTERN = /\\$1/;\n\n if (!PLACEHOLDER_PATTERN.test(output)) {\n return undefined;\n }\n\n const effectivePublicFolder = replaceInPlace ? undefined : publicFolder;\n\n // If array of files\n if (Array.isArray(input)) {\n const outputMin = input.map((file) =>\n setFileNameMin(file, output, effectivePublicFolder, replaceInPlace)\n );\n return { output: outputMin };\n }\n\n // Single file\n return {\n output: setFileNameMin(\n input,\n output,\n effectivePublicFolder,\n replaceInPlace\n ),\n };\n}\n\n/**\n * Ensure required settings are present and that `compressor` is a valid function.\n *\n * @param settings - Settings object to validate\n * @param fields - Names of required fields to check on `settings`\n * @throws Error if a required field is missing\n * @throws Error if `settings.compressor` is not a function\n */\nfunction validateMandatoryFields<\n T extends CompressorOptions = CompressorOptions,\n>(settings: Settings<T>, fields: string[]) {\n for (const field of fields) {\n mandatory(field, settings);\n }\n\n if (typeof settings.compressor !== \"function\") {\n throw new Error(\n \"compressor should be a function, maybe you forgot to install the compressor\"\n );\n }\n}\n\n/**\n * Check if the setting exists.\n * @param setting - Setting key to check\n * @param settings - Settings object\n */\nfunction mandatory(setting: string, settings: Record<string, unknown>) {\n if (!settings[setting]) {\n throw new Error(`${setting} is mandatory.`);\n }\n}\n\nexport { setup };\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { CompressorOptions, Settings } from \"@node-minify/types\";\nimport { compressSingleFile } from \"@node-minify/utils\";\nimport { compress } from \"./compress.ts\";\nimport { setup } from \"./setup.ts\";\n\n/**\n * Minifies input according to the provided settings.\n *\n * @param settings - User-provided settings that specify the compressor, input/content, output and related options\n * @returns The minified content as a string\n */\nexport async function minify<T extends CompressorOptions = CompressorOptions>(\n settings: Settings<T>\n): Promise<string> {\n const compressorSettings = setup(settings);\n const method =\n compressorSettings.content !== undefined\n ? compressSingleFile\n : compress;\n return await method(compressorSettings);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,eAAsB,SAClB,UACe;AACf,MAAI,MAAM,QAAQ,SAAS,MAAA,GAAS;AAChC,QAAI,CAAC,MAAM,QAAQ,SAAS,KAAA,EACxB,OAAM,IAAI,MACN,sDAAA;AAGR,QAAI,SAAS,MAAM,WAAW,SAAS,OAAO,OAC1C,OAAM,IAAI,MACN,6DAA6D,SAAS,MAAM,MAAA,aAAmB,SAAS,OAAO,MAAA,GAAO;;AAKlI,MAAI,SAAS,OACT,OAAM,gBAAgB,SAAS,MAAA;AAInC,MAAI,MAAM,QAAQ,SAAS,MAAA,EACvB,QAAO,qBAAqB,QAAA;AAGhC,SAAO,mBAAmB,QAAA;;AAU9B,eAAe,qBAEb,UAAwC;AACtC,QAAM,SAAS,SAAS;AAExB,SAAO,QAAA,CAAS,OAAO,UAAU;AAC7B,QAAI,CAAC,SAAS,OAAO,UAAU,SAC3B,OAAM,IAAI,MACN,0BAA0B,KAAA,oCACtB,OAAO,UAAU,WAAW,iBAAiB,OAAO,KAAA,EAAA;;AAMpE,QAAM,mBA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