@kubb/core 3.18.3 → 4.0.2
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/{FileManager-BeN5TYKI.js → FileManager-BDisPxtH.js} +28 -45
- package/dist/FileManager-BDisPxtH.js.map +1 -0
- package/dist/{FileManager-CZyWLgbQ.cjs → FileManager-qDcTVN6G.cjs} +34 -48
- package/dist/FileManager-qDcTVN6G.cjs.map +1 -0
- package/dist/{PluginManager-H8G0i6KS.d.ts → PluginManager-BSUDeUfP.d.ts} +2 -2
- package/dist/{PluginManager-C62HGihR.d.cts → PluginManager-a3RiDAFC.d.cts} +2 -2
- package/dist/{acorn-Biw1D1Ce.cjs → acorn-Cg_eXN51.cjs} +15 -37
- package/dist/{acorn-Biw1D1Ce.cjs.map → acorn-Cg_eXN51.cjs.map} +1 -1
- package/dist/{acorn-3HQnxDj2.js → acorn-Z0oy0vSt.js} +15 -37
- package/dist/{acorn-3HQnxDj2.js.map → acorn-Z0oy0vSt.js.map} +1 -1
- package/dist/{angular-n5qYWkcx.js → angular-BUlb_iaU.js} +6 -7
- package/dist/{angular-n5qYWkcx.js.map → angular-BUlb_iaU.js.map} +1 -1
- package/dist/{angular-B3ddRl90.cjs → angular-nBly58h0.cjs} +6 -7
- package/dist/{angular-B3ddRl90.cjs.map → angular-nBly58h0.cjs.map} +1 -1
- package/dist/{babel-BrKqHp9Q.cjs → babel-5qXjvTGO.cjs} +34 -45
- package/dist/{babel-BrKqHp9Q.cjs.map → babel-5qXjvTGO.cjs.map} +1 -1
- package/dist/{babel-mOBF3g2e.js → babel-DfXTN9QX.js} +34 -45
- package/dist/{babel-mOBF3g2e.js.map → babel-DfXTN9QX.js.map} +1 -1
- package/dist/{chunk-DoeelZqw.cjs → chunk-CZg_9w7l.cjs} +3 -1
- package/dist/{chunk-DbvY3SJr.js → chunk-kPDogv7o.js} +3 -1
- package/dist/{estree-QGbwcVbp.js → estree-Bt3vRtV3.js} +6 -9
- package/dist/{estree-QGbwcVbp.js.map → estree-Bt3vRtV3.js.map} +1 -1
- package/dist/{estree-D6ftINJ3.cjs → estree-DyiFjXDy.cjs} +6 -9
- package/dist/{estree-D6ftINJ3.cjs.map → estree-DyiFjXDy.cjs.map} +1 -1
- package/dist/{flow-C1RsRESZ.js → flow-Bb8_yYns.js} +466 -573
- package/dist/{flow-C1RsRESZ.js.map → flow-Bb8_yYns.js.map} +1 -1
- package/dist/{flow-BWEc100n.cjs → flow-DdtBrX0O.cjs} +466 -573
- package/dist/{flow-BWEc100n.cjs.map → flow-DdtBrX0O.cjs.map} +1 -1
- package/dist/{fs-DkMVXz_s.js → fs-BNC5Fj6t.js} +3 -5
- package/dist/{fs-DkMVXz_s.js.map → fs-BNC5Fj6t.js.map} +1 -1
- package/dist/{fs-CeOer54w.cjs → fs-Bi2kuxAm.cjs} +10 -9
- package/dist/{fs-CeOer54w.cjs.map → fs-Bi2kuxAm.cjs.map} +1 -1
- package/dist/fs.cjs +2 -2
- package/dist/fs.d.cts +1 -1
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +2 -2
- package/dist/{glimmer-CwkHq8v_.cjs → glimmer-BuCRLjbI.cjs} +20 -38
- package/dist/{glimmer-CwkHq8v_.cjs.map → glimmer-BuCRLjbI.cjs.map} +1 -1
- package/dist/{glimmer-DZXQWVfc.js → glimmer-By8WZPkK.js} +20 -38
- package/dist/{glimmer-DZXQWVfc.js.map → glimmer-By8WZPkK.js.map} +1 -1
- package/dist/{graphql-DWNpg5AH.js → graphql-DsrNefXx.js} +3 -4
- package/dist/{graphql-DWNpg5AH.js.map → graphql-DsrNefXx.js.map} +1 -1
- package/dist/{graphql-ftPsRNd8.cjs → graphql-TN0hv-fx.cjs} +3 -4
- package/dist/{graphql-ftPsRNd8.cjs.map → graphql-TN0hv-fx.cjs.map} +1 -1
- package/dist/{html-DMFSHL-z.cjs → html-1W4-2_9J.cjs} +7 -9
- package/dist/{html-DMFSHL-z.cjs.map → html-1W4-2_9J.cjs.map} +1 -1
- package/dist/{html-Lx7YOmUI.js → html-Y5KDc150.js} +7 -9
- package/dist/{html-Lx7YOmUI.js.map → html-Y5KDc150.js.map} +1 -1
- package/dist/{index-DERUIhQK.d.cts → index-B7KKQHG8.d.cts} +3 -3
- package/dist/{index-B428LQ0Z.d.ts → index-BhFFCWR1.d.ts} +3 -3
- package/dist/{index-3smcdUnJ.d.ts → index-CGJ3tdk-.d.ts} +1 -4
- package/dist/{index-Bglrijef.d.cts → index-CWX6_-da.d.cts} +1 -4
- package/dist/index.cjs +42 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +23 -34
- package/dist/index.js.map +1 -1
- package/dist/{logger-M0gDQMDh.js → logger-BKPT4rkB.js} +11 -19
- package/dist/logger-BKPT4rkB.js.map +1 -0
- package/dist/{logger-OgWv9Jyy.cjs → logger-DBJsdlpZ.cjs} +26 -27
- package/dist/logger-DBJsdlpZ.cjs.map +1 -0
- package/dist/logger.cjs +2 -2
- package/dist/logger.js +2 -2
- package/dist/{markdown-BYsFO1cu.cjs → markdown-Bltb-uzO.cjs} +3 -5
- package/dist/{markdown-BYsFO1cu.cjs.map → markdown-Bltb-uzO.cjs.map} +1 -1
- package/dist/{markdown-Dt7fmgWb.js → markdown-Drl4Cbq5.js} +3 -5
- package/dist/{markdown-Dt7fmgWb.js.map → markdown-Drl4Cbq5.js.map} +1 -1
- package/dist/{meriyah-BA-YCwVg.cjs → meriyah-CdG8HPS2.cjs} +3 -5
- package/dist/meriyah-CdG8HPS2.cjs.map +1 -0
- package/dist/{meriyah-CEYm-XS7.js → meriyah-Cz9whwp-.js} +3 -5
- package/dist/meriyah-Cz9whwp-.js.map +1 -0
- package/dist/mocks.cjs +206 -333
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +2 -2
- package/dist/mocks.d.ts +2 -2
- package/dist/mocks.js +186 -323
- package/dist/mocks.js.map +1 -1
- package/dist/{postcss-BQcSCAcI.cjs → postcss-B7n9zUIy.cjs} +32 -53
- package/dist/postcss-B7n9zUIy.cjs.map +1 -0
- package/dist/{postcss-CI4qZzdL.js → postcss-Dfx_9buT.js} +32 -53
- package/dist/postcss-Dfx_9buT.js.map +1 -0
- package/dist/{prompt-D3dP3KNu.js → prompt-BMs_Y-vT.js} +5 -8
- package/dist/{prompt-D3dP3KNu.js.map → prompt-BMs_Y-vT.js.map} +1 -1
- package/dist/{prompt-DslNpUPc.cjs → prompt-BXlYKArM.cjs} +14 -13
- package/dist/{prompt-DslNpUPc.cjs.map → prompt-BXlYKArM.cjs.map} +1 -1
- package/dist/{transformers-BL8vcCaM.js → transformers-CXIKOVl0.js} +13 -22
- package/dist/{transformers-BL8vcCaM.js.map → transformers-CXIKOVl0.js.map} +1 -1
- package/dist/{transformers-BUNfHgNe.cjs → transformers-TDFgAyi8.cjs} +15 -23
- package/dist/{transformers-BUNfHgNe.cjs.map → transformers-TDFgAyi8.cjs.map} +1 -1
- package/dist/transformers.cjs +4 -3
- package/dist/transformers.js +1 -1
- package/dist/typescript-BY9-7pw9.js +3 -0
- package/dist/{typescript-eE7YJ2-c.js → typescript-C8iCxnaF.js} +15 -70
- package/dist/{typescript-eE7YJ2-c.js.map → typescript-C8iCxnaF.js.map} +1 -1
- package/dist/{typescript-DDBRxbn7.cjs → typescript-Evf8GXVW.cjs} +15 -70
- package/dist/{typescript-DDBRxbn7.cjs.map → typescript-Evf8GXVW.cjs.map} +1 -1
- package/dist/typescript-PxlX-TH7.cjs +4 -0
- package/dist/utils.cjs +4 -4
- package/dist/utils.d.cts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +4 -4
- package/dist/{write-cvT4uBev.cjs → write-BJfM7G1_.cjs} +11 -10
- package/dist/{write-cvT4uBev.cjs.map → write-BJfM7G1_.cjs.map} +1 -1
- package/dist/{write-CLTPlucv.js → write-O9QWtBJ_.js} +4 -6
- package/dist/{write-CLTPlucv.js.map → write-O9QWtBJ_.js.map} +1 -1
- package/dist/{yaml-v1i11ZlS.cjs → yaml-B2qeXFgu.cjs} +37 -116
- package/dist/yaml-B2qeXFgu.cjs.map +1 -0
- package/dist/{yaml-DZASOrDL.js → yaml-Bi_nSoU_.js} +37 -116
- package/dist/yaml-Bi_nSoU_.js.map +1 -0
- package/package.json +6 -7
- package/dist/FileManager-BeN5TYKI.js.map +0 -1
- package/dist/FileManager-CZyWLgbQ.cjs.map +0 -1
- package/dist/logger-M0gDQMDh.js.map +0 -1
- package/dist/logger-OgWv9Jyy.cjs.map +0 -1
- package/dist/meriyah-BA-YCwVg.cjs.map +0 -1
- package/dist/meriyah-CEYm-XS7.js.map +0 -1
- package/dist/postcss-BQcSCAcI.cjs.map +0 -1
- package/dist/postcss-CI4qZzdL.js.map +0 -1
- package/dist/typescript-Bq-hjiJ0.js +0 -3
- package/dist/typescript-DvVkagAX.cjs +0 -4
- package/dist/yaml-DZASOrDL.js.map +0 -1
- package/dist/yaml-v1i11ZlS.cjs.map +0 -1
package/dist/utils.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
require('./fs-
|
|
2
|
-
require('./write-
|
|
3
|
-
require('./transformers-
|
|
4
|
-
const require_FileManager = require('./FileManager-
|
|
1
|
+
require('./fs-Bi2kuxAm.cjs');
|
|
2
|
+
require('./write-BJfM7G1_.cjs');
|
|
3
|
+
require('./transformers-TDFgAyi8.cjs');
|
|
4
|
+
const require_FileManager = require('./FileManager-qDcTVN6G.cjs');
|
|
5
5
|
|
|
6
6
|
exports.Cache = require_FileManager.Cache;
|
|
7
7
|
exports.FunctionParams = require_FileManager.FunctionParams;
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-CWX6_-da.cjs";
|
|
2
2
|
import "./logger-OWS6fqk0.cjs";
|
|
3
|
-
import "./PluginManager-
|
|
4
|
-
import { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./index-
|
|
3
|
+
import "./PluginManager-a3RiDAFC.cjs";
|
|
4
|
+
import { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./index-B7KKQHG8.cjs";
|
|
5
5
|
export { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-CGJ3tdk-.js";
|
|
2
2
|
import "./logger-B-4AXUmB.js";
|
|
3
|
-
import "./PluginManager-
|
|
4
|
-
import { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./index-
|
|
3
|
+
import "./PluginManager-BSUDeUfP.js";
|
|
4
|
+
import { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./index-BhFFCWR1.js";
|
|
5
5
|
export { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./fs-
|
|
2
|
-
import "./write-
|
|
3
|
-
import "./transformers-
|
|
4
|
-
import { Cache, FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./FileManager-
|
|
1
|
+
import "./fs-BNC5Fj6t.js";
|
|
2
|
+
import "./write-O9QWtBJ_.js";
|
|
3
|
+
import "./transformers-CXIKOVl0.js";
|
|
4
|
+
import { Cache, FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./FileManager-BDisPxtH.js";
|
|
5
5
|
|
|
6
6
|
export { Cache, FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const require_chunk = require('./chunk-CZg_9w7l.cjs');
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
node_path = require_chunk.__toESM(node_path);
|
|
4
|
+
let fs_extra = require("fs-extra");
|
|
5
|
+
fs_extra = require_chunk.__toESM(fs_extra);
|
|
6
|
+
let js_runtime = require("js-runtime");
|
|
7
|
+
js_runtime = require_chunk.__toESM(js_runtime);
|
|
5
8
|
|
|
6
9
|
//#region src/fs/write.ts
|
|
7
10
|
const writer = (0, js_runtime.switcher)({
|
|
8
11
|
node: async (path, data, { sanity }) => {
|
|
9
12
|
try {
|
|
10
|
-
|
|
11
|
-
if (oldContent?.toString() === data?.toString()) return;
|
|
13
|
+
if ((await fs_extra.default.readFile((0, node_path.resolve)(path), { encoding: "utf-8" }))?.toString() === data?.toString()) return;
|
|
12
14
|
} catch (_err) {}
|
|
13
15
|
await fs_extra.default.outputFile((0, node_path.resolve)(path), data, { encoding: "utf-8" });
|
|
14
16
|
if (sanity) {
|
|
@@ -22,8 +24,7 @@ const writer = (0, js_runtime.switcher)({
|
|
|
22
24
|
try {
|
|
23
25
|
await Bun.write((0, node_path.resolve)(path), data);
|
|
24
26
|
if (sanity) {
|
|
25
|
-
const
|
|
26
|
-
const savedData = await file.text();
|
|
27
|
+
const savedData = await Bun.file((0, node_path.resolve)(path)).text();
|
|
27
28
|
if (savedData?.toString() !== data?.toString()) throw new Error(`Sanity check failed for ${path}\n\nData[${path.length}]:\n${path}\n\nSaved[${savedData.length}]:\n${savedData}\n`);
|
|
28
29
|
return savedData;
|
|
29
30
|
}
|
|
@@ -34,7 +35,7 @@ const writer = (0, js_runtime.switcher)({
|
|
|
34
35
|
}
|
|
35
36
|
}, "node");
|
|
36
37
|
async function write(path, data, options = {}) {
|
|
37
|
-
if (data.trim() === "") return
|
|
38
|
+
if (data.trim() === "") return;
|
|
38
39
|
return writer(path, data.trim(), options);
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -45,4 +46,4 @@ Object.defineProperty(exports, 'write', {
|
|
|
45
46
|
return write;
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
|
-
//# sourceMappingURL=write-
|
|
49
|
+
//# sourceMappingURL=write-BJfM7G1_.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-
|
|
1
|
+
{"version":3,"file":"write-BJfM7G1_.cjs","names":["fs"],"sources":["../src/fs/write.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\ntype Options = { sanity?: boolean }\n\nconst writer = switcher(\n {\n node: async (path: string, data: string, { sanity }: Options) => {\n try {\n const oldContent = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n if (oldContent?.toString() === data?.toString()) {\n return\n }\n } catch (_err) {\n /* empty */\n }\n\n await fs.outputFile(resolve(path), data, { encoding: 'utf-8' })\n\n if (sanity) {\n const savedData = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${data.length}]:\\n${data}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n },\n bun: async (path: string, data: string, { sanity }: Options) => {\n try {\n await Bun.write(resolve(path), data)\n\n if (sanity) {\n const file = Bun.file(resolve(path))\n const savedData = await file.text()\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${path.length}]:\\n${path}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n } catch (e) {\n console.error(e)\n }\n },\n },\n 'node',\n)\n\nexport async function write(path: string, data: string, options: Options = {}): Promise<string | undefined> {\n if (data.trim() === '') {\n return undefined\n }\n return writer(path, data.trim(), options)\n}\n"],"mappings":";;;;;;;;;AAOA,MAAM,kCACJ;CACE,MAAM,OAAO,MAAc,MAAc,EAAE,aAAsB;AAC/D,MAAI;AAIF,QAHmB,MAAMA,iBAAG,gCAAiB,KAAK,EAAE,EAClD,UAAU,SACX,CAAC,GACc,UAAU,KAAK,MAAM,UAAU,CAC7C;WAEK,MAAM;AAIf,QAAMA,iBAAG,kCAAmB,KAAK,EAAE,MAAM,EAAE,UAAU,SAAS,CAAC;AAE/D,MAAI,QAAQ;GACV,MAAM,YAAY,MAAMA,iBAAG,gCAAiB,KAAK,EAAE,EACjD,UAAU,SACX,CAAC;AAEF,OAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,2BAA2B,KAAK,WAAW,KAAK,OAAO,MAAM,KAAK,YAAY,UAAU,OAAO,MAAM,UAAU,IAAI;AAGrI,UAAO;;AAGT,SAAO;;CAET,KAAK,OAAO,MAAc,MAAc,EAAE,aAAsB;AAC9D,MAAI;AACF,SAAM,IAAI,6BAAc,KAAK,EAAE,KAAK;AAEpC,OAAI,QAAQ;IAEV,MAAM,YAAY,MADL,IAAI,4BAAa,KAAK,CAAC,CACP,MAAM;AAEnC,QAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,2BAA2B,KAAK,WAAW,KAAK,OAAO,MAAM,KAAK,YAAY,UAAU,OAAO,MAAM,UAAU,IAAI;AAGrI,WAAO;;AAGT,UAAO;WACA,GAAG;AACV,WAAQ,MAAM,EAAE;;;CAGrB,EACD,OACD;AAED,eAAsB,MAAM,MAAc,MAAc,UAAmB,EAAE,EAA+B;AAC1G,KAAI,KAAK,MAAM,KAAK,GAClB;AAEF,QAAO,OAAO,MAAM,KAAK,MAAM,EAAE,QAAQ"}
|
|
@@ -6,8 +6,7 @@ import { switcher } from "js-runtime";
|
|
|
6
6
|
const writer = switcher({
|
|
7
7
|
node: async (path$1, data, { sanity }) => {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
if (oldContent?.toString() === data?.toString()) return;
|
|
9
|
+
if ((await fs.readFile(resolve(path$1), { encoding: "utf-8" }))?.toString() === data?.toString()) return;
|
|
11
10
|
} catch (_err) {}
|
|
12
11
|
await fs.outputFile(resolve(path$1), data, { encoding: "utf-8" });
|
|
13
12
|
if (sanity) {
|
|
@@ -21,8 +20,7 @@ const writer = switcher({
|
|
|
21
20
|
try {
|
|
22
21
|
await Bun.write(resolve(path$1), data);
|
|
23
22
|
if (sanity) {
|
|
24
|
-
const
|
|
25
|
-
const savedData = await file.text();
|
|
23
|
+
const savedData = await Bun.file(resolve(path$1)).text();
|
|
26
24
|
if (savedData?.toString() !== data?.toString()) throw new Error(`Sanity check failed for ${path$1}\n\nData[${path$1.length}]:\n${path$1}\n\nSaved[${savedData.length}]:\n${savedData}\n`);
|
|
27
25
|
return savedData;
|
|
28
26
|
}
|
|
@@ -33,10 +31,10 @@ const writer = switcher({
|
|
|
33
31
|
}
|
|
34
32
|
}, "node");
|
|
35
33
|
async function write(path$1, data, options = {}) {
|
|
36
|
-
if (data.trim() === "") return
|
|
34
|
+
if (data.trim() === "") return;
|
|
37
35
|
return writer(path$1, data.trim(), options);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
//#endregion
|
|
41
39
|
export { write };
|
|
42
|
-
//# sourceMappingURL=write-
|
|
40
|
+
//# sourceMappingURL=write-O9QWtBJ_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-
|
|
1
|
+
{"version":3,"file":"write-O9QWtBJ_.js","names":["path"],"sources":["../src/fs/write.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\ntype Options = { sanity?: boolean }\n\nconst writer = switcher(\n {\n node: async (path: string, data: string, { sanity }: Options) => {\n try {\n const oldContent = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n if (oldContent?.toString() === data?.toString()) {\n return\n }\n } catch (_err) {\n /* empty */\n }\n\n await fs.outputFile(resolve(path), data, { encoding: 'utf-8' })\n\n if (sanity) {\n const savedData = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${data.length}]:\\n${data}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n },\n bun: async (path: string, data: string, { sanity }: Options) => {\n try {\n await Bun.write(resolve(path), data)\n\n if (sanity) {\n const file = Bun.file(resolve(path))\n const savedData = await file.text()\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${path.length}]:\\n${path}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n } catch (e) {\n console.error(e)\n }\n },\n },\n 'node',\n)\n\nexport async function write(path: string, data: string, options: Options = {}): Promise<string | undefined> {\n if (data.trim() === '') {\n return undefined\n }\n return writer(path, data.trim(), options)\n}\n"],"mappings":";;;;;AAOA,MAAM,SAAS,SACb;CACE,MAAM,OAAO,QAAc,MAAc,EAAE,aAAsB;AAC/D,MAAI;AAIF,QAHmB,MAAM,GAAG,SAAS,QAAQA,OAAK,EAAE,EAClD,UAAU,SACX,CAAC,GACc,UAAU,KAAK,MAAM,UAAU,CAC7C;WAEK,MAAM;AAIf,QAAM,GAAG,WAAW,QAAQA,OAAK,EAAE,MAAM,EAAE,UAAU,SAAS,CAAC;AAE/D,MAAI,QAAQ;GACV,MAAM,YAAY,MAAM,GAAG,SAAS,QAAQA,OAAK,EAAE,EACjD,UAAU,SACX,CAAC;AAEF,OAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,2BAA2BA,OAAK,WAAW,KAAK,OAAO,MAAM,KAAK,YAAY,UAAU,OAAO,MAAM,UAAU,IAAI;AAGrI,UAAO;;AAGT,SAAO;;CAET,KAAK,OAAO,QAAc,MAAc,EAAE,aAAsB;AAC9D,MAAI;AACF,SAAM,IAAI,MAAM,QAAQA,OAAK,EAAE,KAAK;AAEpC,OAAI,QAAQ;IAEV,MAAM,YAAY,MADL,IAAI,KAAK,QAAQA,OAAK,CAAC,CACP,MAAM;AAEnC,QAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,2BAA2BA,OAAK,WAAWA,OAAK,OAAO,MAAMA,OAAK,YAAY,UAAU,OAAO,MAAM,UAAU,IAAI;AAGrI,WAAO;;AAGT,UAAO;WACA,GAAG;AACV,WAAQ,MAAM,EAAE;;;CAGrB,EACD,OACD;AAED,eAAsB,MAAM,QAAc,MAAc,UAAmB,EAAE,EAA+B;AAC1G,KAAI,KAAK,MAAM,KAAK,GAClB;AAEF,QAAO,OAAOA,QAAM,KAAK,MAAM,EAAE,QAAQ"}
|
|
@@ -464,13 +464,10 @@ ${s}
|
|
|
464
464
|
}
|
|
465
465
|
let o = r[e];
|
|
466
466
|
switch (o) {
|
|
467
|
-
case " ": {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
str: i
|
|
472
|
-
};
|
|
473
|
-
}
|
|
467
|
+
case " ": return {
|
|
468
|
+
errors: [new mt(this, "Plain value cannot start with a tab character")],
|
|
469
|
+
str: i
|
|
470
|
+
};
|
|
474
471
|
case "@":
|
|
475
472
|
case "`": {
|
|
476
473
|
let a = `Plain value cannot start with reserved character ${o}`;
|
|
@@ -672,10 +669,7 @@ var ns = te((ts) => {
|
|
|
672
669
|
if (c < i + a) {
|
|
673
670
|
i > n && (c = i);
|
|
674
671
|
break;
|
|
675
|
-
} else if (!this.error)
|
|
676
|
-
let h = "All collection items must start at the same column";
|
|
677
|
-
this.error = new u.YAMLSyntaxError(this, h);
|
|
678
|
-
}
|
|
672
|
+
} else if (!this.error) this.error = new u.YAMLSyntaxError(this, "All collection items must start at the same column");
|
|
679
673
|
}
|
|
680
674
|
if (o.type === u.Type.SEQ_ITEM) {
|
|
681
675
|
if (l !== "-") {
|
|
@@ -685,10 +679,7 @@ var ns = te((ts) => {
|
|
|
685
679
|
} else if (l === "-" && !this.error) {
|
|
686
680
|
let h = s[c + 1];
|
|
687
681
|
if (!h || h === `
|
|
688
|
-
` || h === " " || h === " ")
|
|
689
|
-
let g = "A collection cannot be both a mapping and a sequence";
|
|
690
|
-
this.error = new u.YAMLSyntaxError(this, g);
|
|
691
|
-
}
|
|
682
|
+
` || h === " " || h === " ") this.error = new u.YAMLSyntaxError(this, "A collection cannot be both a mapping and a sequence");
|
|
692
683
|
}
|
|
693
684
|
let d = r({
|
|
694
685
|
atLineStart: f,
|
|
@@ -967,10 +958,7 @@ var ns = te((ts) => {
|
|
|
967
958
|
}
|
|
968
959
|
} else if (r[l] !== `
|
|
969
960
|
`) {
|
|
970
|
-
if (m < a)
|
|
971
|
-
let d = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
|
|
972
|
-
this.error = new u.YAMLSemanticError(this, d);
|
|
973
|
-
}
|
|
961
|
+
if (m < a) this.error = new u.YAMLSemanticError(this, "Block scalars with more-indented leading empty lines must use an explicit indentation indicator");
|
|
974
962
|
this.blockIndent = m;
|
|
975
963
|
} else m > a && (a = m);
|
|
976
964
|
r[l] === `
|
|
@@ -1014,10 +1002,7 @@ var ns = te((ts) => {
|
|
|
1014
1002
|
let f = new Se();
|
|
1015
1003
|
o = f.parse({ src: s }, o), this.items.push(f);
|
|
1016
1004
|
}
|
|
1017
|
-
if (c = u.Node.endOfIndent(s, o), c <= o + i && (a = s[c], c < o + i || a !== "]" && a !== "}"))
|
|
1018
|
-
let f = "Insufficient indentation in flow collection";
|
|
1019
|
-
this.error = new u.YAMLSemanticError(this, f);
|
|
1020
|
-
}
|
|
1005
|
+
if (c = u.Node.endOfIndent(s, o), c <= o + i && (a = s[c], c < o + i || a !== "]" && a !== "}")) this.error = new u.YAMLSemanticError(this, "Insufficient indentation in flow collection");
|
|
1021
1006
|
}
|
|
1022
1007
|
break;
|
|
1023
1008
|
case ",":
|
|
@@ -1559,10 +1544,7 @@ ${c}${A}` : `
|
|
|
1559
1544
|
}
|
|
1560
1545
|
set commentBefore(e) {
|
|
1561
1546
|
if (this.key ??= new _(null), this.key instanceof j) this.key.commentBefore = e;
|
|
1562
|
-
else
|
|
1563
|
-
let n = "Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";
|
|
1564
|
-
throw new Error(n);
|
|
1565
|
-
}
|
|
1547
|
+
else throw new Error("Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.");
|
|
1566
1548
|
}
|
|
1567
1549
|
addToJSMap(e, n) {
|
|
1568
1550
|
let r = ce(this.key, "", e);
|
|
@@ -1590,10 +1572,7 @@ ${c}${A}` : `
|
|
|
1590
1572
|
let { indent: s, indentSeq: i, simpleKeys: o } = e.doc.options, { key: a, value: c } = this, l = a instanceof j && a.comment;
|
|
1591
1573
|
if (o) {
|
|
1592
1574
|
if (l) throw new Error("With simple keys, key nodes cannot have comments");
|
|
1593
|
-
if (a instanceof W)
|
|
1594
|
-
let R = "With simple keys, collection cannot be used as a key value";
|
|
1595
|
-
throw new Error(R);
|
|
1596
|
-
}
|
|
1575
|
+
if (a instanceof W) throw new Error("With simple keys, collection cannot be used as a key value");
|
|
1597
1576
|
}
|
|
1598
1577
|
let f = !o && (!a || l || (a instanceof j ? a instanceof W || a.type === p.Type.BLOCK_FOLDED || a.type === p.Type.BLOCK_LITERAL : typeof a == "object")), { doc: m, indent: d, indentStep: y, stringify: h } = e;
|
|
1599
1578
|
e = Object.assign({}, e, {
|
|
@@ -2021,10 +2000,7 @@ ${l}`);
|
|
|
2021
2000
|
function us(t, e) {
|
|
2022
2001
|
let n = e.context.src[e.range.start - 1];
|
|
2023
2002
|
if (n !== `
|
|
2024
|
-
` && n !== " " && n !== " ")
|
|
2025
|
-
let r = "Comments must be separated from other tokens by white space characters";
|
|
2026
|
-
t.push(new p.YAMLSemanticError(e, r));
|
|
2027
|
-
}
|
|
2003
|
+
` && n !== " " && n !== " ") t.push(new p.YAMLSemanticError(e, "Comments must be separated from other tokens by white space characters"));
|
|
2028
2004
|
}
|
|
2029
2005
|
function ps(t, e) {
|
|
2030
2006
|
let n = String(e), r = n.substr(0, 8) + "..." + n.substr(-8);
|
|
@@ -2138,26 +2114,17 @@ ${l}`);
|
|
|
2138
2114
|
}, r = !1, s = !1, i = Uo(e.context.parent) ? e.context.parent.props.concat(e.props) : e.props;
|
|
2139
2115
|
for (let { start: o, end: a } of i) switch (e.context.src[o]) {
|
|
2140
2116
|
case p.Char.COMMENT: {
|
|
2141
|
-
if (!e.commentHasRequiredWhitespace(o))
|
|
2142
|
-
let m = "Comments must be separated from other tokens by white space characters";
|
|
2143
|
-
t.push(new p.YAMLSemanticError(e, m));
|
|
2144
|
-
}
|
|
2117
|
+
if (!e.commentHasRequiredWhitespace(o)) t.push(new p.YAMLSemanticError(e, "Comments must be separated from other tokens by white space characters"));
|
|
2145
2118
|
let { header: c, valueRange: l } = e;
|
|
2146
2119
|
(l && (o > l.start || c && o > c.start) ? n.after : n.before).push(e.context.src.slice(o + 1, a));
|
|
2147
2120
|
break;
|
|
2148
2121
|
}
|
|
2149
2122
|
case p.Char.ANCHOR:
|
|
2150
|
-
if (r)
|
|
2151
|
-
let c = "A node can have at most one anchor";
|
|
2152
|
-
t.push(new p.YAMLSemanticError(e, c));
|
|
2153
|
-
}
|
|
2123
|
+
if (r) t.push(new p.YAMLSemanticError(e, "A node can have at most one anchor"));
|
|
2154
2124
|
r = !0;
|
|
2155
2125
|
break;
|
|
2156
2126
|
case p.Char.TAG:
|
|
2157
|
-
if (s)
|
|
2158
|
-
let c = "A node can have at most one tag";
|
|
2159
|
-
t.push(new p.YAMLSemanticError(e, c));
|
|
2160
|
-
}
|
|
2127
|
+
if (s) t.push(new p.YAMLSemanticError(e, "A node can have at most one tag"));
|
|
2161
2128
|
s = !0;
|
|
2162
2129
|
break;
|
|
2163
2130
|
}
|
|
@@ -2199,10 +2166,7 @@ ${l}`);
|
|
|
2199
2166
|
let { anchors: o } = t, a = e.anchor, c = o.getNode(a);
|
|
2200
2167
|
c && (o.map[o.newName(a)] = c), o.map[a] = e;
|
|
2201
2168
|
}
|
|
2202
|
-
if (e.type === p.Type.ALIAS && (r || s))
|
|
2203
|
-
let o = "An alias node must not specify any properties";
|
|
2204
|
-
t.errors.push(new p.YAMLSemanticError(e, o));
|
|
2205
|
-
}
|
|
2169
|
+
if (e.type === p.Type.ALIAS && (r || s)) t.errors.push(new p.YAMLSemanticError(e, "An alias node must not specify any properties"));
|
|
2206
2170
|
let i = Vo(t, e);
|
|
2207
2171
|
if (i) {
|
|
2208
2172
|
i.range = [e.range.start, e.range.end], t.options.keepCstNodes && (i.cstNode = e), t.options.keepNodeTypes && (i.type = e.type);
|
|
@@ -2246,10 +2210,7 @@ ${a}` : a);
|
|
|
2246
2210
|
}
|
|
2247
2211
|
}
|
|
2248
2212
|
}
|
|
2249
|
-
if (i && !t.options.mapAsMap)
|
|
2250
|
-
let o = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
|
|
2251
|
-
t.warnings.push(new p.YAMLWarning(e, o));
|
|
2252
|
-
}
|
|
2213
|
+
if (i && !t.options.mapAsMap) t.warnings.push(new p.YAMLWarning(e, "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this."));
|
|
2253
2214
|
return e.resolved = s, s;
|
|
2254
2215
|
}
|
|
2255
2216
|
var Wo = ({ context: { lineStart: t, node: e, src: n }, props: r }) => {
|
|
@@ -2293,10 +2254,7 @@ ${a}` : a);
|
|
|
2293
2254
|
break;
|
|
2294
2255
|
case p.Type.MAP_VALUE:
|
|
2295
2256
|
{
|
|
2296
|
-
if (s === void 0 && (s = null), a.error && t.errors.push(a.error), !a.context.atLineStart && a.node && a.node.type === p.Type.MAP && !a.node.context.atLineStart)
|
|
2297
|
-
let f = "Nested mappings are not allowed in compact mappings";
|
|
2298
|
-
t.errors.push(new p.YAMLSemanticError(a.node, f));
|
|
2299
|
-
}
|
|
2257
|
+
if (s === void 0 && (s = null), a.error && t.errors.push(a.error), !a.context.atLineStart && a.node && a.node.type === p.Type.MAP && !a.node.context.atLineStart) t.errors.push(new p.YAMLSemanticError(a.node, "Nested mappings are not allowed in compact mappings"));
|
|
2300
2258
|
let c = a.node;
|
|
2301
2259
|
if (!c && a.props.length > 0) {
|
|
2302
2260
|
c = new p.PlainValue(p.Type.PLAIN, []), c.context = {
|
|
@@ -2327,17 +2285,12 @@ ${a}` : a);
|
|
|
2327
2285
|
case p.Type.BLANK_LINE:
|
|
2328
2286
|
case p.Type.COMMENT: continue e;
|
|
2329
2287
|
case p.Type.MAP_VALUE: break e;
|
|
2330
|
-
default:
|
|
2331
|
-
|
|
2332
|
-
t.errors.push(new p.YAMLSemanticError(a, f));
|
|
2288
|
+
default:
|
|
2289
|
+
t.errors.push(new p.YAMLSemanticError(a, "Implicit map keys need to be followed by map values"));
|
|
2333
2290
|
break e;
|
|
2334
|
-
}
|
|
2335
2291
|
}
|
|
2336
2292
|
}
|
|
2337
|
-
if (a.valueRangeContainsNewline)
|
|
2338
|
-
let c = "Implicit map keys need to be on a single line";
|
|
2339
|
-
t.errors.push(new p.YAMLSemanticError(a, c));
|
|
2340
|
-
}
|
|
2293
|
+
if (a.valueRangeContainsNewline) t.errors.push(new p.YAMLSemanticError(a, "Implicit map keys need to be on a single line"));
|
|
2341
2294
|
}
|
|
2342
2295
|
}
|
|
2343
2296
|
return s !== void 0 && r.push(new T(s)), {
|
|
@@ -2392,10 +2345,7 @@ ${a}` : a);
|
|
|
2392
2345
|
return t.errors.push(new p.YAMLSyntaxError(e, i)), null;
|
|
2393
2346
|
}
|
|
2394
2347
|
let { comments: n, items: r } = e.type === p.Type.FLOW_SEQ ? zo(t, e) : Xo(t, e), s = new le();
|
|
2395
|
-
if (s.items = r, ms(s, n), !t.options.mapAsMap && r.some((i) => i instanceof T && i.key instanceof W))
|
|
2396
|
-
let i = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
|
|
2397
|
-
t.warnings.push(new p.YAMLWarning(e, i));
|
|
2398
|
-
}
|
|
2348
|
+
if (s.items = r, ms(s, n), !t.options.mapAsMap && r.some((i) => i instanceof T && i.key instanceof W)) t.warnings.push(new p.YAMLWarning(e, "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this."));
|
|
2399
2349
|
return e.resolved = s, s;
|
|
2400
2350
|
}
|
|
2401
2351
|
function Xo(t, e) {
|
|
@@ -2413,10 +2363,7 @@ ${a}` : a);
|
|
|
2413
2363
|
});
|
|
2414
2364
|
break;
|
|
2415
2365
|
case p.Type.SEQ_ITEM:
|
|
2416
|
-
if (i.error && t.errors.push(i.error), r.push(fe(t, i.node)), i.hasProps)
|
|
2417
|
-
let o = "Sequence items cannot have tags or anchors before the - indicator";
|
|
2418
|
-
t.errors.push(new p.YAMLSemanticError(i, o));
|
|
2419
|
-
}
|
|
2366
|
+
if (i.error && t.errors.push(i.error), r.push(fe(t, i.node)), i.hasProps) t.errors.push(new p.YAMLSemanticError(i, "Sequence items cannot have tags or anchors before the - indicator"));
|
|
2420
2367
|
break;
|
|
2421
2368
|
default: i.error && t.errors.push(i.error), t.errors.push(new p.YAMLSyntaxError(i, `Unexpected ${i.type} node in sequence`));
|
|
2422
2369
|
}
|
|
@@ -2446,8 +2393,7 @@ ${a}` : a);
|
|
|
2446
2393
|
let { src: h } = c.context;
|
|
2447
2394
|
for (let g = o; g < y; ++g) if (h[g] === `
|
|
2448
2395
|
`) {
|
|
2449
|
-
|
|
2450
|
-
t.errors.push(new p.YAMLSemanticError(c, w));
|
|
2396
|
+
t.errors.push(new p.YAMLSemanticError(c, "Implicit keys of flow sequence pairs need to be on a single line"));
|
|
2451
2397
|
break;
|
|
2452
2398
|
}
|
|
2453
2399
|
}
|
|
@@ -2512,10 +2458,7 @@ var Gn = te((z) => {
|
|
|
2512
2458
|
let r = atob(n.replace(/[\n\r]/g, "")), s = new Uint8Array(r.length);
|
|
2513
2459
|
for (let i = 0; i < r.length; ++i) s[i] = r.charCodeAt(i);
|
|
2514
2460
|
return s;
|
|
2515
|
-
} else
|
|
2516
|
-
let r = "This environment does not support reading binary tags; either Buffer or atob is required";
|
|
2517
|
-
return t.errors.push(new Q.YAMLReferenceError(e, r)), null;
|
|
2518
|
-
}
|
|
2461
|
+
} else return t.errors.push(new Q.YAMLReferenceError(e, "This environment does not support reading binary tags; either Buffer or atob is required")), null;
|
|
2519
2462
|
},
|
|
2520
2463
|
options: O.binaryOptions,
|
|
2521
2464
|
stringify: ({ comment: t, type: e, value: n }, r, s, i) => {
|
|
@@ -2546,10 +2489,7 @@ var Gn = te((z) => {
|
|
|
2546
2489
|
let s = n.items[r];
|
|
2547
2490
|
if (!(s instanceof O.Pair)) {
|
|
2548
2491
|
if (s instanceof O.YAMLMap) {
|
|
2549
|
-
if (s.items.length > 1)
|
|
2550
|
-
let o = "Each pair must have its own sequence indicator";
|
|
2551
|
-
throw new Q.YAMLSemanticError(e, o);
|
|
2552
|
-
}
|
|
2492
|
+
if (s.items.length > 1) throw new Q.YAMLSemanticError(e, "Each pair must have its own sequence indicator");
|
|
2553
2493
|
let i = s.items[0] || new O.Pair();
|
|
2554
2494
|
s.commentBefore && (i.commentBefore = i.commentBefore ? `${s.commentBefore}
|
|
2555
2495
|
${i.commentBefore}` : s.commentBefore), s.comment && (i.comment = i.comment ? `${s.comment}
|
|
@@ -2600,10 +2540,8 @@ ${i.comment}` : s.comment), s = i;
|
|
|
2600
2540
|
Q._defineProperty(Ue, "tag", "tag:yaml.org,2002:omap");
|
|
2601
2541
|
function ta(t, e) {
|
|
2602
2542
|
let n = gs(t, e), r = [];
|
|
2603
|
-
for (let { key: s } of n.items) if (s instanceof O.Scalar) if (r.includes(s.value))
|
|
2604
|
-
|
|
2605
|
-
throw new Q.YAMLSemanticError(e, i);
|
|
2606
|
-
} else r.push(s.value);
|
|
2543
|
+
for (let { key: s } of n.items) if (s instanceof O.Scalar) if (r.includes(s.value)) throw new Q.YAMLSemanticError(e, "Ordered maps must not include duplicate keys");
|
|
2544
|
+
else r.push(s.value);
|
|
2607
2545
|
return Object.assign(new Ue(), n);
|
|
2608
2546
|
}
|
|
2609
2547
|
function na(t, e, n) {
|
|
@@ -3351,8 +3289,7 @@ ${e.indent}${c}` : c;
|
|
|
3351
3289
|
}, r, s = !1;
|
|
3352
3290
|
for (let i of e) if (i.valueRange) {
|
|
3353
3291
|
if (r !== void 0) {
|
|
3354
|
-
|
|
3355
|
-
t.errors.push(new Y.YAMLSyntaxError(i, a));
|
|
3292
|
+
t.errors.push(new Y.YAMLSyntaxError(i, "Document contains trailing content not separated by a ... or --- line"));
|
|
3356
3293
|
break;
|
|
3357
3294
|
}
|
|
3358
3295
|
let o = S.resolveNode(t, i);
|
|
@@ -3375,14 +3312,8 @@ ${o.commentBefore}` : i;
|
|
|
3375
3312
|
}
|
|
3376
3313
|
function ka({ tagPrefixes: t }, e) {
|
|
3377
3314
|
let [n, r] = e.parameters;
|
|
3378
|
-
if (!n || !r)
|
|
3379
|
-
|
|
3380
|
-
throw new Y.YAMLSemanticError(e, s);
|
|
3381
|
-
}
|
|
3382
|
-
if (t.some((s) => s.handle === n)) {
|
|
3383
|
-
let s = "The %TAG directive must only be given at most once per handle in the same document.";
|
|
3384
|
-
throw new Y.YAMLSemanticError(e, s);
|
|
3385
|
-
}
|
|
3315
|
+
if (!n || !r) throw new Y.YAMLSemanticError(e, "Insufficient parameters given for %TAG directive");
|
|
3316
|
+
if (t.some((s) => s.handle === n)) throw new Y.YAMLSemanticError(e, "The %TAG directive must only be given at most once per handle in the same document.");
|
|
3386
3317
|
return {
|
|
3387
3318
|
handle: n,
|
|
3388
3319
|
prefix: r
|
|
@@ -3390,10 +3321,7 @@ ${o.commentBefore}` : i;
|
|
|
3390
3321
|
}
|
|
3391
3322
|
function Pa(t, e) {
|
|
3392
3323
|
let [n] = e.parameters;
|
|
3393
|
-
if (e.name === "YAML:1.0" && (n = "1.0"), !n)
|
|
3394
|
-
let r = "Insufficient parameters given for %YAML directive";
|
|
3395
|
-
throw new Y.YAMLSemanticError(e, r);
|
|
3396
|
-
}
|
|
3324
|
+
if (e.name === "YAML:1.0" && (n = "1.0"), !n) throw new Y.YAMLSemanticError(e, "Insufficient parameters given for %YAML directive");
|
|
3397
3325
|
if (!_s[n]) {
|
|
3398
3326
|
let s = `Document will be parsed as YAML ${t.version || t.options.version} rather than YAML ${n}`;
|
|
3399
3327
|
t.warnings.push(new Y.YAMLWarning(e, s));
|
|
@@ -3415,10 +3343,7 @@ ${o.commentBefore}` : i;
|
|
|
3415
3343
|
break;
|
|
3416
3344
|
case "YAML":
|
|
3417
3345
|
case "YAML:1.0":
|
|
3418
|
-
if (t.version)
|
|
3419
|
-
let c = "The %YAML directive must only be given at most once per document.";
|
|
3420
|
-
t.errors.push(new Y.YAMLSemanticError(i, c));
|
|
3421
|
-
}
|
|
3346
|
+
if (t.version) t.errors.push(new Y.YAMLSemanticError(i, "The %YAML directive must only be given at most once per document."));
|
|
3422
3347
|
try {
|
|
3423
3348
|
t.version = Pa(t, i);
|
|
3424
3349
|
} catch (c) {
|
|
@@ -3592,10 +3517,7 @@ var Ys = te((Ds) => {
|
|
|
3592
3517
|
}
|
|
3593
3518
|
function xs(t, e) {
|
|
3594
3519
|
let n = er.parse(t), r = new je(e).parse(n[0]);
|
|
3595
|
-
if (n.length > 1)
|
|
3596
|
-
let s = "Source contains multiple documents; please use YAML.parseAllDocuments()";
|
|
3597
|
-
r.errors.unshift(new _a.YAMLSemanticError(n[1], s));
|
|
3598
|
-
}
|
|
3520
|
+
if (n.length > 1) r.errors.unshift(new _a.YAMLSemanticError(n[1], "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
3599
3521
|
return r;
|
|
3600
3522
|
}
|
|
3601
3523
|
function Ya(t, e) {
|
|
@@ -3607,7 +3529,7 @@ var Ys = te((Ds) => {
|
|
|
3607
3529
|
let n = new je(e);
|
|
3608
3530
|
return n.contents = t, String(n);
|
|
3609
3531
|
}
|
|
3610
|
-
|
|
3532
|
+
Ds.YAML = {
|
|
3611
3533
|
createNode: xa,
|
|
3612
3534
|
defaultOptions: Oe.defaultOptions,
|
|
3613
3535
|
Document: je,
|
|
@@ -3618,7 +3540,6 @@ var Ys = te((Ds) => {
|
|
|
3618
3540
|
scalarOptions: Oe.scalarOptions,
|
|
3619
3541
|
stringify: $a
|
|
3620
3542
|
};
|
|
3621
|
-
Ds.YAML = Ba;
|
|
3622
3543
|
});
|
|
3623
3544
|
var tr = te((nf, $s) => {
|
|
3624
3545
|
$s.exports = Ys().YAML;
|
|
@@ -3942,8 +3863,8 @@ var ro = Object.fromEntries(Object.entries({
|
|
|
3942
3863
|
"middleComments",
|
|
3943
3864
|
"trailingComment",
|
|
3944
3865
|
"endComments"
|
|
3945
|
-
]]))
|
|
3946
|
-
var so = Mr(
|
|
3866
|
+
]]));
|
|
3867
|
+
var so = Mr(ro), kr = so;
|
|
3947
3868
|
function xe(t) {
|
|
3948
3869
|
return t.position.start.offset;
|
|
3949
3870
|
}
|
|
@@ -5307,4 +5228,4 @@ exports.languages = Xr;
|
|
|
5307
5228
|
exports.options = zr;
|
|
5308
5229
|
exports.parsers = hr;
|
|
5309
5230
|
exports.printers = rc;
|
|
5310
|
-
//# sourceMappingURL=yaml-
|
|
5231
|
+
//# sourceMappingURL=yaml-B2qeXFgu.cjs.map
|