commitlint-config-spellbookx 1.1.2 → 1.3.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/CHANGELOG.md +15 -0
- package/README.md +91 -60
- package/__tests__/index.test.ts +3 -29
- package/dist/{get-scopes-D9bIfVqN.js → git-C5S_9pJT.js} +2166 -276
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -7
- package/dist/lib/index.d.ts +1 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -5
- package/dist/prompt.js +8 -10
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +1 -4
- package/package.json +3 -15
- package/rolldown.config.ts +0 -6
- package/src/index.ts +2 -9
- package/src/lib/index.ts +1 -5
- package/src/prompt.ts +8 -8
- package/src/rules.ts +1 -2
- package/__tests__/scopes.test.ts +0 -42
- package/__tests__/workspaces.test.ts +0 -137
- package/dist/constants/commit-types.d.ts +0 -13
- package/dist/constants/commit-types.d.ts.map +0 -1
- package/dist/constants/commit-types.js +0 -24
- package/dist/get-workspaces-raw-path-Cg196xaD.js +0 -2043
- package/dist/lib/find-git-root.d.ts +0 -16
- package/dist/lib/find-git-root.d.ts.map +0 -1
- package/dist/lib/find-git-root.js +0 -30
- package/dist/lib/get-scope-description.d.ts +0 -21
- package/dist/lib/get-scope-description.d.ts.map +0 -1
- package/dist/lib/get-scope-description.js +0 -35
- package/dist/lib/get-scopes.d.ts +0 -16
- package/dist/lib/get-scopes.d.ts.map +0 -1
- package/dist/lib/get-scopes.js +0 -4
- package/dist/lib/get-workspaces-raw-path.d.ts +0 -19
- package/dist/lib/get-workspaces-raw-path.d.ts.map +0 -1
- package/dist/lib/get-workspaces-raw-path.js +0 -3
- package/dist/scopes.d.ts +0 -23
- package/dist/scopes.d.ts.map +0 -1
- package/dist/scopes.js +0 -38
- package/src/constants/commit-types.ts +0 -26
- package/src/lib/find-git-root.ts +0 -31
- package/src/lib/get-scope-description.ts +0 -38
- package/src/lib/get-scopes.ts +0 -89
- package/src/lib/get-workspaces-raw-path.ts +0 -53
- package/src/scopes.ts +0 -40
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { findGitRoot } from "./lib/find-git-root.js";
|
|
2
|
-
import { t as getWorkspacesRawPath } from "./get-workspaces-raw-path-Cg196xaD.js";
|
|
3
1
|
import { createRequire } from "node:module";
|
|
4
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
3
|
import path from "node:path";
|
|
6
4
|
|
|
7
|
-
//#region
|
|
5
|
+
//#region ../recipes/dist/git-siaqJzHq.js
|
|
8
6
|
var __create = Object.create;
|
|
9
7
|
var __defProp = Object.defineProperty;
|
|
10
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -13,16 +11,12 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
13
11
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
12
|
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
15
13
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
26
20
|
}
|
|
27
21
|
return to;
|
|
28
22
|
};
|
|
@@ -31,9 +25,80 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
25
|
enumerable: true
|
|
32
26
|
}) : target, mod));
|
|
33
27
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
/**
|
|
29
|
+
* @file commit-types.ts
|
|
30
|
+
* Standard Conventional Commit types supported by Spellbookx.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* List of allowed commit types based on the Conventional Commits specification.
|
|
34
|
+
*/
|
|
35
|
+
const COMMIT_TYPES = [
|
|
36
|
+
"feat",
|
|
37
|
+
"fix",
|
|
38
|
+
"docs",
|
|
39
|
+
"style",
|
|
40
|
+
"refactor",
|
|
41
|
+
"perf",
|
|
42
|
+
"test",
|
|
43
|
+
"chore",
|
|
44
|
+
"ci",
|
|
45
|
+
"build",
|
|
46
|
+
"revert"
|
|
47
|
+
];
|
|
48
|
+
/**
|
|
49
|
+
* @file find-git-root.ts
|
|
50
|
+
* Utility to locate the root directory of a git repository.
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Finds the git root directory by traversing upwards from startDir.
|
|
54
|
+
*
|
|
55
|
+
* @param startDir - Directory to start searching from (defaults to process.cwd()).
|
|
56
|
+
* @returns Path to git root directory, or null if not within a git repository.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const root = findGitRoot();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
function findGitRoot(startDir = process.cwd()) {
|
|
63
|
+
let current = path.resolve(startDir);
|
|
64
|
+
while (true) {
|
|
65
|
+
if (existsSync(path.join(current, ".git"))) return current;
|
|
66
|
+
const parent = path.dirname(current);
|
|
67
|
+
if (parent === current) return null;
|
|
68
|
+
current = parent;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @file get-scope-description.ts
|
|
73
|
+
* Formats user-facing description strings for commit scopes.
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Scope identifier for workspace-level changes.
|
|
77
|
+
*/
|
|
78
|
+
const SCOPE_WORKSPACE$1 = "workspace";
|
|
79
|
+
/**
|
|
80
|
+
* Scope identifier for release commits.
|
|
81
|
+
*/
|
|
82
|
+
const SCOPE_RELEASE$1 = "release";
|
|
83
|
+
/**
|
|
84
|
+
* Returns a human-readable description for a given commit scope.
|
|
85
|
+
*
|
|
86
|
+
* @param scope - The scope identifier.
|
|
87
|
+
* @returns The description string for the scope.
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* getScopeDescription('workspace');
|
|
91
|
+
* // 'workspace scope - root files such as config files, root package.json, etc'
|
|
92
|
+
* getScopeDescription('release');
|
|
93
|
+
* // 'Special scope for release commits'
|
|
94
|
+
* getScopeDescription('my-package');
|
|
95
|
+
* // 'my-package scope'
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
function getScopeDescription(scope) {
|
|
99
|
+
if (scope === SCOPE_WORKSPACE$1) return "workspace scope - root files such as config files, root package.json, etc";
|
|
100
|
+
return scope === SCOPE_RELEASE$1 ? "Special scope for release commits" : `${scope} scope`;
|
|
101
|
+
}
|
|
37
102
|
var require_array = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
38
103
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
104
|
exports.splitWhen = exports.flatten = void 0;
|
|
@@ -52,9 +117,6 @@ var require_array = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
52
117
|
}
|
|
53
118
|
exports.splitWhen = splitWhen;
|
|
54
119
|
}));
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js
|
|
58
120
|
var require_errno = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
59
121
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
122
|
exports.isEnoentCodeError = void 0;
|
|
@@ -63,9 +125,6 @@ var require_errno = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
63
125
|
}
|
|
64
126
|
exports.isEnoentCodeError = isEnoentCodeError;
|
|
65
127
|
}));
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js
|
|
69
128
|
var require_fs$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
70
129
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
130
|
exports.createDirentFromStats = void 0;
|
|
@@ -86,9 +145,6 @@ var require_fs$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
86
145
|
}
|
|
87
146
|
exports.createDirentFromStats = createDirentFromStats;
|
|
88
147
|
}));
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js
|
|
92
148
|
var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
93
149
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94
150
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
|
@@ -152,9 +208,6 @@ var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
152
208
|
}
|
|
153
209
|
exports.convertPosixPathToPattern = convertPosixPathToPattern;
|
|
154
210
|
}));
|
|
155
|
-
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region ../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js
|
|
158
211
|
var require_is_extglob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
159
212
|
/*!
|
|
160
213
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
@@ -172,9 +225,6 @@ var require_is_extglob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
172
225
|
return false;
|
|
173
226
|
};
|
|
174
227
|
}));
|
|
175
|
-
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region ../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js
|
|
178
228
|
var require_is_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
179
229
|
/*!
|
|
180
230
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
@@ -270,9 +320,6 @@ var require_is_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
270
320
|
return check(str);
|
|
271
321
|
};
|
|
272
322
|
}));
|
|
273
|
-
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region ../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js
|
|
276
323
|
var require_glob_parent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
277
324
|
var isGlob = require_is_glob();
|
|
278
325
|
var pathPosixDirname = __require("path").posix.dirname;
|
|
@@ -298,9 +345,6 @@ var require_glob_parent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
298
345
|
return str.replace(escaped, "$1");
|
|
299
346
|
};
|
|
300
347
|
}));
|
|
301
|
-
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
|
|
304
348
|
var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
305
349
|
exports.isInteger = (num) => {
|
|
306
350
|
if (typeof num === "number") return Number.isInteger(num);
|
|
@@ -394,9 +438,6 @@ var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
394
438
|
return result;
|
|
395
439
|
};
|
|
396
440
|
}));
|
|
397
|
-
|
|
398
|
-
//#endregion
|
|
399
|
-
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
|
|
400
441
|
var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
401
442
|
const utils = require_utils$3();
|
|
402
443
|
module.exports = (ast, options = {}) => {
|
|
@@ -415,9 +456,6 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
415
456
|
return stringify(ast);
|
|
416
457
|
};
|
|
417
458
|
}));
|
|
418
|
-
|
|
419
|
-
//#endregion
|
|
420
|
-
//#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
|
|
421
459
|
/*!
|
|
422
460
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|
423
461
|
*
|
|
@@ -431,9 +469,6 @@ var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
431
469
|
return false;
|
|
432
470
|
};
|
|
433
471
|
}));
|
|
434
|
-
|
|
435
|
-
//#endregion
|
|
436
|
-
//#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
|
|
437
472
|
/*!
|
|
438
473
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
439
474
|
*
|
|
@@ -631,9 +666,6 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
631
666
|
*/
|
|
632
667
|
module.exports = toRegexRange;
|
|
633
668
|
}));
|
|
634
|
-
|
|
635
|
-
//#endregion
|
|
636
|
-
//#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
|
|
637
669
|
/*!
|
|
638
670
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
639
671
|
*
|
|
@@ -800,9 +832,6 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
800
832
|
};
|
|
801
833
|
module.exports = fill;
|
|
802
834
|
}));
|
|
803
|
-
|
|
804
|
-
//#endregion
|
|
805
|
-
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
|
|
806
835
|
var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
807
836
|
const fill = require_fill_range();
|
|
808
837
|
const utils = require_utils$3();
|
|
@@ -839,9 +868,6 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
839
868
|
};
|
|
840
869
|
module.exports = compile;
|
|
841
870
|
}));
|
|
842
|
-
|
|
843
|
-
//#endregion
|
|
844
|
-
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
|
|
845
871
|
var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
846
872
|
const fill = require_fill_range();
|
|
847
873
|
const stringify = require_stringify();
|
|
@@ -916,9 +942,6 @@ var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
916
942
|
};
|
|
917
943
|
module.exports = expand;
|
|
918
944
|
}));
|
|
919
|
-
|
|
920
|
-
//#endregion
|
|
921
|
-
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
|
|
922
945
|
var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
923
946
|
module.exports = {
|
|
924
947
|
MAX_LENGTH: 1e4,
|
|
@@ -968,9 +991,6 @@ var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
968
991
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
|
|
969
992
|
};
|
|
970
993
|
}));
|
|
971
|
-
|
|
972
|
-
//#endregion
|
|
973
|
-
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
|
|
974
994
|
var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
975
995
|
const stringify = require_stringify();
|
|
976
996
|
/**
|
|
@@ -1256,9 +1276,6 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1256
1276
|
};
|
|
1257
1277
|
module.exports = parse;
|
|
1258
1278
|
}));
|
|
1259
|
-
|
|
1260
|
-
//#endregion
|
|
1261
|
-
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
|
|
1262
1279
|
var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1263
1280
|
const stringify = require_stringify();
|
|
1264
1281
|
const compile = require_compile();
|
|
@@ -1384,9 +1401,6 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1384
1401
|
*/
|
|
1385
1402
|
module.exports = braces;
|
|
1386
1403
|
}));
|
|
1387
|
-
|
|
1388
|
-
//#endregion
|
|
1389
|
-
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
|
|
1390
1404
|
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1391
1405
|
const path$8 = __require("path");
|
|
1392
1406
|
const WIN_SLASH = "\\\\/";
|
|
@@ -1437,28 +1451,24 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1437
1451
|
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
1438
1452
|
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
1439
1453
|
};
|
|
1440
|
-
/**
|
|
1441
|
-
* POSIX Bracket Regex
|
|
1442
|
-
*/
|
|
1443
|
-
const POSIX_REGEX_SOURCE = {
|
|
1444
|
-
alnum: "a-zA-Z0-9",
|
|
1445
|
-
alpha: "a-zA-Z",
|
|
1446
|
-
ascii: "\\x00-\\x7F",
|
|
1447
|
-
blank: " \\t",
|
|
1448
|
-
cntrl: "\\x00-\\x1F\\x7F",
|
|
1449
|
-
digit: "0-9",
|
|
1450
|
-
graph: "\\x21-\\x7E",
|
|
1451
|
-
lower: "a-z",
|
|
1452
|
-
print: "\\x20-\\x7E ",
|
|
1453
|
-
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
1454
|
-
space: " \\t\\r\\n\\v\\f",
|
|
1455
|
-
upper: "A-Z",
|
|
1456
|
-
word: "A-Za-z0-9_",
|
|
1457
|
-
xdigit: "A-Fa-f0-9"
|
|
1458
|
-
};
|
|
1459
1454
|
module.exports = {
|
|
1460
1455
|
MAX_LENGTH: 1024 * 64,
|
|
1461
|
-
POSIX_REGEX_SOURCE
|
|
1456
|
+
POSIX_REGEX_SOURCE: {
|
|
1457
|
+
alnum: "a-zA-Z0-9",
|
|
1458
|
+
alpha: "a-zA-Z",
|
|
1459
|
+
ascii: "\\x00-\\x7F",
|
|
1460
|
+
blank: " \\t",
|
|
1461
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
1462
|
+
digit: "0-9",
|
|
1463
|
+
graph: "\\x21-\\x7E",
|
|
1464
|
+
lower: "a-z",
|
|
1465
|
+
print: "\\x20-\\x7E ",
|
|
1466
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
1467
|
+
space: " \\t\\r\\n\\v\\f",
|
|
1468
|
+
upper: "A-Z",
|
|
1469
|
+
word: "A-Za-z0-9_",
|
|
1470
|
+
xdigit: "A-Fa-f0-9"
|
|
1471
|
+
},
|
|
1462
1472
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
1463
1473
|
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
1464
1474
|
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
@@ -1548,9 +1558,6 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1548
1558
|
}
|
|
1549
1559
|
};
|
|
1550
1560
|
}));
|
|
1551
|
-
|
|
1552
|
-
//#endregion
|
|
1553
|
-
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
|
|
1554
1561
|
var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1555
1562
|
const path$7 = __require("path");
|
|
1556
1563
|
const win32 = process.platform === "win32";
|
|
@@ -1594,9 +1601,6 @@ var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1594
1601
|
return output;
|
|
1595
1602
|
};
|
|
1596
1603
|
}));
|
|
1597
|
-
|
|
1598
|
-
//#endregion
|
|
1599
|
-
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
|
|
1600
1604
|
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1601
1605
|
const utils = require_utils$2();
|
|
1602
1606
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1();
|
|
@@ -1882,9 +1886,6 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1882
1886
|
};
|
|
1883
1887
|
module.exports = scan;
|
|
1884
1888
|
}));
|
|
1885
|
-
|
|
1886
|
-
//#endregion
|
|
1887
|
-
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
|
|
1888
1889
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1889
1890
|
const constants = require_constants$1();
|
|
1890
1891
|
const utils = require_utils$2();
|
|
@@ -2744,9 +2745,6 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2744
2745
|
};
|
|
2745
2746
|
module.exports = parse;
|
|
2746
2747
|
}));
|
|
2747
|
-
|
|
2748
|
-
//#endregion
|
|
2749
|
-
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
|
|
2750
2748
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2751
2749
|
const path$6 = __require("path");
|
|
2752
2750
|
const scan = require_scan();
|
|
@@ -3038,15 +3036,9 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3038
3036
|
*/
|
|
3039
3037
|
module.exports = picomatch;
|
|
3040
3038
|
}));
|
|
3041
|
-
|
|
3042
|
-
//#endregion
|
|
3043
|
-
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js
|
|
3044
3039
|
var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3045
3040
|
module.exports = require_picomatch$1();
|
|
3046
3041
|
}));
|
|
3047
|
-
|
|
3048
|
-
//#endregion
|
|
3049
|
-
//#region ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
|
|
3050
3042
|
var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3051
3043
|
const util = __require("util");
|
|
3052
3044
|
const braces = require_braces();
|
|
@@ -3439,9 +3431,6 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3439
3431
|
micromatch.hasBraces = hasBraces;
|
|
3440
3432
|
module.exports = micromatch;
|
|
3441
3433
|
}));
|
|
3442
|
-
|
|
3443
|
-
//#endregion
|
|
3444
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js
|
|
3445
3434
|
var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3446
3435
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3447
3436
|
exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
|
@@ -3631,9 +3620,6 @@ var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3631
3620
|
}
|
|
3632
3621
|
exports.isAbsolute = isAbsolute;
|
|
3633
3622
|
}));
|
|
3634
|
-
|
|
3635
|
-
//#endregion
|
|
3636
|
-
//#region ../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js
|
|
3637
3623
|
var require_merge2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3638
3624
|
const PassThrough = __require("stream").PassThrough;
|
|
3639
3625
|
const slice = Array.prototype.slice;
|
|
@@ -3712,9 +3698,6 @@ var require_merge2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3712
3698
|
return streams;
|
|
3713
3699
|
}
|
|
3714
3700
|
}));
|
|
3715
|
-
|
|
3716
|
-
//#endregion
|
|
3717
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js
|
|
3718
3701
|
var require_stream$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3719
3702
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3720
3703
|
exports.merge = void 0;
|
|
@@ -3733,9 +3716,6 @@ var require_stream$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3733
3716
|
streams.forEach((stream) => stream.emit("close"));
|
|
3734
3717
|
}
|
|
3735
3718
|
}));
|
|
3736
|
-
|
|
3737
|
-
//#endregion
|
|
3738
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js
|
|
3739
3719
|
var require_string = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3740
3720
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3741
3721
|
exports.isEmpty = exports.isString = void 0;
|
|
@@ -3748,30 +3728,17 @@ var require_string = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3748
3728
|
}
|
|
3749
3729
|
exports.isEmpty = isEmpty;
|
|
3750
3730
|
}));
|
|
3751
|
-
|
|
3752
|
-
//#endregion
|
|
3753
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js
|
|
3754
3731
|
var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3755
3732
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3756
3733
|
exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
|
|
3757
|
-
|
|
3758
|
-
exports.
|
|
3759
|
-
|
|
3760
|
-
exports.
|
|
3761
|
-
|
|
3762
|
-
exports.
|
|
3763
|
-
|
|
3764
|
-
exports.path = path;
|
|
3765
|
-
const pattern = require_pattern();
|
|
3766
|
-
exports.pattern = pattern;
|
|
3767
|
-
const stream = require_stream$3();
|
|
3768
|
-
exports.stream = stream;
|
|
3769
|
-
const string = require_string();
|
|
3770
|
-
exports.string = string;
|
|
3734
|
+
exports.array = require_array();
|
|
3735
|
+
exports.errno = require_errno();
|
|
3736
|
+
exports.fs = require_fs$3();
|
|
3737
|
+
exports.path = require_path();
|
|
3738
|
+
exports.pattern = require_pattern();
|
|
3739
|
+
exports.stream = require_stream$3();
|
|
3740
|
+
exports.string = require_string();
|
|
3771
3741
|
}));
|
|
3772
|
-
|
|
3773
|
-
//#endregion
|
|
3774
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js
|
|
3775
3742
|
var require_tasks = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3776
3743
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3777
3744
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
@@ -3864,9 +3831,6 @@ var require_tasks = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3864
3831
|
}
|
|
3865
3832
|
exports.convertPatternGroupToTask = convertPatternGroupToTask;
|
|
3866
3833
|
}));
|
|
3867
|
-
|
|
3868
|
-
//#endregion
|
|
3869
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js
|
|
3870
3834
|
var require_async$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3871
3835
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3872
3836
|
exports.read = void 0;
|
|
@@ -3902,9 +3866,6 @@ var require_async$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3902
3866
|
callback(null, result);
|
|
3903
3867
|
}
|
|
3904
3868
|
}));
|
|
3905
|
-
|
|
3906
|
-
//#endregion
|
|
3907
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js
|
|
3908
3869
|
var require_sync$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3909
3870
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3910
3871
|
exports.read = void 0;
|
|
@@ -3922,9 +3883,6 @@ var require_sync$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3922
3883
|
}
|
|
3923
3884
|
exports.read = read;
|
|
3924
3885
|
}));
|
|
3925
|
-
|
|
3926
|
-
//#endregion
|
|
3927
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js
|
|
3928
3886
|
var require_fs$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3929
3887
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3930
3888
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
@@ -3941,9 +3899,6 @@ var require_fs$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3941
3899
|
}
|
|
3942
3900
|
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
3943
3901
|
}));
|
|
3944
|
-
|
|
3945
|
-
//#endregion
|
|
3946
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js
|
|
3947
3902
|
var require_settings$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3948
3903
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3949
3904
|
const fs = require_fs$2();
|
|
@@ -3961,9 +3916,6 @@ var require_settings$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3961
3916
|
};
|
|
3962
3917
|
exports.default = Settings;
|
|
3963
3918
|
}));
|
|
3964
|
-
|
|
3965
|
-
//#endregion
|
|
3966
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js
|
|
3967
3919
|
var require_out$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3968
3920
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3969
3921
|
exports.statSync = exports.stat = exports.Settings = void 0;
|
|
@@ -3989,9 +3941,6 @@ var require_out$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3989
3941
|
return new settings_1.default(settingsOrOptions);
|
|
3990
3942
|
}
|
|
3991
3943
|
}));
|
|
3992
|
-
|
|
3993
|
-
//#endregion
|
|
3994
|
-
//#region ../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js
|
|
3995
3944
|
var require_queue_microtask = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3996
3945
|
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3997
3946
|
let promise;
|
|
@@ -3999,9 +3948,6 @@ var require_queue_microtask = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
3999
3948
|
throw err;
|
|
4000
3949
|
}, 0));
|
|
4001
3950
|
}));
|
|
4002
|
-
|
|
4003
|
-
//#endregion
|
|
4004
|
-
//#region ../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js
|
|
4005
3951
|
var require_run_parallel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4006
3952
|
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
4007
3953
|
module.exports = runParallel;
|
|
@@ -4043,9 +3989,6 @@ var require_run_parallel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4043
3989
|
isSync = false;
|
|
4044
3990
|
}
|
|
4045
3991
|
}));
|
|
4046
|
-
|
|
4047
|
-
//#endregion
|
|
4048
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js
|
|
4049
3992
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4050
3993
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4051
3994
|
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
|
|
@@ -4054,17 +3997,11 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4054
3997
|
const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
|
|
4055
3998
|
const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
|
|
4056
3999
|
const SUPPORTED_MAJOR_VERSION = 10;
|
|
4057
|
-
const SUPPORTED_MINOR_VERSION = 10;
|
|
4058
|
-
const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
|
|
4059
|
-
const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
|
|
4060
4000
|
/**
|
|
4061
4001
|
* IS `true` for Node.js 10.10 and greater.
|
|
4062
4002
|
*/
|
|
4063
|
-
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES =
|
|
4003
|
+
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION || MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= 10;
|
|
4064
4004
|
}));
|
|
4065
|
-
|
|
4066
|
-
//#endregion
|
|
4067
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js
|
|
4068
4005
|
var require_fs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4069
4006
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4070
4007
|
exports.createDirentFromStats = void 0;
|
|
@@ -4085,18 +4022,11 @@ var require_fs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4085
4022
|
}
|
|
4086
4023
|
exports.createDirentFromStats = createDirentFromStats;
|
|
4087
4024
|
}));
|
|
4088
|
-
|
|
4089
|
-
//#endregion
|
|
4090
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js
|
|
4091
4025
|
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4092
4026
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4093
4027
|
exports.fs = void 0;
|
|
4094
|
-
|
|
4095
|
-
exports.fs = fs;
|
|
4028
|
+
exports.fs = require_fs$1();
|
|
4096
4029
|
}));
|
|
4097
|
-
|
|
4098
|
-
//#endregion
|
|
4099
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js
|
|
4100
4030
|
var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4101
4031
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4102
4032
|
exports.joinPathSegments = void 0;
|
|
@@ -4109,9 +4039,6 @@ var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4109
4039
|
}
|
|
4110
4040
|
exports.joinPathSegments = joinPathSegments;
|
|
4111
4041
|
}));
|
|
4112
|
-
|
|
4113
|
-
//#endregion
|
|
4114
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js
|
|
4115
4042
|
var require_async$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4116
4043
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4117
4044
|
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
|
|
@@ -4213,9 +4140,6 @@ var require_async$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4213
4140
|
callback(null, result);
|
|
4214
4141
|
}
|
|
4215
4142
|
}));
|
|
4216
|
-
|
|
4217
|
-
//#endregion
|
|
4218
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js
|
|
4219
4143
|
var require_sync$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4220
4144
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4221
4145
|
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
|
|
@@ -4260,9 +4184,6 @@ var require_sync$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4260
4184
|
}
|
|
4261
4185
|
exports.readdir = readdir;
|
|
4262
4186
|
}));
|
|
4263
|
-
|
|
4264
|
-
//#endregion
|
|
4265
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js
|
|
4266
4187
|
var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4267
4188
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4268
4189
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
@@ -4281,9 +4202,6 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4281
4202
|
}
|
|
4282
4203
|
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
4283
4204
|
}));
|
|
4284
|
-
|
|
4285
|
-
//#endregion
|
|
4286
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js
|
|
4287
4205
|
var require_settings$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4288
4206
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4289
4207
|
const path$4 = __require("path");
|
|
@@ -4309,9 +4227,6 @@ var require_settings$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4309
4227
|
};
|
|
4310
4228
|
exports.default = Settings;
|
|
4311
4229
|
}));
|
|
4312
|
-
|
|
4313
|
-
//#endregion
|
|
4314
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js
|
|
4315
4230
|
var require_out$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4316
4231
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4317
4232
|
exports.Settings = exports.scandirSync = exports.scandir = void 0;
|
|
@@ -4337,9 +4252,6 @@ var require_out$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4337
4252
|
return new settings_1.default(settingsOrOptions);
|
|
4338
4253
|
}
|
|
4339
4254
|
}));
|
|
4340
|
-
|
|
4341
|
-
//#endregion
|
|
4342
|
-
//#region ../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js
|
|
4343
4255
|
var require_reusify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4344
4256
|
function reusify(Constructor) {
|
|
4345
4257
|
var head = new Constructor();
|
|
@@ -4365,9 +4277,6 @@ var require_reusify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4365
4277
|
}
|
|
4366
4278
|
module.exports = reusify;
|
|
4367
4279
|
}));
|
|
4368
|
-
|
|
4369
|
-
//#endregion
|
|
4370
|
-
//#region ../../node_modules/.pnpm/fastq@1.20.1/node_modules/fastq/queue.js
|
|
4371
4280
|
var require_queue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4372
4281
|
var reusify = require_reusify();
|
|
4373
4282
|
function fastqueue(context, worker, _concurrency) {
|
|
@@ -4623,9 +4532,6 @@ var require_queue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4623
4532
|
module.exports = fastqueue;
|
|
4624
4533
|
module.exports.promise = queueAsPromised;
|
|
4625
4534
|
}));
|
|
4626
|
-
|
|
4627
|
-
//#endregion
|
|
4628
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js
|
|
4629
4535
|
var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4630
4536
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4631
4537
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
@@ -4652,9 +4558,6 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4652
4558
|
}
|
|
4653
4559
|
exports.joinPathSegments = joinPathSegments;
|
|
4654
4560
|
}));
|
|
4655
|
-
|
|
4656
|
-
//#endregion
|
|
4657
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js
|
|
4658
4561
|
var require_reader$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4659
4562
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4660
4563
|
const common = require_common();
|
|
@@ -4667,9 +4570,6 @@ var require_reader$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4667
4570
|
};
|
|
4668
4571
|
exports.default = Reader;
|
|
4669
4572
|
}));
|
|
4670
|
-
|
|
4671
|
-
//#endregion
|
|
4672
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js
|
|
4673
4573
|
var require_async$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4674
4574
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4675
4575
|
const events_1 = __require("events");
|
|
@@ -4753,9 +4653,6 @@ var require_async$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4753
4653
|
};
|
|
4754
4654
|
exports.default = AsyncReader;
|
|
4755
4655
|
}));
|
|
4756
|
-
|
|
4757
|
-
//#endregion
|
|
4758
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js
|
|
4759
4656
|
var require_async$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4760
4657
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4761
4658
|
const async_1 = require_async$3();
|
|
@@ -4787,9 +4684,6 @@ var require_async$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4787
4684
|
callback(null, entries);
|
|
4788
4685
|
}
|
|
4789
4686
|
}));
|
|
4790
|
-
|
|
4791
|
-
//#endregion
|
|
4792
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js
|
|
4793
4687
|
var require_stream$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4794
4688
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4795
4689
|
const stream_1$2 = __require("stream");
|
|
@@ -4823,9 +4717,6 @@ var require_stream$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4823
4717
|
};
|
|
4824
4718
|
exports.default = StreamProvider;
|
|
4825
4719
|
}));
|
|
4826
|
-
|
|
4827
|
-
//#endregion
|
|
4828
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js
|
|
4829
4720
|
var require_sync$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4830
4721
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4831
4722
|
const fsScandir = require_out$2();
|
|
@@ -4876,9 +4767,6 @@ var require_sync$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4876
4767
|
};
|
|
4877
4768
|
exports.default = SyncReader;
|
|
4878
4769
|
}));
|
|
4879
|
-
|
|
4880
|
-
//#endregion
|
|
4881
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js
|
|
4882
4770
|
var require_sync$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4883
4771
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4884
4772
|
const sync_1 = require_sync$3();
|
|
@@ -4894,9 +4782,6 @@ var require_sync$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4894
4782
|
};
|
|
4895
4783
|
exports.default = SyncProvider;
|
|
4896
4784
|
}));
|
|
4897
|
-
|
|
4898
|
-
//#endregion
|
|
4899
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js
|
|
4900
4785
|
var require_settings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4901
4786
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4902
4787
|
const path$3 = __require("path");
|
|
@@ -4924,9 +4809,6 @@ var require_settings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4924
4809
|
};
|
|
4925
4810
|
exports.default = Settings;
|
|
4926
4811
|
}));
|
|
4927
|
-
|
|
4928
|
-
//#endregion
|
|
4929
|
-
//#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js
|
|
4930
4812
|
var require_out$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4931
4813
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4932
4814
|
exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
|
|
@@ -4958,9 +4840,6 @@ var require_out$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4958
4840
|
return new settings_1.default(settingsOrOptions);
|
|
4959
4841
|
}
|
|
4960
4842
|
}));
|
|
4961
|
-
|
|
4962
|
-
//#endregion
|
|
4963
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js
|
|
4964
4843
|
var require_reader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4965
4844
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4966
4845
|
const path$2 = __require("path");
|
|
@@ -4993,9 +4872,6 @@ var require_reader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4993
4872
|
};
|
|
4994
4873
|
exports.default = Reader;
|
|
4995
4874
|
}));
|
|
4996
|
-
|
|
4997
|
-
//#endregion
|
|
4998
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js
|
|
4999
4875
|
var require_stream$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5000
4876
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5001
4877
|
const stream_1$1 = __require("stream");
|
|
@@ -5040,9 +4916,6 @@ var require_stream$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5040
4916
|
};
|
|
5041
4917
|
exports.default = ReaderStream;
|
|
5042
4918
|
}));
|
|
5043
|
-
|
|
5044
|
-
//#endregion
|
|
5045
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js
|
|
5046
4919
|
var require_async$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5047
4920
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5048
4921
|
const fsWalk = require_out$1();
|
|
@@ -5074,9 +4947,6 @@ var require_async$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5074
4947
|
};
|
|
5075
4948
|
exports.default = ReaderAsync;
|
|
5076
4949
|
}));
|
|
5077
|
-
|
|
5078
|
-
//#endregion
|
|
5079
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js
|
|
5080
4950
|
var require_matcher = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5081
4951
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5082
4952
|
const utils = require_utils$1();
|
|
@@ -5119,9 +4989,6 @@ var require_matcher = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5119
4989
|
};
|
|
5120
4990
|
exports.default = Matcher;
|
|
5121
4991
|
}));
|
|
5122
|
-
|
|
5123
|
-
//#endregion
|
|
5124
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js
|
|
5125
4992
|
var require_partial = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5126
4993
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5127
4994
|
const matcher_1 = require_matcher();
|
|
@@ -5152,9 +5019,6 @@ var require_partial = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5152
5019
|
};
|
|
5153
5020
|
exports.default = PartialMatcher;
|
|
5154
5021
|
}));
|
|
5155
|
-
|
|
5156
|
-
//#endregion
|
|
5157
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js
|
|
5158
5022
|
var require_deep = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5159
5023
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5160
5024
|
const utils = require_utils$1();
|
|
@@ -5207,9 +5071,6 @@ var require_deep = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5207
5071
|
};
|
|
5208
5072
|
exports.default = DeepFilter;
|
|
5209
5073
|
}));
|
|
5210
|
-
|
|
5211
|
-
//#endregion
|
|
5212
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js
|
|
5213
5074
|
var require_entry$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5214
5075
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5215
5076
|
const utils = require_utils$1();
|
|
@@ -5270,9 +5131,6 @@ var require_entry$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5270
5131
|
};
|
|
5271
5132
|
exports.default = EntryFilter;
|
|
5272
5133
|
}));
|
|
5273
|
-
|
|
5274
|
-
//#endregion
|
|
5275
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js
|
|
5276
5134
|
var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5277
5135
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5278
5136
|
const utils = require_utils$1();
|
|
@@ -5289,9 +5147,6 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5289
5147
|
};
|
|
5290
5148
|
exports.default = ErrorFilter;
|
|
5291
5149
|
}));
|
|
5292
|
-
|
|
5293
|
-
//#endregion
|
|
5294
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js
|
|
5295
5150
|
var require_entry = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5296
5151
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5297
5152
|
const utils = require_utils$1();
|
|
@@ -5315,9 +5170,6 @@ var require_entry = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5315
5170
|
};
|
|
5316
5171
|
exports.default = EntryTransformer;
|
|
5317
5172
|
}));
|
|
5318
|
-
|
|
5319
|
-
//#endregion
|
|
5320
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js
|
|
5321
5173
|
var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5322
5174
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5323
5175
|
const path$1 = __require("path");
|
|
@@ -5367,9 +5219,6 @@ var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5367
5219
|
};
|
|
5368
5220
|
exports.default = Provider;
|
|
5369
5221
|
}));
|
|
5370
|
-
|
|
5371
|
-
//#endregion
|
|
5372
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js
|
|
5373
5222
|
var require_async = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5374
5223
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5375
5224
|
const async_1 = require_async$1();
|
|
@@ -5391,9 +5240,6 @@ var require_async = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5391
5240
|
};
|
|
5392
5241
|
exports.default = ProviderAsync;
|
|
5393
5242
|
}));
|
|
5394
|
-
|
|
5395
|
-
//#endregion
|
|
5396
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js
|
|
5397
5243
|
var require_stream = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5398
5244
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5399
5245
|
const stream_1 = __require("stream");
|
|
@@ -5423,9 +5269,6 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5423
5269
|
};
|
|
5424
5270
|
exports.default = ProviderStream;
|
|
5425
5271
|
}));
|
|
5426
|
-
|
|
5427
|
-
//#endregion
|
|
5428
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js
|
|
5429
5272
|
var require_sync$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5430
5273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5431
5274
|
const fsStat = require_out$3();
|
|
@@ -5465,9 +5308,6 @@ var require_sync$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5465
5308
|
};
|
|
5466
5309
|
exports.default = ReaderSync;
|
|
5467
5310
|
}));
|
|
5468
|
-
|
|
5469
|
-
//#endregion
|
|
5470
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js
|
|
5471
5311
|
var require_sync = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5472
5312
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5473
5313
|
const sync_1 = require_sync$1();
|
|
@@ -5489,9 +5329,6 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5489
5329
|
};
|
|
5490
5330
|
exports.default = ProviderSync;
|
|
5491
5331
|
}));
|
|
5492
|
-
|
|
5493
|
-
//#endregion
|
|
5494
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js
|
|
5495
5332
|
var require_settings = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5496
5333
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5497
5334
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
@@ -5547,9 +5384,6 @@ var require_settings = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5547
5384
|
};
|
|
5548
5385
|
exports.default = Settings;
|
|
5549
5386
|
}));
|
|
5550
|
-
|
|
5551
|
-
//#endregion
|
|
5552
|
-
//#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/index.js
|
|
5553
5387
|
var require_out = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5554
5388
|
const taskManager = require_tasks();
|
|
5555
5389
|
const async_1 = require_async();
|
|
@@ -5645,9 +5479,2035 @@ var require_out = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5645
5479
|
}
|
|
5646
5480
|
module.exports = FastGlob;
|
|
5647
5481
|
}));
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5482
|
+
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
5483
|
+
function isNothing(subject) {
|
|
5484
|
+
return typeof subject === "undefined" || subject === null;
|
|
5485
|
+
}
|
|
5486
|
+
function isObject(subject) {
|
|
5487
|
+
return typeof subject === "object" && subject !== null;
|
|
5488
|
+
}
|
|
5489
|
+
function toArray(sequence) {
|
|
5490
|
+
if (Array.isArray(sequence)) return sequence;
|
|
5491
|
+
else if (isNothing(sequence)) return [];
|
|
5492
|
+
return [sequence];
|
|
5493
|
+
}
|
|
5494
|
+
function extend(target, source) {
|
|
5495
|
+
var index, length, key, sourceKeys;
|
|
5496
|
+
if (source) {
|
|
5497
|
+
sourceKeys = Object.keys(source);
|
|
5498
|
+
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
5499
|
+
key = sourceKeys[index];
|
|
5500
|
+
target[key] = source[key];
|
|
5501
|
+
}
|
|
5502
|
+
}
|
|
5503
|
+
return target;
|
|
5504
|
+
}
|
|
5505
|
+
function repeat(string, count) {
|
|
5506
|
+
var result = "", cycle;
|
|
5507
|
+
for (cycle = 0; cycle < count; cycle += 1) result += string;
|
|
5508
|
+
return result;
|
|
5509
|
+
}
|
|
5510
|
+
function isNegativeZero(number) {
|
|
5511
|
+
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
5512
|
+
}
|
|
5513
|
+
var common = {
|
|
5514
|
+
isNothing,
|
|
5515
|
+
isObject,
|
|
5516
|
+
toArray,
|
|
5517
|
+
repeat,
|
|
5518
|
+
isNegativeZero,
|
|
5519
|
+
extend
|
|
5520
|
+
};
|
|
5521
|
+
function formatError(exception, compact) {
|
|
5522
|
+
var where = "", message = exception.reason || "(unknown reason)";
|
|
5523
|
+
if (!exception.mark) return message;
|
|
5524
|
+
if (exception.mark.name) where += "in \"" + exception.mark.name + "\" ";
|
|
5525
|
+
where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")";
|
|
5526
|
+
if (!compact && exception.mark.snippet) where += "\n\n" + exception.mark.snippet;
|
|
5527
|
+
return message + " " + where;
|
|
5528
|
+
}
|
|
5529
|
+
function YAMLException$1(reason, mark) {
|
|
5530
|
+
Error.call(this);
|
|
5531
|
+
this.name = "YAMLException";
|
|
5532
|
+
this.reason = reason;
|
|
5533
|
+
this.mark = mark;
|
|
5534
|
+
this.message = formatError(this, false);
|
|
5535
|
+
if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
|
|
5536
|
+
else this.stack = (/* @__PURE__ */ new Error()).stack || "";
|
|
5537
|
+
}
|
|
5538
|
+
YAMLException$1.prototype = Object.create(Error.prototype);
|
|
5539
|
+
YAMLException$1.prototype.constructor = YAMLException$1;
|
|
5540
|
+
YAMLException$1.prototype.toString = function toString(compact) {
|
|
5541
|
+
return this.name + ": " + formatError(this, compact);
|
|
5542
|
+
};
|
|
5543
|
+
var exception = YAMLException$1;
|
|
5544
|
+
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
5545
|
+
var head = "";
|
|
5546
|
+
var tail = "";
|
|
5547
|
+
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
5548
|
+
if (position - lineStart > maxHalfLength) {
|
|
5549
|
+
head = " ... ";
|
|
5550
|
+
lineStart = position - maxHalfLength + head.length;
|
|
5551
|
+
}
|
|
5552
|
+
if (lineEnd - position > maxHalfLength) {
|
|
5553
|
+
tail = " ...";
|
|
5554
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
5555
|
+
}
|
|
5556
|
+
return {
|
|
5557
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
|
|
5558
|
+
pos: position - lineStart + head.length
|
|
5559
|
+
};
|
|
5560
|
+
}
|
|
5561
|
+
function padStart(string, max) {
|
|
5562
|
+
return common.repeat(" ", max - string.length) + string;
|
|
5563
|
+
}
|
|
5564
|
+
function makeSnippet(mark, options) {
|
|
5565
|
+
options = Object.create(options || null);
|
|
5566
|
+
if (!mark.buffer) return null;
|
|
5567
|
+
if (!options.maxLength) options.maxLength = 79;
|
|
5568
|
+
if (typeof options.indent !== "number") options.indent = 1;
|
|
5569
|
+
if (typeof options.linesBefore !== "number") options.linesBefore = 3;
|
|
5570
|
+
if (typeof options.linesAfter !== "number") options.linesAfter = 2;
|
|
5571
|
+
var re = /\r?\n|\r|\0/g;
|
|
5572
|
+
var lineStarts = [0];
|
|
5573
|
+
var lineEnds = [];
|
|
5574
|
+
var match;
|
|
5575
|
+
var foundLineNo = -1;
|
|
5576
|
+
while (match = re.exec(mark.buffer)) {
|
|
5577
|
+
lineEnds.push(match.index);
|
|
5578
|
+
lineStarts.push(match.index + match[0].length);
|
|
5579
|
+
if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2;
|
|
5580
|
+
}
|
|
5581
|
+
if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
|
|
5582
|
+
var result = "", i, line;
|
|
5583
|
+
var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
5584
|
+
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
5585
|
+
for (i = 1; i <= options.linesBefore; i++) {
|
|
5586
|
+
if (foundLineNo - i < 0) break;
|
|
5587
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
5588
|
+
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
|
5589
|
+
}
|
|
5590
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
5591
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
5592
|
+
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
5593
|
+
for (i = 1; i <= options.linesAfter; i++) {
|
|
5594
|
+
if (foundLineNo + i >= lineEnds.length) break;
|
|
5595
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
5596
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
5597
|
+
}
|
|
5598
|
+
return result.replace(/\n$/, "");
|
|
5599
|
+
}
|
|
5600
|
+
var snippet = makeSnippet;
|
|
5601
|
+
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
5602
|
+
"kind",
|
|
5603
|
+
"multi",
|
|
5604
|
+
"resolve",
|
|
5605
|
+
"construct",
|
|
5606
|
+
"instanceOf",
|
|
5607
|
+
"predicate",
|
|
5608
|
+
"represent",
|
|
5609
|
+
"representName",
|
|
5610
|
+
"defaultStyle",
|
|
5611
|
+
"styleAliases"
|
|
5612
|
+
];
|
|
5613
|
+
var YAML_NODE_KINDS = [
|
|
5614
|
+
"scalar",
|
|
5615
|
+
"sequence",
|
|
5616
|
+
"mapping"
|
|
5617
|
+
];
|
|
5618
|
+
function compileStyleAliases(map) {
|
|
5619
|
+
var result = {};
|
|
5620
|
+
if (map !== null) Object.keys(map).forEach(function(style) {
|
|
5621
|
+
map[style].forEach(function(alias) {
|
|
5622
|
+
result[String(alias)] = style;
|
|
5623
|
+
});
|
|
5624
|
+
});
|
|
5625
|
+
return result;
|
|
5626
|
+
}
|
|
5627
|
+
function Type$1(tag, options) {
|
|
5628
|
+
options = options || {};
|
|
5629
|
+
Object.keys(options).forEach(function(name) {
|
|
5630
|
+
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) throw new exception("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type.");
|
|
5631
|
+
});
|
|
5632
|
+
this.options = options;
|
|
5633
|
+
this.tag = tag;
|
|
5634
|
+
this.kind = options["kind"] || null;
|
|
5635
|
+
this.resolve = options["resolve"] || function() {
|
|
5636
|
+
return true;
|
|
5637
|
+
};
|
|
5638
|
+
this.construct = options["construct"] || function(data) {
|
|
5639
|
+
return data;
|
|
5640
|
+
};
|
|
5641
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
5642
|
+
this.predicate = options["predicate"] || null;
|
|
5643
|
+
this.represent = options["represent"] || null;
|
|
5644
|
+
this.representName = options["representName"] || null;
|
|
5645
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
5646
|
+
this.multi = options["multi"] || false;
|
|
5647
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
5648
|
+
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) throw new exception("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type.");
|
|
5649
|
+
}
|
|
5650
|
+
var type = Type$1;
|
|
5651
|
+
function compileList(schema, name) {
|
|
5652
|
+
var result = [];
|
|
5653
|
+
schema[name].forEach(function(currentType) {
|
|
5654
|
+
var newIndex = result.length;
|
|
5655
|
+
result.forEach(function(previousType, previousIndex) {
|
|
5656
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex;
|
|
5657
|
+
});
|
|
5658
|
+
result[newIndex] = currentType;
|
|
5659
|
+
});
|
|
5660
|
+
return result;
|
|
5661
|
+
}
|
|
5662
|
+
function compileMap() {
|
|
5663
|
+
var result = {
|
|
5664
|
+
scalar: {},
|
|
5665
|
+
sequence: {},
|
|
5666
|
+
mapping: {},
|
|
5667
|
+
fallback: {},
|
|
5668
|
+
multi: {
|
|
5669
|
+
scalar: [],
|
|
5670
|
+
sequence: [],
|
|
5671
|
+
mapping: [],
|
|
5672
|
+
fallback: []
|
|
5673
|
+
}
|
|
5674
|
+
}, index, length;
|
|
5675
|
+
function collectType(type) {
|
|
5676
|
+
if (type.multi) {
|
|
5677
|
+
result.multi[type.kind].push(type);
|
|
5678
|
+
result.multi["fallback"].push(type);
|
|
5679
|
+
} else result[type.kind][type.tag] = result["fallback"][type.tag] = type;
|
|
5680
|
+
}
|
|
5681
|
+
for (index = 0, length = arguments.length; index < length; index += 1) arguments[index].forEach(collectType);
|
|
5682
|
+
return result;
|
|
5683
|
+
}
|
|
5684
|
+
function Schema$1(definition) {
|
|
5685
|
+
return this.extend(definition);
|
|
5686
|
+
}
|
|
5687
|
+
Schema$1.prototype.extend = function extend(definition) {
|
|
5688
|
+
var implicit = [];
|
|
5689
|
+
var explicit = [];
|
|
5690
|
+
if (definition instanceof type) explicit.push(definition);
|
|
5691
|
+
else if (Array.isArray(definition)) explicit = explicit.concat(definition);
|
|
5692
|
+
else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
5693
|
+
if (definition.implicit) implicit = implicit.concat(definition.implicit);
|
|
5694
|
+
if (definition.explicit) explicit = explicit.concat(definition.explicit);
|
|
5695
|
+
} else throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
5696
|
+
implicit.forEach(function(type$1) {
|
|
5697
|
+
if (!(type$1 instanceof type)) throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
5698
|
+
if (type$1.loadKind && type$1.loadKind !== "scalar") throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
5699
|
+
if (type$1.multi) throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
5700
|
+
});
|
|
5701
|
+
explicit.forEach(function(type$1) {
|
|
5702
|
+
if (!(type$1 instanceof type)) throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
5703
|
+
});
|
|
5704
|
+
var result = Object.create(Schema$1.prototype);
|
|
5705
|
+
result.implicit = (this.implicit || []).concat(implicit);
|
|
5706
|
+
result.explicit = (this.explicit || []).concat(explicit);
|
|
5707
|
+
result.compiledImplicit = compileList(result, "implicit");
|
|
5708
|
+
result.compiledExplicit = compileList(result, "explicit");
|
|
5709
|
+
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
5710
|
+
return result;
|
|
5711
|
+
};
|
|
5712
|
+
var failsafe = new Schema$1({ explicit: [
|
|
5713
|
+
new type("tag:yaml.org,2002:str", {
|
|
5714
|
+
kind: "scalar",
|
|
5715
|
+
construct: function(data) {
|
|
5716
|
+
return data !== null ? data : "";
|
|
5717
|
+
}
|
|
5718
|
+
}),
|
|
5719
|
+
new type("tag:yaml.org,2002:seq", {
|
|
5720
|
+
kind: "sequence",
|
|
5721
|
+
construct: function(data) {
|
|
5722
|
+
return data !== null ? data : [];
|
|
5723
|
+
}
|
|
5724
|
+
}),
|
|
5725
|
+
new type("tag:yaml.org,2002:map", {
|
|
5726
|
+
kind: "mapping",
|
|
5727
|
+
construct: function(data) {
|
|
5728
|
+
return data !== null ? data : {};
|
|
5729
|
+
}
|
|
5730
|
+
})
|
|
5731
|
+
] });
|
|
5732
|
+
function resolveYamlNull(data) {
|
|
5733
|
+
if (data === null) return true;
|
|
5734
|
+
var max = data.length;
|
|
5735
|
+
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
5736
|
+
}
|
|
5737
|
+
function constructYamlNull() {
|
|
5738
|
+
return null;
|
|
5739
|
+
}
|
|
5740
|
+
function isNull(object) {
|
|
5741
|
+
return object === null;
|
|
5742
|
+
}
|
|
5743
|
+
var _null = new type("tag:yaml.org,2002:null", {
|
|
5744
|
+
kind: "scalar",
|
|
5745
|
+
resolve: resolveYamlNull,
|
|
5746
|
+
construct: constructYamlNull,
|
|
5747
|
+
predicate: isNull,
|
|
5748
|
+
represent: {
|
|
5749
|
+
canonical: function() {
|
|
5750
|
+
return "~";
|
|
5751
|
+
},
|
|
5752
|
+
lowercase: function() {
|
|
5753
|
+
return "null";
|
|
5754
|
+
},
|
|
5755
|
+
uppercase: function() {
|
|
5756
|
+
return "NULL";
|
|
5757
|
+
},
|
|
5758
|
+
camelcase: function() {
|
|
5759
|
+
return "Null";
|
|
5760
|
+
},
|
|
5761
|
+
empty: function() {
|
|
5762
|
+
return "";
|
|
5763
|
+
}
|
|
5764
|
+
},
|
|
5765
|
+
defaultStyle: "lowercase"
|
|
5766
|
+
});
|
|
5767
|
+
function resolveYamlBoolean(data) {
|
|
5768
|
+
if (data === null) return false;
|
|
5769
|
+
var max = data.length;
|
|
5770
|
+
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
5771
|
+
}
|
|
5772
|
+
function constructYamlBoolean(data) {
|
|
5773
|
+
return data === "true" || data === "True" || data === "TRUE";
|
|
5774
|
+
}
|
|
5775
|
+
function isBoolean(object) {
|
|
5776
|
+
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
5777
|
+
}
|
|
5778
|
+
var bool = new type("tag:yaml.org,2002:bool", {
|
|
5779
|
+
kind: "scalar",
|
|
5780
|
+
resolve: resolveYamlBoolean,
|
|
5781
|
+
construct: constructYamlBoolean,
|
|
5782
|
+
predicate: isBoolean,
|
|
5783
|
+
represent: {
|
|
5784
|
+
lowercase: function(object) {
|
|
5785
|
+
return object ? "true" : "false";
|
|
5786
|
+
},
|
|
5787
|
+
uppercase: function(object) {
|
|
5788
|
+
return object ? "TRUE" : "FALSE";
|
|
5789
|
+
},
|
|
5790
|
+
camelcase: function(object) {
|
|
5791
|
+
return object ? "True" : "False";
|
|
5792
|
+
}
|
|
5793
|
+
},
|
|
5794
|
+
defaultStyle: "lowercase"
|
|
5795
|
+
});
|
|
5796
|
+
function isHexCode(c) {
|
|
5797
|
+
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
5798
|
+
}
|
|
5799
|
+
function isOctCode(c) {
|
|
5800
|
+
return 48 <= c && c <= 55;
|
|
5801
|
+
}
|
|
5802
|
+
function isDecCode(c) {
|
|
5803
|
+
return 48 <= c && c <= 57;
|
|
5804
|
+
}
|
|
5805
|
+
function resolveYamlInteger(data) {
|
|
5806
|
+
if (data === null) return false;
|
|
5807
|
+
var max = data.length, index = 0, hasDigits = false, ch;
|
|
5808
|
+
if (!max) return false;
|
|
5809
|
+
ch = data[index];
|
|
5810
|
+
if (ch === "-" || ch === "+") ch = data[++index];
|
|
5811
|
+
if (ch === "0") {
|
|
5812
|
+
if (index + 1 === max) return true;
|
|
5813
|
+
ch = data[++index];
|
|
5814
|
+
if (ch === "b") {
|
|
5815
|
+
index++;
|
|
5816
|
+
for (; index < max; index++) {
|
|
5817
|
+
ch = data[index];
|
|
5818
|
+
if (ch === "_") continue;
|
|
5819
|
+
if (ch !== "0" && ch !== "1") return false;
|
|
5820
|
+
hasDigits = true;
|
|
5821
|
+
}
|
|
5822
|
+
return hasDigits && ch !== "_";
|
|
5823
|
+
}
|
|
5824
|
+
if (ch === "x") {
|
|
5825
|
+
index++;
|
|
5826
|
+
for (; index < max; index++) {
|
|
5827
|
+
ch = data[index];
|
|
5828
|
+
if (ch === "_") continue;
|
|
5829
|
+
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
5830
|
+
hasDigits = true;
|
|
5831
|
+
}
|
|
5832
|
+
return hasDigits && ch !== "_";
|
|
5833
|
+
}
|
|
5834
|
+
if (ch === "o") {
|
|
5835
|
+
index++;
|
|
5836
|
+
for (; index < max; index++) {
|
|
5837
|
+
ch = data[index];
|
|
5838
|
+
if (ch === "_") continue;
|
|
5839
|
+
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
5840
|
+
hasDigits = true;
|
|
5841
|
+
}
|
|
5842
|
+
return hasDigits && ch !== "_";
|
|
5843
|
+
}
|
|
5844
|
+
}
|
|
5845
|
+
if (ch === "_") return false;
|
|
5846
|
+
for (; index < max; index++) {
|
|
5847
|
+
ch = data[index];
|
|
5848
|
+
if (ch === "_") continue;
|
|
5849
|
+
if (!isDecCode(data.charCodeAt(index))) return false;
|
|
5850
|
+
hasDigits = true;
|
|
5851
|
+
}
|
|
5852
|
+
if (!hasDigits || ch === "_") return false;
|
|
5853
|
+
return true;
|
|
5854
|
+
}
|
|
5855
|
+
function constructYamlInteger(data) {
|
|
5856
|
+
var value = data, sign = 1, ch;
|
|
5857
|
+
if (value.indexOf("_") !== -1) value = value.replace(/_/g, "");
|
|
5858
|
+
ch = value[0];
|
|
5859
|
+
if (ch === "-" || ch === "+") {
|
|
5860
|
+
if (ch === "-") sign = -1;
|
|
5861
|
+
value = value.slice(1);
|
|
5862
|
+
ch = value[0];
|
|
5863
|
+
}
|
|
5864
|
+
if (value === "0") return 0;
|
|
5865
|
+
if (ch === "0") {
|
|
5866
|
+
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
|
|
5867
|
+
if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
|
|
5868
|
+
if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
|
|
5869
|
+
}
|
|
5870
|
+
return sign * parseInt(value, 10);
|
|
5871
|
+
}
|
|
5872
|
+
function isInteger(object) {
|
|
5873
|
+
return Object.prototype.toString.call(object) === "[object Number]" && object % 1 === 0 && !common.isNegativeZero(object);
|
|
5874
|
+
}
|
|
5875
|
+
var int = new type("tag:yaml.org,2002:int", {
|
|
5876
|
+
kind: "scalar",
|
|
5877
|
+
resolve: resolveYamlInteger,
|
|
5878
|
+
construct: constructYamlInteger,
|
|
5879
|
+
predicate: isInteger,
|
|
5880
|
+
represent: {
|
|
5881
|
+
binary: function(obj) {
|
|
5882
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
5883
|
+
},
|
|
5884
|
+
octal: function(obj) {
|
|
5885
|
+
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
5886
|
+
},
|
|
5887
|
+
decimal: function(obj) {
|
|
5888
|
+
return obj.toString(10);
|
|
5889
|
+
},
|
|
5890
|
+
hexadecimal: function(obj) {
|
|
5891
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
5892
|
+
}
|
|
5893
|
+
},
|
|
5894
|
+
defaultStyle: "decimal",
|
|
5895
|
+
styleAliases: {
|
|
5896
|
+
binary: [2, "bin"],
|
|
5897
|
+
octal: [8, "oct"],
|
|
5898
|
+
decimal: [10, "dec"],
|
|
5899
|
+
hexadecimal: [16, "hex"]
|
|
5900
|
+
}
|
|
5901
|
+
});
|
|
5902
|
+
var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
5903
|
+
function resolveYamlFloat(data) {
|
|
5904
|
+
if (data === null) return false;
|
|
5905
|
+
if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") return false;
|
|
5906
|
+
return true;
|
|
5907
|
+
}
|
|
5908
|
+
function constructYamlFloat(data) {
|
|
5909
|
+
var value = data.replace(/_/g, "").toLowerCase(), sign = value[0] === "-" ? -1 : 1;
|
|
5910
|
+
if ("+-".indexOf(value[0]) >= 0) value = value.slice(1);
|
|
5911
|
+
if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
5912
|
+
else if (value === ".nan") return NaN;
|
|
5913
|
+
return sign * parseFloat(value, 10);
|
|
5914
|
+
}
|
|
5915
|
+
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
5916
|
+
function representYamlFloat(object, style) {
|
|
5917
|
+
var res;
|
|
5918
|
+
if (isNaN(object)) switch (style) {
|
|
5919
|
+
case "lowercase": return ".nan";
|
|
5920
|
+
case "uppercase": return ".NAN";
|
|
5921
|
+
case "camelcase": return ".NaN";
|
|
5922
|
+
}
|
|
5923
|
+
else if (Number.POSITIVE_INFINITY === object) switch (style) {
|
|
5924
|
+
case "lowercase": return ".inf";
|
|
5925
|
+
case "uppercase": return ".INF";
|
|
5926
|
+
case "camelcase": return ".Inf";
|
|
5927
|
+
}
|
|
5928
|
+
else if (Number.NEGATIVE_INFINITY === object) switch (style) {
|
|
5929
|
+
case "lowercase": return "-.inf";
|
|
5930
|
+
case "uppercase": return "-.INF";
|
|
5931
|
+
case "camelcase": return "-.Inf";
|
|
5932
|
+
}
|
|
5933
|
+
else if (common.isNegativeZero(object)) return "-0.0";
|
|
5934
|
+
res = object.toString(10);
|
|
5935
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
5936
|
+
}
|
|
5937
|
+
function isFloat(object) {
|
|
5938
|
+
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
5939
|
+
}
|
|
5940
|
+
var float = new type("tag:yaml.org,2002:float", {
|
|
5941
|
+
kind: "scalar",
|
|
5942
|
+
resolve: resolveYamlFloat,
|
|
5943
|
+
construct: constructYamlFloat,
|
|
5944
|
+
predicate: isFloat,
|
|
5945
|
+
represent: representYamlFloat,
|
|
5946
|
+
defaultStyle: "lowercase"
|
|
5947
|
+
});
|
|
5948
|
+
var core = failsafe.extend({ implicit: [
|
|
5949
|
+
_null,
|
|
5950
|
+
bool,
|
|
5951
|
+
int,
|
|
5952
|
+
float
|
|
5953
|
+
] });
|
|
5954
|
+
var YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
5955
|
+
var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
5956
|
+
function resolveYamlTimestamp(data) {
|
|
5957
|
+
if (data === null) return false;
|
|
5958
|
+
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
|
5959
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
|
5960
|
+
return false;
|
|
5961
|
+
}
|
|
5962
|
+
function constructYamlTimestamp(data) {
|
|
5963
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
5964
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
5965
|
+
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
5966
|
+
if (match === null) throw new Error("Date resolve error");
|
|
5967
|
+
year = +match[1];
|
|
5968
|
+
month = +match[2] - 1;
|
|
5969
|
+
day = +match[3];
|
|
5970
|
+
if (!match[4]) return new Date(Date.UTC(year, month, day));
|
|
5971
|
+
hour = +match[4];
|
|
5972
|
+
minute = +match[5];
|
|
5973
|
+
second = +match[6];
|
|
5974
|
+
if (match[7]) {
|
|
5975
|
+
fraction = match[7].slice(0, 3);
|
|
5976
|
+
while (fraction.length < 3) fraction += "0";
|
|
5977
|
+
fraction = +fraction;
|
|
5978
|
+
}
|
|
5979
|
+
if (match[9]) {
|
|
5980
|
+
tz_hour = +match[10];
|
|
5981
|
+
tz_minute = +(match[11] || 0);
|
|
5982
|
+
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
5983
|
+
if (match[9] === "-") delta = -delta;
|
|
5984
|
+
}
|
|
5985
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
5986
|
+
if (delta) date.setTime(date.getTime() - delta);
|
|
5987
|
+
return date;
|
|
5988
|
+
}
|
|
5989
|
+
function representYamlTimestamp(object) {
|
|
5990
|
+
return object.toISOString();
|
|
5991
|
+
}
|
|
5992
|
+
var timestamp = new type("tag:yaml.org,2002:timestamp", {
|
|
5993
|
+
kind: "scalar",
|
|
5994
|
+
resolve: resolveYamlTimestamp,
|
|
5995
|
+
construct: constructYamlTimestamp,
|
|
5996
|
+
instanceOf: Date,
|
|
5997
|
+
represent: representYamlTimestamp
|
|
5998
|
+
});
|
|
5999
|
+
function resolveYamlMerge(data) {
|
|
6000
|
+
return data === "<<" || data === null;
|
|
6001
|
+
}
|
|
6002
|
+
var merge = new type("tag:yaml.org,2002:merge", {
|
|
6003
|
+
kind: "scalar",
|
|
6004
|
+
resolve: resolveYamlMerge
|
|
6005
|
+
});
|
|
6006
|
+
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
6007
|
+
function resolveYamlBinary(data) {
|
|
6008
|
+
if (data === null) return false;
|
|
6009
|
+
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
|
6010
|
+
for (idx = 0; idx < max; idx++) {
|
|
6011
|
+
code = map.indexOf(data.charAt(idx));
|
|
6012
|
+
if (code > 64) continue;
|
|
6013
|
+
if (code < 0) return false;
|
|
6014
|
+
bitlen += 6;
|
|
6015
|
+
}
|
|
6016
|
+
return bitlen % 8 === 0;
|
|
6017
|
+
}
|
|
6018
|
+
function constructYamlBinary(data) {
|
|
6019
|
+
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
|
|
6020
|
+
for (idx = 0; idx < max; idx++) {
|
|
6021
|
+
if (idx % 4 === 0 && idx) {
|
|
6022
|
+
result.push(bits >> 16 & 255);
|
|
6023
|
+
result.push(bits >> 8 & 255);
|
|
6024
|
+
result.push(bits & 255);
|
|
6025
|
+
}
|
|
6026
|
+
bits = bits << 6 | map.indexOf(input.charAt(idx));
|
|
6027
|
+
}
|
|
6028
|
+
tailbits = max % 4 * 6;
|
|
6029
|
+
if (tailbits === 0) {
|
|
6030
|
+
result.push(bits >> 16 & 255);
|
|
6031
|
+
result.push(bits >> 8 & 255);
|
|
6032
|
+
result.push(bits & 255);
|
|
6033
|
+
} else if (tailbits === 18) {
|
|
6034
|
+
result.push(bits >> 10 & 255);
|
|
6035
|
+
result.push(bits >> 2 & 255);
|
|
6036
|
+
} else if (tailbits === 12) result.push(bits >> 4 & 255);
|
|
6037
|
+
return new Uint8Array(result);
|
|
6038
|
+
}
|
|
6039
|
+
function representYamlBinary(object) {
|
|
6040
|
+
var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
|
|
6041
|
+
for (idx = 0; idx < max; idx++) {
|
|
6042
|
+
if (idx % 3 === 0 && idx) {
|
|
6043
|
+
result += map[bits >> 18 & 63];
|
|
6044
|
+
result += map[bits >> 12 & 63];
|
|
6045
|
+
result += map[bits >> 6 & 63];
|
|
6046
|
+
result += map[bits & 63];
|
|
6047
|
+
}
|
|
6048
|
+
bits = (bits << 8) + object[idx];
|
|
6049
|
+
}
|
|
6050
|
+
tail = max % 3;
|
|
6051
|
+
if (tail === 0) {
|
|
6052
|
+
result += map[bits >> 18 & 63];
|
|
6053
|
+
result += map[bits >> 12 & 63];
|
|
6054
|
+
result += map[bits >> 6 & 63];
|
|
6055
|
+
result += map[bits & 63];
|
|
6056
|
+
} else if (tail === 2) {
|
|
6057
|
+
result += map[bits >> 10 & 63];
|
|
6058
|
+
result += map[bits >> 4 & 63];
|
|
6059
|
+
result += map[bits << 2 & 63];
|
|
6060
|
+
result += map[64];
|
|
6061
|
+
} else if (tail === 1) {
|
|
6062
|
+
result += map[bits >> 2 & 63];
|
|
6063
|
+
result += map[bits << 4 & 63];
|
|
6064
|
+
result += map[64];
|
|
6065
|
+
result += map[64];
|
|
6066
|
+
}
|
|
6067
|
+
return result;
|
|
6068
|
+
}
|
|
6069
|
+
function isBinary(obj) {
|
|
6070
|
+
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
|
6071
|
+
}
|
|
6072
|
+
var binary = new type("tag:yaml.org,2002:binary", {
|
|
6073
|
+
kind: "scalar",
|
|
6074
|
+
resolve: resolveYamlBinary,
|
|
6075
|
+
construct: constructYamlBinary,
|
|
6076
|
+
predicate: isBinary,
|
|
6077
|
+
represent: representYamlBinary
|
|
6078
|
+
});
|
|
6079
|
+
var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
6080
|
+
var _toString$2 = Object.prototype.toString;
|
|
6081
|
+
function resolveYamlOmap(data) {
|
|
6082
|
+
if (data === null) return true;
|
|
6083
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
6084
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
6085
|
+
pair = object[index];
|
|
6086
|
+
pairHasKey = false;
|
|
6087
|
+
if (_toString$2.call(pair) !== "[object Object]") return false;
|
|
6088
|
+
for (pairKey in pair) if (_hasOwnProperty$3.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true;
|
|
6089
|
+
else return false;
|
|
6090
|
+
if (!pairHasKey) return false;
|
|
6091
|
+
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
|
6092
|
+
else return false;
|
|
6093
|
+
}
|
|
6094
|
+
return true;
|
|
6095
|
+
}
|
|
6096
|
+
function constructYamlOmap(data) {
|
|
6097
|
+
return data !== null ? data : [];
|
|
6098
|
+
}
|
|
6099
|
+
var omap = new type("tag:yaml.org,2002:omap", {
|
|
6100
|
+
kind: "sequence",
|
|
6101
|
+
resolve: resolveYamlOmap,
|
|
6102
|
+
construct: constructYamlOmap
|
|
6103
|
+
});
|
|
6104
|
+
var _toString$1 = Object.prototype.toString;
|
|
6105
|
+
function resolveYamlPairs(data) {
|
|
6106
|
+
if (data === null) return true;
|
|
6107
|
+
var index, length, pair, keys, result, object = data;
|
|
6108
|
+
result = new Array(object.length);
|
|
6109
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
6110
|
+
pair = object[index];
|
|
6111
|
+
if (_toString$1.call(pair) !== "[object Object]") return false;
|
|
6112
|
+
keys = Object.keys(pair);
|
|
6113
|
+
if (keys.length !== 1) return false;
|
|
6114
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
6115
|
+
}
|
|
6116
|
+
return true;
|
|
6117
|
+
}
|
|
6118
|
+
function constructYamlPairs(data) {
|
|
6119
|
+
if (data === null) return [];
|
|
6120
|
+
var index, length, pair, keys, result, object = data;
|
|
6121
|
+
result = new Array(object.length);
|
|
6122
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
6123
|
+
pair = object[index];
|
|
6124
|
+
keys = Object.keys(pair);
|
|
6125
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
6126
|
+
}
|
|
6127
|
+
return result;
|
|
6128
|
+
}
|
|
6129
|
+
var pairs = new type("tag:yaml.org,2002:pairs", {
|
|
6130
|
+
kind: "sequence",
|
|
6131
|
+
resolve: resolveYamlPairs,
|
|
6132
|
+
construct: constructYamlPairs
|
|
6133
|
+
});
|
|
6134
|
+
var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
6135
|
+
function resolveYamlSet(data) {
|
|
6136
|
+
if (data === null) return true;
|
|
6137
|
+
var key, object = data;
|
|
6138
|
+
for (key in object) if (_hasOwnProperty$2.call(object, key)) {
|
|
6139
|
+
if (object[key] !== null) return false;
|
|
6140
|
+
}
|
|
6141
|
+
return true;
|
|
6142
|
+
}
|
|
6143
|
+
function constructYamlSet(data) {
|
|
6144
|
+
return data !== null ? data : {};
|
|
6145
|
+
}
|
|
6146
|
+
var set = new type("tag:yaml.org,2002:set", {
|
|
6147
|
+
kind: "mapping",
|
|
6148
|
+
resolve: resolveYamlSet,
|
|
6149
|
+
construct: constructYamlSet
|
|
6150
|
+
});
|
|
6151
|
+
var _default = core.extend({
|
|
6152
|
+
implicit: [timestamp, merge],
|
|
6153
|
+
explicit: [
|
|
6154
|
+
binary,
|
|
6155
|
+
omap,
|
|
6156
|
+
pairs,
|
|
6157
|
+
set
|
|
6158
|
+
]
|
|
6159
|
+
});
|
|
6160
|
+
var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
6161
|
+
var CONTEXT_FLOW_IN = 1;
|
|
6162
|
+
var CONTEXT_FLOW_OUT = 2;
|
|
6163
|
+
var CONTEXT_BLOCK_IN = 3;
|
|
6164
|
+
var CONTEXT_BLOCK_OUT = 4;
|
|
6165
|
+
var CHOMPING_CLIP = 1;
|
|
6166
|
+
var CHOMPING_STRIP = 2;
|
|
6167
|
+
var CHOMPING_KEEP = 3;
|
|
6168
|
+
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
6169
|
+
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
6170
|
+
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
6171
|
+
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
6172
|
+
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
6173
|
+
function _class(obj) {
|
|
6174
|
+
return Object.prototype.toString.call(obj);
|
|
6175
|
+
}
|
|
6176
|
+
function is_EOL(c) {
|
|
6177
|
+
return c === 10 || c === 13;
|
|
6178
|
+
}
|
|
6179
|
+
function is_WHITE_SPACE(c) {
|
|
6180
|
+
return c === 9 || c === 32;
|
|
6181
|
+
}
|
|
6182
|
+
function is_WS_OR_EOL(c) {
|
|
6183
|
+
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
6184
|
+
}
|
|
6185
|
+
function is_FLOW_INDICATOR(c) {
|
|
6186
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
6187
|
+
}
|
|
6188
|
+
function fromHexCode(c) {
|
|
6189
|
+
var lc;
|
|
6190
|
+
if (48 <= c && c <= 57) return c - 48;
|
|
6191
|
+
lc = c | 32;
|
|
6192
|
+
if (97 <= lc && lc <= 102) return lc - 97 + 10;
|
|
6193
|
+
return -1;
|
|
6194
|
+
}
|
|
6195
|
+
function escapedHexLen(c) {
|
|
6196
|
+
if (c === 120) return 2;
|
|
6197
|
+
if (c === 117) return 4;
|
|
6198
|
+
if (c === 85) return 8;
|
|
6199
|
+
return 0;
|
|
6200
|
+
}
|
|
6201
|
+
function fromDecimalCode(c) {
|
|
6202
|
+
if (48 <= c && c <= 57) return c - 48;
|
|
6203
|
+
return -1;
|
|
6204
|
+
}
|
|
6205
|
+
function simpleEscapeSequence(c) {
|
|
6206
|
+
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? "\"" : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "
" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
|
6207
|
+
}
|
|
6208
|
+
function charFromCodepoint(c) {
|
|
6209
|
+
if (c <= 65535) return String.fromCharCode(c);
|
|
6210
|
+
return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
|
|
6211
|
+
}
|
|
6212
|
+
function setProperty(object, key, value) {
|
|
6213
|
+
if (key === "__proto__") Object.defineProperty(object, key, {
|
|
6214
|
+
configurable: true,
|
|
6215
|
+
enumerable: true,
|
|
6216
|
+
writable: true,
|
|
6217
|
+
value
|
|
6218
|
+
});
|
|
6219
|
+
else object[key] = value;
|
|
6220
|
+
}
|
|
6221
|
+
var simpleEscapeCheck = new Array(256);
|
|
6222
|
+
var simpleEscapeMap = new Array(256);
|
|
6223
|
+
for (var i = 0; i < 256; i++) {
|
|
6224
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
6225
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
6226
|
+
}
|
|
6227
|
+
function State$1(input, options) {
|
|
6228
|
+
this.input = input;
|
|
6229
|
+
this.filename = options["filename"] || null;
|
|
6230
|
+
this.schema = options["schema"] || _default;
|
|
6231
|
+
this.onWarning = options["onWarning"] || null;
|
|
6232
|
+
this.legacy = options["legacy"] || false;
|
|
6233
|
+
this.json = options["json"] || false;
|
|
6234
|
+
this.listener = options["listener"] || null;
|
|
6235
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
6236
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
6237
|
+
this.length = input.length;
|
|
6238
|
+
this.position = 0;
|
|
6239
|
+
this.line = 0;
|
|
6240
|
+
this.lineStart = 0;
|
|
6241
|
+
this.lineIndent = 0;
|
|
6242
|
+
this.firstTabInLine = -1;
|
|
6243
|
+
this.documents = [];
|
|
6244
|
+
}
|
|
6245
|
+
function generateError(state, message) {
|
|
6246
|
+
var mark = {
|
|
6247
|
+
name: state.filename,
|
|
6248
|
+
buffer: state.input.slice(0, -1),
|
|
6249
|
+
position: state.position,
|
|
6250
|
+
line: state.line,
|
|
6251
|
+
column: state.position - state.lineStart
|
|
6252
|
+
};
|
|
6253
|
+
mark.snippet = snippet(mark);
|
|
6254
|
+
return new exception(message, mark);
|
|
6255
|
+
}
|
|
6256
|
+
function throwError(state, message) {
|
|
6257
|
+
throw generateError(state, message);
|
|
6258
|
+
}
|
|
6259
|
+
function throwWarning(state, message) {
|
|
6260
|
+
if (state.onWarning) state.onWarning.call(null, generateError(state, message));
|
|
6261
|
+
}
|
|
6262
|
+
var directiveHandlers = {
|
|
6263
|
+
YAML: function handleYamlDirective(state, name, args) {
|
|
6264
|
+
var match, major, minor;
|
|
6265
|
+
if (state.version !== null) throwError(state, "duplication of %YAML directive");
|
|
6266
|
+
if (args.length !== 1) throwError(state, "YAML directive accepts exactly one argument");
|
|
6267
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
6268
|
+
if (match === null) throwError(state, "ill-formed argument of the YAML directive");
|
|
6269
|
+
major = parseInt(match[1], 10);
|
|
6270
|
+
minor = parseInt(match[2], 10);
|
|
6271
|
+
if (major !== 1) throwError(state, "unacceptable YAML version of the document");
|
|
6272
|
+
state.version = args[0];
|
|
6273
|
+
state.checkLineBreaks = minor < 2;
|
|
6274
|
+
if (minor !== 1 && minor !== 2) throwWarning(state, "unsupported YAML version of the document");
|
|
6275
|
+
},
|
|
6276
|
+
TAG: function handleTagDirective(state, name, args) {
|
|
6277
|
+
var handle, prefix;
|
|
6278
|
+
if (args.length !== 2) throwError(state, "TAG directive accepts exactly two arguments");
|
|
6279
|
+
handle = args[0];
|
|
6280
|
+
prefix = args[1];
|
|
6281
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
6282
|
+
if (_hasOwnProperty$1.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle");
|
|
6283
|
+
if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
6284
|
+
try {
|
|
6285
|
+
prefix = decodeURIComponent(prefix);
|
|
6286
|
+
} catch (err) {
|
|
6287
|
+
throwError(state, "tag prefix is malformed: " + prefix);
|
|
6288
|
+
}
|
|
6289
|
+
state.tagMap[handle] = prefix;
|
|
6290
|
+
}
|
|
6291
|
+
};
|
|
6292
|
+
function captureSegment(state, start, end, checkJson) {
|
|
6293
|
+
var _position, _length, _character, _result;
|
|
6294
|
+
if (start < end) {
|
|
6295
|
+
_result = state.input.slice(start, end);
|
|
6296
|
+
if (checkJson) for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
6297
|
+
_character = _result.charCodeAt(_position);
|
|
6298
|
+
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) throwError(state, "expected valid JSON character");
|
|
6299
|
+
}
|
|
6300
|
+
else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters");
|
|
6301
|
+
state.result += _result;
|
|
6302
|
+
}
|
|
6303
|
+
}
|
|
6304
|
+
function mergeMappings(state, destination, source, overridableKeys) {
|
|
6305
|
+
var sourceKeys, key, index, quantity;
|
|
6306
|
+
if (!common.isObject(source)) throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
6307
|
+
sourceKeys = Object.keys(source);
|
|
6308
|
+
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
6309
|
+
key = sourceKeys[index];
|
|
6310
|
+
if (!_hasOwnProperty$1.call(destination, key)) {
|
|
6311
|
+
setProperty(destination, key, source[key]);
|
|
6312
|
+
overridableKeys[key] = true;
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6315
|
+
}
|
|
6316
|
+
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
6317
|
+
var index, quantity;
|
|
6318
|
+
if (Array.isArray(keyNode)) {
|
|
6319
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
6320
|
+
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
6321
|
+
if (Array.isArray(keyNode[index])) throwError(state, "nested arrays are not supported inside keys");
|
|
6322
|
+
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") keyNode[index] = "[object Object]";
|
|
6323
|
+
}
|
|
6324
|
+
}
|
|
6325
|
+
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") keyNode = "[object Object]";
|
|
6326
|
+
keyNode = String(keyNode);
|
|
6327
|
+
if (_result === null) _result = {};
|
|
6328
|
+
if (keyTag === "tag:yaml.org,2002:merge") if (Array.isArray(valueNode)) for (index = 0, quantity = valueNode.length; index < quantity; index += 1) mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
6329
|
+
else mergeMappings(state, _result, valueNode, overridableKeys);
|
|
6330
|
+
else {
|
|
6331
|
+
if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
|
|
6332
|
+
state.line = startLine || state.line;
|
|
6333
|
+
state.lineStart = startLineStart || state.lineStart;
|
|
6334
|
+
state.position = startPos || state.position;
|
|
6335
|
+
throwError(state, "duplicated mapping key");
|
|
6336
|
+
}
|
|
6337
|
+
setProperty(_result, keyNode, valueNode);
|
|
6338
|
+
delete overridableKeys[keyNode];
|
|
6339
|
+
}
|
|
6340
|
+
return _result;
|
|
6341
|
+
}
|
|
6342
|
+
function readLineBreak(state) {
|
|
6343
|
+
var ch = state.input.charCodeAt(state.position);
|
|
6344
|
+
if (ch === 10) state.position++;
|
|
6345
|
+
else if (ch === 13) {
|
|
6346
|
+
state.position++;
|
|
6347
|
+
if (state.input.charCodeAt(state.position) === 10) state.position++;
|
|
6348
|
+
} else throwError(state, "a line break is expected");
|
|
6349
|
+
state.line += 1;
|
|
6350
|
+
state.lineStart = state.position;
|
|
6351
|
+
state.firstTabInLine = -1;
|
|
6352
|
+
}
|
|
6353
|
+
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
6354
|
+
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
6355
|
+
while (ch !== 0) {
|
|
6356
|
+
while (is_WHITE_SPACE(ch)) {
|
|
6357
|
+
if (ch === 9 && state.firstTabInLine === -1) state.firstTabInLine = state.position;
|
|
6358
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6359
|
+
}
|
|
6360
|
+
if (allowComments && ch === 35) do
|
|
6361
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6362
|
+
while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
6363
|
+
if (is_EOL(ch)) {
|
|
6364
|
+
readLineBreak(state);
|
|
6365
|
+
ch = state.input.charCodeAt(state.position);
|
|
6366
|
+
lineBreaks++;
|
|
6367
|
+
state.lineIndent = 0;
|
|
6368
|
+
while (ch === 32) {
|
|
6369
|
+
state.lineIndent++;
|
|
6370
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6371
|
+
}
|
|
6372
|
+
} else break;
|
|
6373
|
+
}
|
|
6374
|
+
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation");
|
|
6375
|
+
return lineBreaks;
|
|
6376
|
+
}
|
|
6377
|
+
function testDocumentSeparator(state) {
|
|
6378
|
+
var _position = state.position, ch = state.input.charCodeAt(_position);
|
|
6379
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
6380
|
+
_position += 3;
|
|
6381
|
+
ch = state.input.charCodeAt(_position);
|
|
6382
|
+
if (ch === 0 || is_WS_OR_EOL(ch)) return true;
|
|
6383
|
+
}
|
|
6384
|
+
return false;
|
|
6385
|
+
}
|
|
6386
|
+
function writeFoldedLines(state, count) {
|
|
6387
|
+
if (count === 1) state.result += " ";
|
|
6388
|
+
else if (count > 1) state.result += common.repeat("\n", count - 1);
|
|
6389
|
+
}
|
|
6390
|
+
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
6391
|
+
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch = state.input.charCodeAt(state.position);
|
|
6392
|
+
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) return false;
|
|
6393
|
+
if (ch === 63 || ch === 45) {
|
|
6394
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
6395
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) return false;
|
|
6396
|
+
}
|
|
6397
|
+
state.kind = "scalar";
|
|
6398
|
+
state.result = "";
|
|
6399
|
+
captureStart = captureEnd = state.position;
|
|
6400
|
+
hasPendingContent = false;
|
|
6401
|
+
while (ch !== 0) {
|
|
6402
|
+
if (ch === 58) {
|
|
6403
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
6404
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) break;
|
|
6405
|
+
} else if (ch === 35) {
|
|
6406
|
+
preceding = state.input.charCodeAt(state.position - 1);
|
|
6407
|
+
if (is_WS_OR_EOL(preceding)) break;
|
|
6408
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) break;
|
|
6409
|
+
else if (is_EOL(ch)) {
|
|
6410
|
+
_line = state.line;
|
|
6411
|
+
_lineStart = state.lineStart;
|
|
6412
|
+
_lineIndent = state.lineIndent;
|
|
6413
|
+
skipSeparationSpace(state, false, -1);
|
|
6414
|
+
if (state.lineIndent >= nodeIndent) {
|
|
6415
|
+
hasPendingContent = true;
|
|
6416
|
+
ch = state.input.charCodeAt(state.position);
|
|
6417
|
+
continue;
|
|
6418
|
+
} else {
|
|
6419
|
+
state.position = captureEnd;
|
|
6420
|
+
state.line = _line;
|
|
6421
|
+
state.lineStart = _lineStart;
|
|
6422
|
+
state.lineIndent = _lineIndent;
|
|
6423
|
+
break;
|
|
6424
|
+
}
|
|
6425
|
+
}
|
|
6426
|
+
if (hasPendingContent) {
|
|
6427
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
6428
|
+
writeFoldedLines(state, state.line - _line);
|
|
6429
|
+
captureStart = captureEnd = state.position;
|
|
6430
|
+
hasPendingContent = false;
|
|
6431
|
+
}
|
|
6432
|
+
if (!is_WHITE_SPACE(ch)) captureEnd = state.position + 1;
|
|
6433
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6434
|
+
}
|
|
6435
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
6436
|
+
if (state.result) return true;
|
|
6437
|
+
state.kind = _kind;
|
|
6438
|
+
state.result = _result;
|
|
6439
|
+
return false;
|
|
6440
|
+
}
|
|
6441
|
+
function readSingleQuotedScalar(state, nodeIndent) {
|
|
6442
|
+
var ch = state.input.charCodeAt(state.position), captureStart, captureEnd;
|
|
6443
|
+
if (ch !== 39) return false;
|
|
6444
|
+
state.kind = "scalar";
|
|
6445
|
+
state.result = "";
|
|
6446
|
+
state.position++;
|
|
6447
|
+
captureStart = captureEnd = state.position;
|
|
6448
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 39) {
|
|
6449
|
+
captureSegment(state, captureStart, state.position, true);
|
|
6450
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6451
|
+
if (ch === 39) {
|
|
6452
|
+
captureStart = state.position;
|
|
6453
|
+
state.position++;
|
|
6454
|
+
captureEnd = state.position;
|
|
6455
|
+
} else return true;
|
|
6456
|
+
} else if (is_EOL(ch)) {
|
|
6457
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
6458
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
6459
|
+
captureStart = captureEnd = state.position;
|
|
6460
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
6461
|
+
else {
|
|
6462
|
+
state.position++;
|
|
6463
|
+
captureEnd = state.position;
|
|
6464
|
+
}
|
|
6465
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
6466
|
+
}
|
|
6467
|
+
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
6468
|
+
var captureStart, captureEnd, hexLength, hexResult, tmp, ch = state.input.charCodeAt(state.position);
|
|
6469
|
+
if (ch !== 34) return false;
|
|
6470
|
+
state.kind = "scalar";
|
|
6471
|
+
state.result = "";
|
|
6472
|
+
state.position++;
|
|
6473
|
+
captureStart = captureEnd = state.position;
|
|
6474
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 34) {
|
|
6475
|
+
captureSegment(state, captureStart, state.position, true);
|
|
6476
|
+
state.position++;
|
|
6477
|
+
return true;
|
|
6478
|
+
} else if (ch === 92) {
|
|
6479
|
+
captureSegment(state, captureStart, state.position, true);
|
|
6480
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6481
|
+
if (is_EOL(ch)) skipSeparationSpace(state, false, nodeIndent);
|
|
6482
|
+
else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
6483
|
+
state.result += simpleEscapeMap[ch];
|
|
6484
|
+
state.position++;
|
|
6485
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
6486
|
+
hexLength = tmp;
|
|
6487
|
+
hexResult = 0;
|
|
6488
|
+
for (; hexLength > 0; hexLength--) {
|
|
6489
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6490
|
+
if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
|
|
6491
|
+
else throwError(state, "expected hexadecimal character");
|
|
6492
|
+
}
|
|
6493
|
+
state.result += charFromCodepoint(hexResult);
|
|
6494
|
+
state.position++;
|
|
6495
|
+
} else throwError(state, "unknown escape sequence");
|
|
6496
|
+
captureStart = captureEnd = state.position;
|
|
6497
|
+
} else if (is_EOL(ch)) {
|
|
6498
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
6499
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
6500
|
+
captureStart = captureEnd = state.position;
|
|
6501
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
6502
|
+
else {
|
|
6503
|
+
state.position++;
|
|
6504
|
+
captureEnd = state.position;
|
|
6505
|
+
}
|
|
6506
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
6507
|
+
}
|
|
6508
|
+
function readFlowCollection(state, nodeIndent) {
|
|
6509
|
+
var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch = state.input.charCodeAt(state.position);
|
|
6510
|
+
if (ch === 91) {
|
|
6511
|
+
terminator = 93;
|
|
6512
|
+
isMapping = false;
|
|
6513
|
+
_result = [];
|
|
6514
|
+
} else if (ch === 123) {
|
|
6515
|
+
terminator = 125;
|
|
6516
|
+
isMapping = true;
|
|
6517
|
+
_result = {};
|
|
6518
|
+
} else return false;
|
|
6519
|
+
if (state.anchor !== null) state.anchorMap[state.anchor] = _result;
|
|
6520
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6521
|
+
while (ch !== 0) {
|
|
6522
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
6523
|
+
ch = state.input.charCodeAt(state.position);
|
|
6524
|
+
if (ch === terminator) {
|
|
6525
|
+
state.position++;
|
|
6526
|
+
state.tag = _tag;
|
|
6527
|
+
state.anchor = _anchor;
|
|
6528
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
6529
|
+
state.result = _result;
|
|
6530
|
+
return true;
|
|
6531
|
+
} else if (!readNext) throwError(state, "missed comma between flow collection entries");
|
|
6532
|
+
else if (ch === 44) throwError(state, "expected the node content, but found ','");
|
|
6533
|
+
keyTag = keyNode = valueNode = null;
|
|
6534
|
+
isPair = isExplicitPair = false;
|
|
6535
|
+
if (ch === 63) {
|
|
6536
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
6537
|
+
if (is_WS_OR_EOL(following)) {
|
|
6538
|
+
isPair = isExplicitPair = true;
|
|
6539
|
+
state.position++;
|
|
6540
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
6541
|
+
}
|
|
6542
|
+
}
|
|
6543
|
+
_line = state.line;
|
|
6544
|
+
_lineStart = state.lineStart;
|
|
6545
|
+
_pos = state.position;
|
|
6546
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
6547
|
+
keyTag = state.tag;
|
|
6548
|
+
keyNode = state.result;
|
|
6549
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
6550
|
+
ch = state.input.charCodeAt(state.position);
|
|
6551
|
+
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
6552
|
+
isPair = true;
|
|
6553
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6554
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
6555
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
6556
|
+
valueNode = state.result;
|
|
6557
|
+
}
|
|
6558
|
+
if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
6559
|
+
else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
6560
|
+
else _result.push(keyNode);
|
|
6561
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
6562
|
+
ch = state.input.charCodeAt(state.position);
|
|
6563
|
+
if (ch === 44) {
|
|
6564
|
+
readNext = true;
|
|
6565
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6566
|
+
} else readNext = false;
|
|
6567
|
+
}
|
|
6568
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
6569
|
+
}
|
|
6570
|
+
function readBlockScalar(state, nodeIndent) {
|
|
6571
|
+
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch = state.input.charCodeAt(state.position);
|
|
6572
|
+
if (ch === 124) folding = false;
|
|
6573
|
+
else if (ch === 62) folding = true;
|
|
6574
|
+
else return false;
|
|
6575
|
+
state.kind = "scalar";
|
|
6576
|
+
state.result = "";
|
|
6577
|
+
while (ch !== 0) {
|
|
6578
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6579
|
+
if (ch === 43 || ch === 45) if (CHOMPING_CLIP === chomping) chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
6580
|
+
else throwError(state, "repeat of a chomping mode identifier");
|
|
6581
|
+
else if ((tmp = fromDecimalCode(ch)) >= 0) if (tmp === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
6582
|
+
else if (!detectedIndent) {
|
|
6583
|
+
textIndent = nodeIndent + tmp - 1;
|
|
6584
|
+
detectedIndent = true;
|
|
6585
|
+
} else throwError(state, "repeat of an indentation width identifier");
|
|
6586
|
+
else break;
|
|
6587
|
+
}
|
|
6588
|
+
if (is_WHITE_SPACE(ch)) {
|
|
6589
|
+
do
|
|
6590
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6591
|
+
while (is_WHITE_SPACE(ch));
|
|
6592
|
+
if (ch === 35) do
|
|
6593
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6594
|
+
while (!is_EOL(ch) && ch !== 0);
|
|
6595
|
+
}
|
|
6596
|
+
while (ch !== 0) {
|
|
6597
|
+
readLineBreak(state);
|
|
6598
|
+
state.lineIndent = 0;
|
|
6599
|
+
ch = state.input.charCodeAt(state.position);
|
|
6600
|
+
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
6601
|
+
state.lineIndent++;
|
|
6602
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6603
|
+
}
|
|
6604
|
+
if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent;
|
|
6605
|
+
if (is_EOL(ch)) {
|
|
6606
|
+
emptyLines++;
|
|
6607
|
+
continue;
|
|
6608
|
+
}
|
|
6609
|
+
if (state.lineIndent < textIndent) {
|
|
6610
|
+
if (chomping === CHOMPING_KEEP) state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
6611
|
+
else if (chomping === CHOMPING_CLIP) {
|
|
6612
|
+
if (didReadContent) state.result += "\n";
|
|
6613
|
+
}
|
|
6614
|
+
break;
|
|
6615
|
+
}
|
|
6616
|
+
if (folding) if (is_WHITE_SPACE(ch)) {
|
|
6617
|
+
atMoreIndented = true;
|
|
6618
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
6619
|
+
} else if (atMoreIndented) {
|
|
6620
|
+
atMoreIndented = false;
|
|
6621
|
+
state.result += common.repeat("\n", emptyLines + 1);
|
|
6622
|
+
} else if (emptyLines === 0) {
|
|
6623
|
+
if (didReadContent) state.result += " ";
|
|
6624
|
+
} else state.result += common.repeat("\n", emptyLines);
|
|
6625
|
+
else state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
6626
|
+
didReadContent = true;
|
|
6627
|
+
detectedIndent = true;
|
|
6628
|
+
emptyLines = 0;
|
|
6629
|
+
captureStart = state.position;
|
|
6630
|
+
while (!is_EOL(ch) && ch !== 0) ch = state.input.charCodeAt(++state.position);
|
|
6631
|
+
captureSegment(state, captureStart, state.position, false);
|
|
6632
|
+
}
|
|
6633
|
+
return true;
|
|
6634
|
+
}
|
|
6635
|
+
function readBlockSequence(state, nodeIndent) {
|
|
6636
|
+
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
6637
|
+
if (state.firstTabInLine !== -1) return false;
|
|
6638
|
+
if (state.anchor !== null) state.anchorMap[state.anchor] = _result;
|
|
6639
|
+
ch = state.input.charCodeAt(state.position);
|
|
6640
|
+
while (ch !== 0) {
|
|
6641
|
+
if (state.firstTabInLine !== -1) {
|
|
6642
|
+
state.position = state.firstTabInLine;
|
|
6643
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
6644
|
+
}
|
|
6645
|
+
if (ch !== 45) break;
|
|
6646
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
6647
|
+
if (!is_WS_OR_EOL(following)) break;
|
|
6648
|
+
detected = true;
|
|
6649
|
+
state.position++;
|
|
6650
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
6651
|
+
if (state.lineIndent <= nodeIndent) {
|
|
6652
|
+
_result.push(null);
|
|
6653
|
+
ch = state.input.charCodeAt(state.position);
|
|
6654
|
+
continue;
|
|
6655
|
+
}
|
|
6656
|
+
}
|
|
6657
|
+
_line = state.line;
|
|
6658
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
6659
|
+
_result.push(state.result);
|
|
6660
|
+
skipSeparationSpace(state, true, -1);
|
|
6661
|
+
ch = state.input.charCodeAt(state.position);
|
|
6662
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a sequence entry");
|
|
6663
|
+
else if (state.lineIndent < nodeIndent) break;
|
|
6664
|
+
}
|
|
6665
|
+
if (detected) {
|
|
6666
|
+
state.tag = _tag;
|
|
6667
|
+
state.anchor = _anchor;
|
|
6668
|
+
state.kind = "sequence";
|
|
6669
|
+
state.result = _result;
|
|
6670
|
+
return true;
|
|
6671
|
+
}
|
|
6672
|
+
return false;
|
|
6673
|
+
}
|
|
6674
|
+
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
6675
|
+
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
6676
|
+
if (state.firstTabInLine !== -1) return false;
|
|
6677
|
+
if (state.anchor !== null) state.anchorMap[state.anchor] = _result;
|
|
6678
|
+
ch = state.input.charCodeAt(state.position);
|
|
6679
|
+
while (ch !== 0) {
|
|
6680
|
+
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
6681
|
+
state.position = state.firstTabInLine;
|
|
6682
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
6683
|
+
}
|
|
6684
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
6685
|
+
_line = state.line;
|
|
6686
|
+
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
6687
|
+
if (ch === 63) {
|
|
6688
|
+
if (atExplicitKey) {
|
|
6689
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
6690
|
+
keyTag = keyNode = valueNode = null;
|
|
6691
|
+
}
|
|
6692
|
+
detected = true;
|
|
6693
|
+
atExplicitKey = true;
|
|
6694
|
+
allowCompact = true;
|
|
6695
|
+
} else if (atExplicitKey) {
|
|
6696
|
+
atExplicitKey = false;
|
|
6697
|
+
allowCompact = true;
|
|
6698
|
+
} else throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
6699
|
+
state.position += 1;
|
|
6700
|
+
ch = following;
|
|
6701
|
+
} else {
|
|
6702
|
+
_keyLine = state.line;
|
|
6703
|
+
_keyLineStart = state.lineStart;
|
|
6704
|
+
_keyPos = state.position;
|
|
6705
|
+
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break;
|
|
6706
|
+
if (state.line === _line) {
|
|
6707
|
+
ch = state.input.charCodeAt(state.position);
|
|
6708
|
+
while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position);
|
|
6709
|
+
if (ch === 58) {
|
|
6710
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6711
|
+
if (!is_WS_OR_EOL(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
6712
|
+
if (atExplicitKey) {
|
|
6713
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
6714
|
+
keyTag = keyNode = valueNode = null;
|
|
6715
|
+
}
|
|
6716
|
+
detected = true;
|
|
6717
|
+
atExplicitKey = false;
|
|
6718
|
+
allowCompact = false;
|
|
6719
|
+
keyTag = state.tag;
|
|
6720
|
+
keyNode = state.result;
|
|
6721
|
+
} else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
6722
|
+
else {
|
|
6723
|
+
state.tag = _tag;
|
|
6724
|
+
state.anchor = _anchor;
|
|
6725
|
+
return true;
|
|
6726
|
+
}
|
|
6727
|
+
} else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
6728
|
+
else {
|
|
6729
|
+
state.tag = _tag;
|
|
6730
|
+
state.anchor = _anchor;
|
|
6731
|
+
return true;
|
|
6732
|
+
}
|
|
6733
|
+
}
|
|
6734
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
6735
|
+
if (atExplicitKey) {
|
|
6736
|
+
_keyLine = state.line;
|
|
6737
|
+
_keyLineStart = state.lineStart;
|
|
6738
|
+
_keyPos = state.position;
|
|
6739
|
+
}
|
|
6740
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result;
|
|
6741
|
+
else valueNode = state.result;
|
|
6742
|
+
if (!atExplicitKey) {
|
|
6743
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
6744
|
+
keyTag = keyNode = valueNode = null;
|
|
6745
|
+
}
|
|
6746
|
+
skipSeparationSpace(state, true, -1);
|
|
6747
|
+
ch = state.input.charCodeAt(state.position);
|
|
6748
|
+
}
|
|
6749
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a mapping entry");
|
|
6750
|
+
else if (state.lineIndent < nodeIndent) break;
|
|
6751
|
+
}
|
|
6752
|
+
if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
6753
|
+
if (detected) {
|
|
6754
|
+
state.tag = _tag;
|
|
6755
|
+
state.anchor = _anchor;
|
|
6756
|
+
state.kind = "mapping";
|
|
6757
|
+
state.result = _result;
|
|
6758
|
+
}
|
|
6759
|
+
return detected;
|
|
6760
|
+
}
|
|
6761
|
+
function readTagProperty(state) {
|
|
6762
|
+
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch = state.input.charCodeAt(state.position);
|
|
6763
|
+
if (ch !== 33) return false;
|
|
6764
|
+
if (state.tag !== null) throwError(state, "duplication of a tag property");
|
|
6765
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6766
|
+
if (ch === 60) {
|
|
6767
|
+
isVerbatim = true;
|
|
6768
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6769
|
+
} else if (ch === 33) {
|
|
6770
|
+
isNamed = true;
|
|
6771
|
+
tagHandle = "!!";
|
|
6772
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6773
|
+
} else tagHandle = "!";
|
|
6774
|
+
_position = state.position;
|
|
6775
|
+
if (isVerbatim) {
|
|
6776
|
+
do
|
|
6777
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6778
|
+
while (ch !== 0 && ch !== 62);
|
|
6779
|
+
if (state.position < state.length) {
|
|
6780
|
+
tagName = state.input.slice(_position, state.position);
|
|
6781
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6782
|
+
} else throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
6783
|
+
} else {
|
|
6784
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
6785
|
+
if (ch === 33) if (!isNamed) {
|
|
6786
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
6787
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters");
|
|
6788
|
+
isNamed = true;
|
|
6789
|
+
_position = state.position + 1;
|
|
6790
|
+
} else throwError(state, "tag suffix cannot contain exclamation marks");
|
|
6791
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6792
|
+
}
|
|
6793
|
+
tagName = state.input.slice(_position, state.position);
|
|
6794
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
6795
|
+
}
|
|
6796
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
6797
|
+
try {
|
|
6798
|
+
tagName = decodeURIComponent(tagName);
|
|
6799
|
+
} catch (err) {
|
|
6800
|
+
throwError(state, "tag name is malformed: " + tagName);
|
|
6801
|
+
}
|
|
6802
|
+
if (isVerbatim) state.tag = tagName;
|
|
6803
|
+
else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
|
|
6804
|
+
else if (tagHandle === "!") state.tag = "!" + tagName;
|
|
6805
|
+
else if (tagHandle === "!!") state.tag = "tag:yaml.org,2002:" + tagName;
|
|
6806
|
+
else throwError(state, "undeclared tag handle \"" + tagHandle + "\"");
|
|
6807
|
+
return true;
|
|
6808
|
+
}
|
|
6809
|
+
function readAnchorProperty(state) {
|
|
6810
|
+
var _position, ch = state.input.charCodeAt(state.position);
|
|
6811
|
+
if (ch !== 38) return false;
|
|
6812
|
+
if (state.anchor !== null) throwError(state, "duplication of an anchor property");
|
|
6813
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6814
|
+
_position = state.position;
|
|
6815
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position);
|
|
6816
|
+
if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character");
|
|
6817
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
6818
|
+
return true;
|
|
6819
|
+
}
|
|
6820
|
+
function readAlias(state) {
|
|
6821
|
+
var _position, alias, ch = state.input.charCodeAt(state.position);
|
|
6822
|
+
if (ch !== 42) return false;
|
|
6823
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6824
|
+
_position = state.position;
|
|
6825
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position);
|
|
6826
|
+
if (state.position === _position) throwError(state, "name of an alias node must contain at least one character");
|
|
6827
|
+
alias = state.input.slice(_position, state.position);
|
|
6828
|
+
if (!_hasOwnProperty$1.call(state.anchorMap, alias)) throwError(state, "unidentified alias \"" + alias + "\"");
|
|
6829
|
+
state.result = state.anchorMap[alias];
|
|
6830
|
+
skipSeparationSpace(state, true, -1);
|
|
6831
|
+
return true;
|
|
6832
|
+
}
|
|
6833
|
+
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
6834
|
+
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent;
|
|
6835
|
+
if (state.listener !== null) state.listener("open", state);
|
|
6836
|
+
state.tag = null;
|
|
6837
|
+
state.anchor = null;
|
|
6838
|
+
state.kind = null;
|
|
6839
|
+
state.result = null;
|
|
6840
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
6841
|
+
if (allowToSeek) {
|
|
6842
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
6843
|
+
atNewLine = true;
|
|
6844
|
+
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
6845
|
+
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
6846
|
+
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
6847
|
+
}
|
|
6848
|
+
}
|
|
6849
|
+
if (indentStatus === 1) while (readTagProperty(state) || readAnchorProperty(state)) if (skipSeparationSpace(state, true, -1)) {
|
|
6850
|
+
atNewLine = true;
|
|
6851
|
+
allowBlockCollections = allowBlockStyles;
|
|
6852
|
+
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
6853
|
+
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
6854
|
+
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
6855
|
+
} else allowBlockCollections = false;
|
|
6856
|
+
if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
|
|
6857
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
6858
|
+
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) flowIndent = parentIndent;
|
|
6859
|
+
else flowIndent = parentIndent + 1;
|
|
6860
|
+
blockIndent = state.position - state.lineStart;
|
|
6861
|
+
if (indentStatus === 1) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
|
|
6862
|
+
else {
|
|
6863
|
+
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
|
|
6864
|
+
else if (readAlias(state)) {
|
|
6865
|
+
hasContent = true;
|
|
6866
|
+
if (state.tag !== null || state.anchor !== null) throwError(state, "alias node should not have any properties");
|
|
6867
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
6868
|
+
hasContent = true;
|
|
6869
|
+
if (state.tag === null) state.tag = "?";
|
|
6870
|
+
}
|
|
6871
|
+
if (state.anchor !== null) state.anchorMap[state.anchor] = state.result;
|
|
6872
|
+
}
|
|
6873
|
+
else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
6874
|
+
}
|
|
6875
|
+
if (state.tag === null) {
|
|
6876
|
+
if (state.anchor !== null) state.anchorMap[state.anchor] = state.result;
|
|
6877
|
+
} else if (state.tag === "?") {
|
|
6878
|
+
if (state.result !== null && state.kind !== "scalar") throwError(state, "unacceptable node kind for !<?> tag; it should be \"scalar\", not \"" + state.kind + "\"");
|
|
6879
|
+
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
6880
|
+
type = state.implicitTypes[typeIndex];
|
|
6881
|
+
if (type.resolve(state.result)) {
|
|
6882
|
+
state.result = type.construct(state.result);
|
|
6883
|
+
state.tag = type.tag;
|
|
6884
|
+
if (state.anchor !== null) state.anchorMap[state.anchor] = state.result;
|
|
6885
|
+
break;
|
|
6886
|
+
}
|
|
6887
|
+
}
|
|
6888
|
+
} else if (state.tag !== "!") {
|
|
6889
|
+
if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
6890
|
+
else {
|
|
6891
|
+
type = null;
|
|
6892
|
+
typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
6893
|
+
for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
6894
|
+
type = typeList[typeIndex];
|
|
6895
|
+
break;
|
|
6896
|
+
}
|
|
6897
|
+
}
|
|
6898
|
+
if (!type) throwError(state, "unknown tag !<" + state.tag + ">");
|
|
6899
|
+
if (state.result !== null && type.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + "> tag; it should be \"" + type.kind + "\", not \"" + state.kind + "\"");
|
|
6900
|
+
if (!type.resolve(state.result, state.tag)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
6901
|
+
else {
|
|
6902
|
+
state.result = type.construct(state.result, state.tag);
|
|
6903
|
+
if (state.anchor !== null) state.anchorMap[state.anchor] = state.result;
|
|
6904
|
+
}
|
|
6905
|
+
}
|
|
6906
|
+
if (state.listener !== null) state.listener("close", state);
|
|
6907
|
+
return state.tag !== null || state.anchor !== null || hasContent;
|
|
6908
|
+
}
|
|
6909
|
+
function readDocument(state) {
|
|
6910
|
+
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
6911
|
+
state.version = null;
|
|
6912
|
+
state.checkLineBreaks = state.legacy;
|
|
6913
|
+
state.tagMap = Object.create(null);
|
|
6914
|
+
state.anchorMap = Object.create(null);
|
|
6915
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
6916
|
+
skipSeparationSpace(state, true, -1);
|
|
6917
|
+
ch = state.input.charCodeAt(state.position);
|
|
6918
|
+
if (state.lineIndent > 0 || ch !== 37) break;
|
|
6919
|
+
hasDirectives = true;
|
|
6920
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6921
|
+
_position = state.position;
|
|
6922
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position);
|
|
6923
|
+
directiveName = state.input.slice(_position, state.position);
|
|
6924
|
+
directiveArgs = [];
|
|
6925
|
+
if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length");
|
|
6926
|
+
while (ch !== 0) {
|
|
6927
|
+
while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position);
|
|
6928
|
+
if (ch === 35) {
|
|
6929
|
+
do
|
|
6930
|
+
ch = state.input.charCodeAt(++state.position);
|
|
6931
|
+
while (ch !== 0 && !is_EOL(ch));
|
|
6932
|
+
break;
|
|
6933
|
+
}
|
|
6934
|
+
if (is_EOL(ch)) break;
|
|
6935
|
+
_position = state.position;
|
|
6936
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position);
|
|
6937
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
6938
|
+
}
|
|
6939
|
+
if (ch !== 0) readLineBreak(state);
|
|
6940
|
+
if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
6941
|
+
else throwWarning(state, "unknown document directive \"" + directiveName + "\"");
|
|
6942
|
+
}
|
|
6943
|
+
skipSeparationSpace(state, true, -1);
|
|
6944
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
6945
|
+
state.position += 3;
|
|
6946
|
+
skipSeparationSpace(state, true, -1);
|
|
6947
|
+
} else if (hasDirectives) throwError(state, "directives end mark is expected");
|
|
6948
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
6949
|
+
skipSeparationSpace(state, true, -1);
|
|
6950
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
6951
|
+
state.documents.push(state.result);
|
|
6952
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
6953
|
+
if (state.input.charCodeAt(state.position) === 46) {
|
|
6954
|
+
state.position += 3;
|
|
6955
|
+
skipSeparationSpace(state, true, -1);
|
|
6956
|
+
}
|
|
6957
|
+
return;
|
|
6958
|
+
}
|
|
6959
|
+
if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected");
|
|
6960
|
+
else return;
|
|
6961
|
+
}
|
|
6962
|
+
function loadDocuments(input, options) {
|
|
6963
|
+
input = String(input);
|
|
6964
|
+
options = options || {};
|
|
6965
|
+
if (input.length !== 0) {
|
|
6966
|
+
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) input += "\n";
|
|
6967
|
+
if (input.charCodeAt(0) === 65279) input = input.slice(1);
|
|
6968
|
+
}
|
|
6969
|
+
var state = new State$1(input, options);
|
|
6970
|
+
var nullpos = input.indexOf("\0");
|
|
6971
|
+
if (nullpos !== -1) {
|
|
6972
|
+
state.position = nullpos;
|
|
6973
|
+
throwError(state, "null byte is not allowed in input");
|
|
6974
|
+
}
|
|
6975
|
+
state.input += "\0";
|
|
6976
|
+
while (state.input.charCodeAt(state.position) === 32) {
|
|
6977
|
+
state.lineIndent += 1;
|
|
6978
|
+
state.position += 1;
|
|
6979
|
+
}
|
|
6980
|
+
while (state.position < state.length - 1) readDocument(state);
|
|
6981
|
+
return state.documents;
|
|
6982
|
+
}
|
|
6983
|
+
function loadAll$1(input, iterator, options) {
|
|
6984
|
+
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
6985
|
+
options = iterator;
|
|
6986
|
+
iterator = null;
|
|
6987
|
+
}
|
|
6988
|
+
var documents = loadDocuments(input, options);
|
|
6989
|
+
if (typeof iterator !== "function") return documents;
|
|
6990
|
+
for (var index = 0, length = documents.length; index < length; index += 1) iterator(documents[index]);
|
|
6991
|
+
}
|
|
6992
|
+
function load$1(input, options) {
|
|
6993
|
+
var documents = loadDocuments(input, options);
|
|
6994
|
+
if (documents.length === 0) return;
|
|
6995
|
+
else if (documents.length === 1) return documents[0];
|
|
6996
|
+
throw new exception("expected a single document in the stream, but found more");
|
|
6997
|
+
}
|
|
6998
|
+
var loader = {
|
|
6999
|
+
loadAll: loadAll$1,
|
|
7000
|
+
load: load$1
|
|
7001
|
+
};
|
|
7002
|
+
var _toString = Object.prototype.toString;
|
|
7003
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
7004
|
+
var CHAR_BOM = 65279;
|
|
7005
|
+
var CHAR_TAB = 9;
|
|
7006
|
+
var CHAR_LINE_FEED = 10;
|
|
7007
|
+
var CHAR_CARRIAGE_RETURN = 13;
|
|
7008
|
+
var CHAR_SPACE = 32;
|
|
7009
|
+
var CHAR_EXCLAMATION = 33;
|
|
7010
|
+
var CHAR_DOUBLE_QUOTE = 34;
|
|
7011
|
+
var CHAR_SHARP = 35;
|
|
7012
|
+
var CHAR_PERCENT = 37;
|
|
7013
|
+
var CHAR_AMPERSAND = 38;
|
|
7014
|
+
var CHAR_SINGLE_QUOTE = 39;
|
|
7015
|
+
var CHAR_ASTERISK = 42;
|
|
7016
|
+
var CHAR_COMMA = 44;
|
|
7017
|
+
var CHAR_MINUS = 45;
|
|
7018
|
+
var CHAR_COLON = 58;
|
|
7019
|
+
var CHAR_EQUALS = 61;
|
|
7020
|
+
var CHAR_GREATER_THAN = 62;
|
|
7021
|
+
var CHAR_QUESTION = 63;
|
|
7022
|
+
var CHAR_COMMERCIAL_AT = 64;
|
|
7023
|
+
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
7024
|
+
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
7025
|
+
var CHAR_GRAVE_ACCENT = 96;
|
|
7026
|
+
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
7027
|
+
var CHAR_VERTICAL_LINE = 124;
|
|
7028
|
+
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
7029
|
+
var ESCAPE_SEQUENCES = {};
|
|
7030
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
7031
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
7032
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
7033
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
7034
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
7035
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
7036
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
7037
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
7038
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
7039
|
+
ESCAPE_SEQUENCES[34] = "\\\"";
|
|
7040
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
7041
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
7042
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
7043
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
7044
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
7045
|
+
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
7046
|
+
"y",
|
|
7047
|
+
"Y",
|
|
7048
|
+
"yes",
|
|
7049
|
+
"Yes",
|
|
7050
|
+
"YES",
|
|
7051
|
+
"on",
|
|
7052
|
+
"On",
|
|
7053
|
+
"ON",
|
|
7054
|
+
"n",
|
|
7055
|
+
"N",
|
|
7056
|
+
"no",
|
|
7057
|
+
"No",
|
|
7058
|
+
"NO",
|
|
7059
|
+
"off",
|
|
7060
|
+
"Off",
|
|
7061
|
+
"OFF"
|
|
7062
|
+
];
|
|
7063
|
+
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
7064
|
+
function compileStyleMap(schema, map) {
|
|
7065
|
+
var result, keys, index, length, tag, style, type;
|
|
7066
|
+
if (map === null) return {};
|
|
7067
|
+
result = {};
|
|
7068
|
+
keys = Object.keys(map);
|
|
7069
|
+
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
7070
|
+
tag = keys[index];
|
|
7071
|
+
style = String(map[tag]);
|
|
7072
|
+
if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
7073
|
+
type = schema.compiledTypeMap["fallback"][tag];
|
|
7074
|
+
if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style];
|
|
7075
|
+
result[tag] = style;
|
|
7076
|
+
}
|
|
7077
|
+
return result;
|
|
7078
|
+
}
|
|
7079
|
+
function encodeHex(character) {
|
|
7080
|
+
var string = character.toString(16).toUpperCase(), handle, length;
|
|
7081
|
+
if (character <= 255) {
|
|
7082
|
+
handle = "x";
|
|
7083
|
+
length = 2;
|
|
7084
|
+
} else if (character <= 65535) {
|
|
7085
|
+
handle = "u";
|
|
7086
|
+
length = 4;
|
|
7087
|
+
} else if (character <= 4294967295) {
|
|
7088
|
+
handle = "U";
|
|
7089
|
+
length = 8;
|
|
7090
|
+
} else throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
|
|
7091
|
+
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
7092
|
+
}
|
|
7093
|
+
var QUOTING_TYPE_SINGLE = 1, QUOTING_TYPE_DOUBLE = 2;
|
|
7094
|
+
function State(options) {
|
|
7095
|
+
this.schema = options["schema"] || _default;
|
|
7096
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
7097
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
7098
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
7099
|
+
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
7100
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
7101
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
7102
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
7103
|
+
this.noRefs = options["noRefs"] || false;
|
|
7104
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
7105
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
7106
|
+
this.quotingType = options["quotingType"] === "\"" ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
7107
|
+
this.forceQuotes = options["forceQuotes"] || false;
|
|
7108
|
+
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
|
|
7109
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
7110
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
7111
|
+
this.tag = null;
|
|
7112
|
+
this.result = "";
|
|
7113
|
+
this.duplicates = [];
|
|
7114
|
+
this.usedDuplicates = null;
|
|
7115
|
+
}
|
|
7116
|
+
function indentString(string, spaces) {
|
|
7117
|
+
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
7118
|
+
while (position < length) {
|
|
7119
|
+
next = string.indexOf("\n", position);
|
|
7120
|
+
if (next === -1) {
|
|
7121
|
+
line = string.slice(position);
|
|
7122
|
+
position = length;
|
|
7123
|
+
} else {
|
|
7124
|
+
line = string.slice(position, next + 1);
|
|
7125
|
+
position = next + 1;
|
|
7126
|
+
}
|
|
7127
|
+
if (line.length && line !== "\n") result += ind;
|
|
7128
|
+
result += line;
|
|
7129
|
+
}
|
|
7130
|
+
return result;
|
|
7131
|
+
}
|
|
7132
|
+
function generateNextLine(state, level) {
|
|
7133
|
+
return "\n" + common.repeat(" ", state.indent * level);
|
|
7134
|
+
}
|
|
7135
|
+
function testImplicitResolving(state, str) {
|
|
7136
|
+
var index, length, type;
|
|
7137
|
+
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
7138
|
+
type = state.implicitTypes[index];
|
|
7139
|
+
if (type.resolve(str)) return true;
|
|
7140
|
+
}
|
|
7141
|
+
return false;
|
|
7142
|
+
}
|
|
7143
|
+
function isWhitespace(c) {
|
|
7144
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
7145
|
+
}
|
|
7146
|
+
function isPrintable(c) {
|
|
7147
|
+
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
|
|
7148
|
+
}
|
|
7149
|
+
function isNsCharOrWhitespace(c) {
|
|
7150
|
+
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
7151
|
+
}
|
|
7152
|
+
function isPlainSafe(c, prev, inblock) {
|
|
7153
|
+
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
7154
|
+
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
7155
|
+
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
|
|
7156
|
+
}
|
|
7157
|
+
function isPlainSafeFirst(c) {
|
|
7158
|
+
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
7159
|
+
}
|
|
7160
|
+
function isPlainSafeLast(c) {
|
|
7161
|
+
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
7162
|
+
}
|
|
7163
|
+
function codePointAt(string, pos) {
|
|
7164
|
+
var first = string.charCodeAt(pos), second;
|
|
7165
|
+
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
|
|
7166
|
+
second = string.charCodeAt(pos + 1);
|
|
7167
|
+
if (second >= 56320 && second <= 57343) return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
7168
|
+
}
|
|
7169
|
+
return first;
|
|
7170
|
+
}
|
|
7171
|
+
function needIndentIndicator(string) {
|
|
7172
|
+
return /^\n* /.test(string);
|
|
7173
|
+
}
|
|
7174
|
+
var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
|
|
7175
|
+
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
7176
|
+
var i;
|
|
7177
|
+
var char = 0;
|
|
7178
|
+
var prevChar = null;
|
|
7179
|
+
var hasLineBreak = false;
|
|
7180
|
+
var hasFoldableLine = false;
|
|
7181
|
+
var shouldTrackWidth = lineWidth !== -1;
|
|
7182
|
+
var previousLineBreak = -1;
|
|
7183
|
+
var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
7184
|
+
if (singleLineOnly || forceQuotes) for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
7185
|
+
char = codePointAt(string, i);
|
|
7186
|
+
if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
7187
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
7188
|
+
prevChar = char;
|
|
7189
|
+
}
|
|
7190
|
+
else {
|
|
7191
|
+
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
7192
|
+
char = codePointAt(string, i);
|
|
7193
|
+
if (char === CHAR_LINE_FEED) {
|
|
7194
|
+
hasLineBreak = true;
|
|
7195
|
+
if (shouldTrackWidth) {
|
|
7196
|
+
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
7197
|
+
previousLineBreak = i;
|
|
7198
|
+
}
|
|
7199
|
+
} else if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
7200
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
7201
|
+
prevChar = char;
|
|
7202
|
+
}
|
|
7203
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
7204
|
+
}
|
|
7205
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
7206
|
+
if (plain && !forceQuotes && !testAmbiguousType(string)) return STYLE_PLAIN;
|
|
7207
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
7208
|
+
}
|
|
7209
|
+
if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
|
|
7210
|
+
if (!forceQuotes) return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
7211
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
7212
|
+
}
|
|
7213
|
+
function writeScalar(state, string, level, iskey, inblock) {
|
|
7214
|
+
state.dump = function() {
|
|
7215
|
+
if (string.length === 0) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"\"" : "''";
|
|
7216
|
+
if (!state.noCompatMode) {
|
|
7217
|
+
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"" + string + "\"" : "'" + string + "'";
|
|
7218
|
+
}
|
|
7219
|
+
var indent = state.indent * Math.max(1, level);
|
|
7220
|
+
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
7221
|
+
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
7222
|
+
function testAmbiguity(string) {
|
|
7223
|
+
return testImplicitResolving(state, string);
|
|
7224
|
+
}
|
|
7225
|
+
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
|
|
7226
|
+
case STYLE_PLAIN: return string;
|
|
7227
|
+
case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'";
|
|
7228
|
+
case STYLE_LITERAL: return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
7229
|
+
case STYLE_FOLDED: return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
7230
|
+
case STYLE_DOUBLE: return "\"" + escapeString(string) + "\"";
|
|
7231
|
+
default: throw new exception("impossible error: invalid scalar style");
|
|
7232
|
+
}
|
|
7233
|
+
}();
|
|
7234
|
+
}
|
|
7235
|
+
function blockHeader(string, indentPerLevel) {
|
|
7236
|
+
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
7237
|
+
var clip = string[string.length - 1] === "\n";
|
|
7238
|
+
return indentIndicator + (clip && (string[string.length - 2] === "\n" || string === "\n") ? "+" : clip ? "" : "-") + "\n";
|
|
7239
|
+
}
|
|
7240
|
+
function dropEndingNewline(string) {
|
|
7241
|
+
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
7242
|
+
}
|
|
7243
|
+
function foldString(string, width) {
|
|
7244
|
+
var lineRe = /(\n+)([^\n]*)/g;
|
|
7245
|
+
var result = function() {
|
|
7246
|
+
var nextLF = string.indexOf("\n");
|
|
7247
|
+
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
7248
|
+
lineRe.lastIndex = nextLF;
|
|
7249
|
+
return foldLine(string.slice(0, nextLF), width);
|
|
7250
|
+
}();
|
|
7251
|
+
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
7252
|
+
var moreIndented;
|
|
7253
|
+
var match;
|
|
7254
|
+
while (match = lineRe.exec(string)) {
|
|
7255
|
+
var prefix = match[1], line = match[2];
|
|
7256
|
+
moreIndented = line[0] === " ";
|
|
7257
|
+
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
7258
|
+
prevMoreIndented = moreIndented;
|
|
7259
|
+
}
|
|
7260
|
+
return result;
|
|
7261
|
+
}
|
|
7262
|
+
function foldLine(line, width) {
|
|
7263
|
+
if (line === "" || line[0] === " ") return line;
|
|
7264
|
+
var breakRe = / [^ ]/g;
|
|
7265
|
+
var match;
|
|
7266
|
+
var start = 0, end, curr = 0, next = 0;
|
|
7267
|
+
var result = "";
|
|
7268
|
+
while (match = breakRe.exec(line)) {
|
|
7269
|
+
next = match.index;
|
|
7270
|
+
if (next - start > width) {
|
|
7271
|
+
end = curr > start ? curr : next;
|
|
7272
|
+
result += "\n" + line.slice(start, end);
|
|
7273
|
+
start = end + 1;
|
|
7274
|
+
}
|
|
7275
|
+
curr = next;
|
|
7276
|
+
}
|
|
7277
|
+
result += "\n";
|
|
7278
|
+
if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
7279
|
+
else result += line.slice(start);
|
|
7280
|
+
return result.slice(1);
|
|
7281
|
+
}
|
|
7282
|
+
function escapeString(string) {
|
|
7283
|
+
var result = "";
|
|
7284
|
+
var char = 0;
|
|
7285
|
+
var escapeSeq;
|
|
7286
|
+
for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
7287
|
+
char = codePointAt(string, i);
|
|
7288
|
+
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
7289
|
+
if (!escapeSeq && isPrintable(char)) {
|
|
7290
|
+
result += string[i];
|
|
7291
|
+
if (char >= 65536) result += string[i + 1];
|
|
7292
|
+
} else result += escapeSeq || encodeHex(char);
|
|
7293
|
+
}
|
|
7294
|
+
return result;
|
|
7295
|
+
}
|
|
7296
|
+
function writeFlowSequence(state, level, object) {
|
|
7297
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
7298
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
7299
|
+
value = object[index];
|
|
7300
|
+
if (state.replacer) value = state.replacer.call(object, String(index), value);
|
|
7301
|
+
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
|
|
7302
|
+
if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
|
|
7303
|
+
_result += state.dump;
|
|
7304
|
+
}
|
|
7305
|
+
}
|
|
7306
|
+
state.tag = _tag;
|
|
7307
|
+
state.dump = "[" + _result + "]";
|
|
7308
|
+
}
|
|
7309
|
+
function writeBlockSequence(state, level, object, compact) {
|
|
7310
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
7311
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
7312
|
+
value = object[index];
|
|
7313
|
+
if (state.replacer) value = state.replacer.call(object, String(index), value);
|
|
7314
|
+
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
7315
|
+
if (!compact || _result !== "") _result += generateNextLine(state, level);
|
|
7316
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-";
|
|
7317
|
+
else _result += "- ";
|
|
7318
|
+
_result += state.dump;
|
|
7319
|
+
}
|
|
7320
|
+
}
|
|
7321
|
+
state.tag = _tag;
|
|
7322
|
+
state.dump = _result || "[]";
|
|
7323
|
+
}
|
|
7324
|
+
function writeFlowMapping(state, level, object) {
|
|
7325
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
7326
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
7327
|
+
pairBuffer = "";
|
|
7328
|
+
if (_result !== "") pairBuffer += ", ";
|
|
7329
|
+
if (state.condenseFlow) pairBuffer += "\"";
|
|
7330
|
+
objectKey = objectKeyList[index];
|
|
7331
|
+
objectValue = object[objectKey];
|
|
7332
|
+
if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
7333
|
+
if (!writeNode(state, level, objectKey, false, false)) continue;
|
|
7334
|
+
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
7335
|
+
pairBuffer += state.dump + (state.condenseFlow ? "\"" : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
7336
|
+
if (!writeNode(state, level, objectValue, false, false)) continue;
|
|
7337
|
+
pairBuffer += state.dump;
|
|
7338
|
+
_result += pairBuffer;
|
|
7339
|
+
}
|
|
7340
|
+
state.tag = _tag;
|
|
7341
|
+
state.dump = "{" + _result + "}";
|
|
7342
|
+
}
|
|
7343
|
+
function writeBlockMapping(state, level, object, compact) {
|
|
7344
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
7345
|
+
if (state.sortKeys === true) objectKeyList.sort();
|
|
7346
|
+
else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys);
|
|
7347
|
+
else if (state.sortKeys) throw new exception("sortKeys must be a boolean or a function");
|
|
7348
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
7349
|
+
pairBuffer = "";
|
|
7350
|
+
if (!compact || _result !== "") pairBuffer += generateNextLine(state, level);
|
|
7351
|
+
objectKey = objectKeyList[index];
|
|
7352
|
+
objectValue = object[objectKey];
|
|
7353
|
+
if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
7354
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) continue;
|
|
7355
|
+
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
7356
|
+
if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?";
|
|
7357
|
+
else pairBuffer += "? ";
|
|
7358
|
+
pairBuffer += state.dump;
|
|
7359
|
+
if (explicitPair) pairBuffer += generateNextLine(state, level);
|
|
7360
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) continue;
|
|
7361
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
|
|
7362
|
+
else pairBuffer += ": ";
|
|
7363
|
+
pairBuffer += state.dump;
|
|
7364
|
+
_result += pairBuffer;
|
|
7365
|
+
}
|
|
7366
|
+
state.tag = _tag;
|
|
7367
|
+
state.dump = _result || "{}";
|
|
7368
|
+
}
|
|
7369
|
+
function detectType(state, object, explicit) {
|
|
7370
|
+
var _result, typeList = explicit ? state.explicitTypes : state.implicitTypes, index, length, type, style;
|
|
7371
|
+
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
7372
|
+
type = typeList[index];
|
|
7373
|
+
if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
|
|
7374
|
+
if (explicit) if (type.multi && type.representName) state.tag = type.representName(object);
|
|
7375
|
+
else state.tag = type.tag;
|
|
7376
|
+
else state.tag = "?";
|
|
7377
|
+
if (type.represent) {
|
|
7378
|
+
style = state.styleMap[type.tag] || type.defaultStyle;
|
|
7379
|
+
if (_toString.call(type.represent) === "[object Function]") _result = type.represent(object, style);
|
|
7380
|
+
else if (_hasOwnProperty.call(type.represent, style)) _result = type.represent[style](object, style);
|
|
7381
|
+
else throw new exception("!<" + type.tag + "> tag resolver accepts not \"" + style + "\" style");
|
|
7382
|
+
state.dump = _result;
|
|
7383
|
+
}
|
|
7384
|
+
return true;
|
|
7385
|
+
}
|
|
7386
|
+
}
|
|
7387
|
+
return false;
|
|
7388
|
+
}
|
|
7389
|
+
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
|
|
7390
|
+
state.tag = null;
|
|
7391
|
+
state.dump = object;
|
|
7392
|
+
if (!detectType(state, object, false)) detectType(state, object, true);
|
|
7393
|
+
var type = _toString.call(state.dump);
|
|
7394
|
+
var inblock = block;
|
|
7395
|
+
var tagStr;
|
|
7396
|
+
if (block) block = state.flowLevel < 0 || state.flowLevel > level;
|
|
7397
|
+
var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
|
|
7398
|
+
if (objectOrArray) {
|
|
7399
|
+
duplicateIndex = state.duplicates.indexOf(object);
|
|
7400
|
+
duplicate = duplicateIndex !== -1;
|
|
7401
|
+
}
|
|
7402
|
+
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) compact = false;
|
|
7403
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex;
|
|
7404
|
+
else {
|
|
7405
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true;
|
|
7406
|
+
if (type === "[object Object]") if (block && Object.keys(state.dump).length !== 0) {
|
|
7407
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
7408
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
7409
|
+
} else {
|
|
7410
|
+
writeFlowMapping(state, level, state.dump);
|
|
7411
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
7412
|
+
}
|
|
7413
|
+
else if (type === "[object Array]") if (block && state.dump.length !== 0) {
|
|
7414
|
+
if (state.noArrayIndent && !isblockseq && level > 0) writeBlockSequence(state, level - 1, state.dump, compact);
|
|
7415
|
+
else writeBlockSequence(state, level, state.dump, compact);
|
|
7416
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
7417
|
+
} else {
|
|
7418
|
+
writeFlowSequence(state, level, state.dump);
|
|
7419
|
+
if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
7420
|
+
}
|
|
7421
|
+
else if (type === "[object String]") {
|
|
7422
|
+
if (state.tag !== "?") writeScalar(state, state.dump, level, iskey, inblock);
|
|
7423
|
+
} else if (type === "[object Undefined]") return false;
|
|
7424
|
+
else {
|
|
7425
|
+
if (state.skipInvalid) return false;
|
|
7426
|
+
throw new exception("unacceptable kind of an object to dump " + type);
|
|
7427
|
+
}
|
|
7428
|
+
if (state.tag !== null && state.tag !== "?") {
|
|
7429
|
+
tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
|
|
7430
|
+
if (state.tag[0] === "!") tagStr = "!" + tagStr;
|
|
7431
|
+
else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") tagStr = "!!" + tagStr.slice(18);
|
|
7432
|
+
else tagStr = "!<" + tagStr + ">";
|
|
7433
|
+
state.dump = tagStr + " " + state.dump;
|
|
7434
|
+
}
|
|
7435
|
+
}
|
|
7436
|
+
return true;
|
|
7437
|
+
}
|
|
7438
|
+
function getDuplicateReferences(object, state) {
|
|
7439
|
+
var objects = [], duplicatesIndexes = [], index, length;
|
|
7440
|
+
inspectNode(object, objects, duplicatesIndexes);
|
|
7441
|
+
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
7442
|
+
state.usedDuplicates = new Array(length);
|
|
7443
|
+
}
|
|
7444
|
+
function inspectNode(object, objects, duplicatesIndexes) {
|
|
7445
|
+
var objectKeyList, index, length;
|
|
7446
|
+
if (object !== null && typeof object === "object") {
|
|
7447
|
+
index = objects.indexOf(object);
|
|
7448
|
+
if (index !== -1) {
|
|
7449
|
+
if (duplicatesIndexes.indexOf(index) === -1) duplicatesIndexes.push(index);
|
|
7450
|
+
} else {
|
|
7451
|
+
objects.push(object);
|
|
7452
|
+
if (Array.isArray(object)) for (index = 0, length = object.length; index < length; index += 1) inspectNode(object[index], objects, duplicatesIndexes);
|
|
7453
|
+
else {
|
|
7454
|
+
objectKeyList = Object.keys(object);
|
|
7455
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
7456
|
+
}
|
|
7457
|
+
}
|
|
7458
|
+
}
|
|
7459
|
+
}
|
|
7460
|
+
function dump$1(input, options) {
|
|
7461
|
+
options = options || {};
|
|
7462
|
+
var state = new State(options);
|
|
7463
|
+
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
7464
|
+
var value = input;
|
|
7465
|
+
if (state.replacer) value = state.replacer.call({ "": value }, "", value);
|
|
7466
|
+
if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
|
|
7467
|
+
return "";
|
|
7468
|
+
}
|
|
7469
|
+
var dumper = { dump: dump$1 };
|
|
7470
|
+
function renamed(from, to) {
|
|
7471
|
+
return function() {
|
|
7472
|
+
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
7473
|
+
};
|
|
7474
|
+
}
|
|
7475
|
+
var load = loader.load;
|
|
7476
|
+
loader.loadAll;
|
|
7477
|
+
dumper.dump;
|
|
7478
|
+
renamed("safeLoad", "load");
|
|
7479
|
+
renamed("safeLoadAll", "loadAll");
|
|
7480
|
+
renamed("safeDump", "dump");
|
|
7481
|
+
/**
|
|
7482
|
+
* @file get-workspaces-raw-path.ts
|
|
7483
|
+
* Parser for extracting workspace path globs from JSON and YAML configuration files.
|
|
7484
|
+
*/
|
|
7485
|
+
/**
|
|
7486
|
+
* Reads workspace paths from configuration files (JSON or YAML).
|
|
7487
|
+
*
|
|
7488
|
+
* @param configPath - The path to the config file (e.g., package.json, pnpm-workspace.yaml).
|
|
7489
|
+
* @param parser - The parser type to use for reading the file ('json' or 'yaml').
|
|
7490
|
+
* @param property - The property name in the config containing workspace paths (defaults to 'workspaces').
|
|
7491
|
+
* @returns Array of raw workspace path patterns.
|
|
7492
|
+
* @example
|
|
7493
|
+
* ```ts
|
|
7494
|
+
* getWorkspacesRawPath('package.json', 'json', 'workspaces');
|
|
7495
|
+
* getWorkspacesRawPath('pnpm-workspace.yaml', 'yaml', 'packages');
|
|
7496
|
+
* ```
|
|
7497
|
+
*/
|
|
7498
|
+
function getWorkspacesRawPath(configPath, parser, property = "workspaces") {
|
|
7499
|
+
const rawWorkspacesPaths = [];
|
|
7500
|
+
if (existsSync(configPath)) {
|
|
7501
|
+
const asString = readFileSync(configPath, "utf8");
|
|
7502
|
+
let parsed;
|
|
7503
|
+
if (parser === "json") parsed = JSON.parse(asString);
|
|
7504
|
+
else if (parser === "yaml") parsed = load(asString);
|
|
7505
|
+
else throw new Error(`Unsupported parser type: ${parser}`);
|
|
7506
|
+
const workspaces = parsed[property];
|
|
7507
|
+
if (Array.isArray(workspaces)) for (const project of workspaces) rawWorkspacesPaths.push(project);
|
|
7508
|
+
}
|
|
7509
|
+
return rawWorkspacesPaths;
|
|
7510
|
+
}
|
|
5651
7511
|
/**
|
|
5652
7512
|
* @file get-scopes.ts
|
|
5653
7513
|
* Discovers and gathers workspace package scopes in a monorepo or standard repository.
|
|
@@ -5693,6 +7553,36 @@ function getScopes(cwd = process.cwd()) {
|
|
|
5693
7553
|
}
|
|
5694
7554
|
return [...workspaces];
|
|
5695
7555
|
}
|
|
7556
|
+
/**
|
|
7557
|
+
* @file scopes.ts
|
|
7558
|
+
* Scopes constants and scope enumeration generator for commitlint, cz-git, and Commitizen.
|
|
7559
|
+
*/
|
|
7560
|
+
/**
|
|
7561
|
+
* Scope identifier for repository-wide or workspace-level changes.
|
|
7562
|
+
*/
|
|
7563
|
+
const SCOPE_WORKSPACE = "workspace";
|
|
7564
|
+
/**
|
|
7565
|
+
* Scope identifier for release and versioning commits.
|
|
7566
|
+
*/
|
|
7567
|
+
const SCOPE_RELEASE = "release";
|
|
7568
|
+
/**
|
|
7569
|
+
* Array of all valid commit scopes, including workspace, release, and discovered monorepo packages.
|
|
7570
|
+
*/
|
|
7571
|
+
const scopesArray = [
|
|
7572
|
+
SCOPE_WORKSPACE,
|
|
7573
|
+
SCOPE_RELEASE,
|
|
7574
|
+
...getScopes()
|
|
7575
|
+
];
|
|
7576
|
+
/**
|
|
7577
|
+
* Record of scopes mapped to their human-readable descriptions for Commitizen interactive prompt.
|
|
7578
|
+
*/
|
|
7579
|
+
const scopesEnum = {};
|
|
7580
|
+
for (const scope of scopesArray) Object.defineProperty(scopesEnum, scope, {
|
|
7581
|
+
value: { description: getScopeDescription(scope) },
|
|
7582
|
+
enumerable: true,
|
|
7583
|
+
writable: true,
|
|
7584
|
+
configurable: true
|
|
7585
|
+
});
|
|
5696
7586
|
|
|
5697
7587
|
//#endregion
|
|
5698
|
-
export {
|
|
7588
|
+
export { scopesArray as n, scopesEnum as r, COMMIT_TYPES as t };
|