xcstrings-cli 2.1.0 → 2.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/README.md +39 -1
- package/dist/index.js +1274 -1151
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import { hideBin as
|
|
4
|
-
import { resolve as
|
|
5
|
-
import { cosmiconfig as
|
|
6
|
-
import
|
|
7
|
-
import { select as
|
|
8
|
-
import
|
|
9
|
-
import { readFile as
|
|
10
|
-
import { XcodeProject as
|
|
11
|
-
const
|
|
2
|
+
import Nr from "yargs";
|
|
3
|
+
import { hideBin as Rr } from "yargs/helpers";
|
|
4
|
+
import { resolve as Oe, relative as we } from "node:path";
|
|
5
|
+
import { cosmiconfig as Pr } from "cosmiconfig";
|
|
6
|
+
import De from "json5";
|
|
7
|
+
import { select as Mr, checkbox as an, confirm as Dr } from "@inquirer/prompts";
|
|
8
|
+
import k from "chalk";
|
|
9
|
+
import { readFile as $r, writeFile as Nn, readdir as Rn } from "node:fs/promises";
|
|
10
|
+
import { XcodeProject as Br } from "@bacons/xcode";
|
|
11
|
+
const Le = "xcstrings-cli", sn = Pr(Le, {
|
|
12
12
|
searchPlaces: [
|
|
13
|
-
`${
|
|
14
|
-
`${
|
|
13
|
+
`${Le}.json`,
|
|
14
|
+
`${Le}.json5`
|
|
15
15
|
],
|
|
16
16
|
loaders: {
|
|
17
|
-
".json5": async (e, n) =>
|
|
17
|
+
".json5": async (e, n) => De.parse(n)
|
|
18
18
|
},
|
|
19
19
|
cache: !1
|
|
20
20
|
});
|
|
21
|
-
async function
|
|
21
|
+
async function We(e) {
|
|
22
22
|
if (e) {
|
|
23
|
-
const r = await
|
|
23
|
+
const r = await sn.load(e);
|
|
24
24
|
return r ? r.config : null;
|
|
25
25
|
}
|
|
26
|
-
const n = await
|
|
26
|
+
const n = await sn.search();
|
|
27
27
|
return n ? n.config : null;
|
|
28
28
|
}
|
|
29
29
|
function cn(e, n) {
|
|
@@ -33,72 +33,73 @@ function cn(e, n) {
|
|
|
33
33
|
return r.path;
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
|
-
async function
|
|
37
|
-
const i = n?.xcstringsPaths, t = i?.some((
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
41
|
-
throw new Error(`Unknown alias: ${
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
36
|
+
async function zr(e, n, r) {
|
|
37
|
+
const i = n?.xcstringsPaths, t = i?.some((s) => typeof s != "string") ?? !1, o = e.startsWith("alias:") ? e.slice(6) : null;
|
|
38
|
+
if (o) {
|
|
39
|
+
const s = cn(i, o);
|
|
40
|
+
if (!s)
|
|
41
|
+
throw new Error(`Unknown alias: ${o}`);
|
|
42
|
+
return s;
|
|
43
|
+
}
|
|
44
|
+
const l = cn(i, e);
|
|
45
|
+
if (l)
|
|
46
|
+
return l;
|
|
47
47
|
const a = !e.includes("/") && !e.endsWith(".xcstrings");
|
|
48
48
|
if (t && a)
|
|
49
49
|
throw new Error(`Unknown alias: ${e}`);
|
|
50
50
|
if (e === r && i && i.length > 0) {
|
|
51
51
|
if (i.length === 1) {
|
|
52
|
-
const
|
|
53
|
-
return typeof
|
|
52
|
+
const u = i[0];
|
|
53
|
+
return typeof u == "string" ? u : u.path;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
return await
|
|
55
|
+
const s = i.map((u) => typeof u == "string" ? { name: u, value: u } : { name: `${u.alias} (${u.path})`, value: u.path });
|
|
56
|
+
return await Mr({
|
|
57
57
|
message: "Select xcstrings file:",
|
|
58
|
-
choices:
|
|
58
|
+
choices: s
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
return e;
|
|
62
62
|
}
|
|
63
|
+
const $e = ["translated", "needs_review", "new", "stale"];
|
|
63
64
|
async function me(e) {
|
|
64
|
-
const n = await
|
|
65
|
+
const n = await $r(e, "utf-8");
|
|
65
66
|
return JSON.parse(n);
|
|
66
67
|
}
|
|
67
|
-
async function
|
|
68
|
-
const r = JSON.stringify(n, null, 2), i =
|
|
69
|
-
await
|
|
68
|
+
async function Pn(e, n) {
|
|
69
|
+
const r = JSON.stringify(n, null, 2), i = Ur(r);
|
|
70
|
+
await Nn(e, i + `
|
|
70
71
|
`, "utf-8");
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function Ur(e) {
|
|
73
74
|
let n = "", r = !1, i = !1;
|
|
74
75
|
for (let t = 0; t < e.length; t++) {
|
|
75
|
-
const
|
|
76
|
-
if (r &&
|
|
77
|
-
i = !0, n +=
|
|
76
|
+
const o = e[t];
|
|
77
|
+
if (r && o === "\\" && !i) {
|
|
78
|
+
i = !0, n += o;
|
|
78
79
|
continue;
|
|
79
80
|
}
|
|
80
81
|
if (i) {
|
|
81
|
-
i = !1, n +=
|
|
82
|
+
i = !1, n += o;
|
|
82
83
|
continue;
|
|
83
84
|
}
|
|
84
|
-
if (
|
|
85
|
-
r = !r, n +=
|
|
85
|
+
if (o === '"') {
|
|
86
|
+
r = !r, n += o;
|
|
86
87
|
continue;
|
|
87
88
|
}
|
|
88
|
-
if (!r &&
|
|
89
|
+
if (!r && o === ":") {
|
|
89
90
|
n += " :";
|
|
90
91
|
continue;
|
|
91
92
|
}
|
|
92
|
-
n +=
|
|
93
|
+
n += o;
|
|
93
94
|
}
|
|
94
95
|
return n;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function Yr(e) {
|
|
97
98
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
98
99
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
101
|
-
if (un) return
|
|
100
|
+
var ce = { exports: {} }, je, un;
|
|
101
|
+
function Hr() {
|
|
102
|
+
if (un) return je;
|
|
102
103
|
un = 1;
|
|
103
104
|
function e(r) {
|
|
104
105
|
try {
|
|
@@ -107,91 +108,91 @@ function Ur() {
|
|
|
107
108
|
return '"[Circular]"';
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
+
je = n;
|
|
111
112
|
function n(r, i, t) {
|
|
112
|
-
var
|
|
113
|
+
var o = t && t.stringify || e, l = 1;
|
|
113
114
|
if (typeof r == "object" && r !== null) {
|
|
114
|
-
var a = i.length +
|
|
115
|
+
var a = i.length + l;
|
|
115
116
|
if (a === 1) return r;
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
for (var
|
|
119
|
-
c
|
|
120
|
-
return
|
|
117
|
+
var s = new Array(a);
|
|
118
|
+
s[0] = o(r);
|
|
119
|
+
for (var c = 1; c < a; c++)
|
|
120
|
+
s[c] = o(i[c]);
|
|
121
|
+
return s.join(" ");
|
|
121
122
|
}
|
|
122
123
|
if (typeof r != "string")
|
|
123
124
|
return r;
|
|
124
|
-
var
|
|
125
|
-
if (
|
|
126
|
-
for (var f = "",
|
|
127
|
-
if (r.charCodeAt(
|
|
128
|
-
switch (
|
|
125
|
+
var u = i.length;
|
|
126
|
+
if (u === 0) return r;
|
|
127
|
+
for (var f = "", d = 1 - l, g = -1, v = r && r.length || 0, h = 0; h < v; ) {
|
|
128
|
+
if (r.charCodeAt(h) === 37 && h + 1 < v) {
|
|
129
|
+
switch (g = g > -1 ? g : 0, r.charCodeAt(h + 1)) {
|
|
129
130
|
case 100:
|
|
130
131
|
// 'd'
|
|
131
132
|
case 102:
|
|
132
|
-
if (
|
|
133
|
-
|
|
133
|
+
if (d >= u || i[d] == null) break;
|
|
134
|
+
g < h && (f += r.slice(g, h)), f += Number(i[d]), g = h + 2, h++;
|
|
134
135
|
break;
|
|
135
136
|
case 105:
|
|
136
|
-
if (
|
|
137
|
-
|
|
137
|
+
if (d >= u || i[d] == null) break;
|
|
138
|
+
g < h && (f += r.slice(g, h)), f += Math.floor(Number(i[d])), g = h + 2, h++;
|
|
138
139
|
break;
|
|
139
140
|
case 79:
|
|
140
141
|
// 'O'
|
|
141
142
|
case 111:
|
|
142
143
|
// 'o'
|
|
143
144
|
case 106:
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
var A = typeof i[
|
|
145
|
+
if (d >= u || i[d] === void 0) break;
|
|
146
|
+
g < h && (f += r.slice(g, h));
|
|
147
|
+
var A = typeof i[d];
|
|
147
148
|
if (A === "string") {
|
|
148
|
-
f += "'" + i[
|
|
149
|
+
f += "'" + i[d] + "'", g = h + 2, h++;
|
|
149
150
|
break;
|
|
150
151
|
}
|
|
151
152
|
if (A === "function") {
|
|
152
|
-
f += i[
|
|
153
|
+
f += i[d].name || "<anonymous>", g = h + 2, h++;
|
|
153
154
|
break;
|
|
154
155
|
}
|
|
155
|
-
f +=
|
|
156
|
+
f += o(i[d]), g = h + 2, h++;
|
|
156
157
|
break;
|
|
157
158
|
case 115:
|
|
158
|
-
if (
|
|
159
|
+
if (d >= u)
|
|
159
160
|
break;
|
|
160
|
-
|
|
161
|
+
g < h && (f += r.slice(g, h)), f += String(i[d]), g = h + 2, h++;
|
|
161
162
|
break;
|
|
162
163
|
case 37:
|
|
163
|
-
|
|
164
|
+
g < h && (f += r.slice(g, h)), f += "%", g = h + 2, h++, d--;
|
|
164
165
|
break;
|
|
165
166
|
}
|
|
166
|
-
++
|
|
167
|
+
++d;
|
|
167
168
|
}
|
|
168
|
-
++
|
|
169
|
+
++h;
|
|
169
170
|
}
|
|
170
|
-
return
|
|
171
|
-
}
|
|
172
|
-
return
|
|
173
|
-
}
|
|
174
|
-
var
|
|
175
|
-
function
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
const e =
|
|
179
|
-
|
|
180
|
-
const n =
|
|
181
|
-
mapHttpRequest:
|
|
182
|
-
mapHttpResponse:
|
|
183
|
-
wrapRequestSerializer:
|
|
184
|
-
wrapResponseSerializer:
|
|
185
|
-
wrapErrorSerializer:
|
|
186
|
-
req:
|
|
187
|
-
res:
|
|
188
|
-
err:
|
|
189
|
-
errWithCause:
|
|
171
|
+
return g === -1 ? r : (g < v && (f += r.slice(g)), f);
|
|
172
|
+
}
|
|
173
|
+
return je;
|
|
174
|
+
}
|
|
175
|
+
var fn;
|
|
176
|
+
function Kr() {
|
|
177
|
+
if (fn) return ce.exports;
|
|
178
|
+
fn = 1;
|
|
179
|
+
const e = Hr();
|
|
180
|
+
ce.exports = u;
|
|
181
|
+
const n = Lr().console || {}, r = {
|
|
182
|
+
mapHttpRequest: V,
|
|
183
|
+
mapHttpResponse: V,
|
|
184
|
+
wrapRequestSerializer: I,
|
|
185
|
+
wrapResponseSerializer: I,
|
|
186
|
+
wrapErrorSerializer: I,
|
|
187
|
+
req: V,
|
|
188
|
+
res: V,
|
|
189
|
+
err: R,
|
|
190
|
+
errWithCause: R
|
|
190
191
|
};
|
|
191
192
|
function i(p, m) {
|
|
192
193
|
return p === "silent" ? 1 / 0 : m.levels.values[p];
|
|
193
194
|
}
|
|
194
|
-
const t = Symbol("pino.logFuncs"),
|
|
195
|
+
const t = Symbol("pino.logFuncs"), o = Symbol("pino.hierarchy"), l = {
|
|
195
196
|
error: "log",
|
|
196
197
|
fatal: "error",
|
|
197
198
|
warn: "error",
|
|
@@ -200,100 +201,100 @@ function Yr() {
|
|
|
200
201
|
trace: "log"
|
|
201
202
|
};
|
|
202
203
|
function a(p, m) {
|
|
203
|
-
const
|
|
204
|
+
const b = {
|
|
204
205
|
logger: m,
|
|
205
|
-
parent: p[
|
|
206
|
+
parent: p[o]
|
|
206
207
|
};
|
|
207
|
-
m[
|
|
208
|
+
m[o] = b;
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
+
function s(p, m, b) {
|
|
210
211
|
const S = {};
|
|
211
|
-
m.forEach((
|
|
212
|
-
S[
|
|
212
|
+
m.forEach((E) => {
|
|
213
|
+
S[E] = b[E] ? b[E] : n[E] || n[l[E] || "log"] || se;
|
|
213
214
|
}), p[t] = S;
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
+
function c(p, m) {
|
|
216
217
|
return Array.isArray(p) ? p.filter(function(S) {
|
|
217
218
|
return S !== "!stdSerializers.err";
|
|
218
219
|
}) : p === !0 ? Object.keys(m) : !1;
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
+
function u(p) {
|
|
221
222
|
p = p || {}, p.browser = p.browser || {};
|
|
222
223
|
const m = p.browser.transmit;
|
|
223
224
|
if (m && typeof m.send != "function")
|
|
224
225
|
throw Error("pino: transmit option must have a send function");
|
|
225
|
-
const
|
|
226
|
+
const b = p.browser.write || n;
|
|
226
227
|
p.browser.write && (p.browser.asObject = !0);
|
|
227
|
-
const S = p.serializers || {},
|
|
228
|
-
let
|
|
229
|
-
Array.isArray(p.browser.serialize) && p.browser.serialize.indexOf("!stdSerializers.err") > -1 && (
|
|
230
|
-
const
|
|
231
|
-
typeof
|
|
232
|
-
|
|
228
|
+
const S = p.serializers || {}, E = c(p.browser.serialize, S);
|
|
229
|
+
let B = p.browser.serialize;
|
|
230
|
+
Array.isArray(p.browser.serialize) && p.browser.serialize.indexOf("!stdSerializers.err") > -1 && (B = !1);
|
|
231
|
+
const K = Object.keys(p.customLevels || {}), O = ["error", "fatal", "warn", "info", "debug", "trace"].concat(K);
|
|
232
|
+
typeof b == "function" && O.forEach(function(z) {
|
|
233
|
+
b[z] = b;
|
|
233
234
|
}), (p.enabled === !1 || p.browser.disabled) && (p.level = "silent");
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
get:
|
|
237
|
-
}), Object.defineProperty(
|
|
238
|
-
get:
|
|
239
|
-
set:
|
|
235
|
+
const P = p.level || "info", w = Object.create(b);
|
|
236
|
+
w.log || (w.log = se), s(w, O, b), a({}, w), Object.defineProperty(w, "levelVal", {
|
|
237
|
+
get: ve
|
|
238
|
+
}), Object.defineProperty(w, "level", {
|
|
239
|
+
get: Z,
|
|
240
|
+
set: jr
|
|
240
241
|
});
|
|
241
|
-
const
|
|
242
|
+
const Y = {
|
|
242
243
|
transmit: m,
|
|
243
|
-
serialize:
|
|
244
|
+
serialize: E,
|
|
244
245
|
asObject: p.browser.asObject,
|
|
245
246
|
formatters: p.browser.formatters,
|
|
246
|
-
levels:
|
|
247
|
-
timestamp:
|
|
247
|
+
levels: O,
|
|
248
|
+
timestamp: J(p)
|
|
248
249
|
};
|
|
249
|
-
|
|
250
|
-
function
|
|
250
|
+
w.levels = f(p), w.level = P, w.setMaxListeners = w.getMaxListeners = w.emit = w.addListener = w.on = w.prependListener = w.once = w.prependOnceListener = w.removeListener = w.removeAllListeners = w.listeners = w.listenerCount = w.eventNames = w.write = w.flush = se, w.serializers = S, w._serialize = E, w._stdErrSerialize = B, w.child = Ir, m && (w._logEvent = L());
|
|
251
|
+
function ve() {
|
|
251
252
|
return i(this.level, this);
|
|
252
253
|
}
|
|
253
|
-
function
|
|
254
|
+
function Z() {
|
|
254
255
|
return this._level;
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
-
if (
|
|
258
|
-
throw Error("unknown level " +
|
|
259
|
-
this._level =
|
|
260
|
-
|
|
257
|
+
function jr(z) {
|
|
258
|
+
if (z !== "silent" && !this.levels.values[z])
|
|
259
|
+
throw Error("unknown level " + z);
|
|
260
|
+
this._level = z, v(this, Y, w, "error"), v(this, Y, w, "fatal"), v(this, Y, w, "warn"), v(this, Y, w, "info"), v(this, Y, w, "debug"), v(this, Y, w, "trace"), K.forEach((ee) => {
|
|
261
|
+
v(this, Y, w, ee);
|
|
261
262
|
});
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
-
if (!
|
|
264
|
+
function Ir(z, ee) {
|
|
265
|
+
if (!z)
|
|
265
266
|
throw new Error("missing bindings for child Pino");
|
|
266
|
-
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
269
|
-
var
|
|
270
|
-
delete
|
|
267
|
+
ee = ee || {}, E && z.serializers && (ee.serializers = z.serializers);
|
|
268
|
+
const rn = ee.serializers;
|
|
269
|
+
if (E && rn) {
|
|
270
|
+
var xe = Object.assign({}, S, rn), tn = p.browser.serialize === !0 ? Object.keys(xe) : E;
|
|
271
|
+
delete z.serializers, x([z], tn, xe, this._stdErrSerialize);
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
-
this._childLevel = (
|
|
274
|
-
[].concat(
|
|
273
|
+
function on(ln) {
|
|
274
|
+
this._childLevel = (ln._childLevel | 0) + 1, this.bindings = z, xe && (this.serializers = xe, this._serialize = tn), m && (this._logEvent = L(
|
|
275
|
+
[].concat(ln._logEvent.bindings, z)
|
|
275
276
|
));
|
|
276
277
|
}
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
return a(this,
|
|
278
|
+
on.prototype = this;
|
|
279
|
+
const Te = new on(this);
|
|
280
|
+
return a(this, Te), Te.level = this.level, Te;
|
|
280
281
|
}
|
|
281
|
-
return
|
|
282
|
+
return w;
|
|
282
283
|
}
|
|
283
284
|
function f(p) {
|
|
284
|
-
const m = p.customLevels || {},
|
|
285
|
+
const m = p.customLevels || {}, b = Object.assign({}, u.levels.values, m), S = Object.assign({}, u.levels.labels, d(m));
|
|
285
286
|
return {
|
|
286
|
-
values:
|
|
287
|
+
values: b,
|
|
287
288
|
labels: S
|
|
288
289
|
};
|
|
289
290
|
}
|
|
290
|
-
function
|
|
291
|
+
function d(p) {
|
|
291
292
|
const m = {};
|
|
292
|
-
return Object.keys(p).forEach(function(
|
|
293
|
-
m[p[
|
|
293
|
+
return Object.keys(p).forEach(function(b) {
|
|
294
|
+
m[p[b]] = b;
|
|
294
295
|
}), m;
|
|
295
296
|
}
|
|
296
|
-
|
|
297
|
+
u.levels = {
|
|
297
298
|
values: {
|
|
298
299
|
fatal: 60,
|
|
299
300
|
error: 50,
|
|
@@ -310,90 +311,90 @@ function Yr() {
|
|
|
310
311
|
50: "error",
|
|
311
312
|
60: "fatal"
|
|
312
313
|
}
|
|
313
|
-
},
|
|
314
|
-
function
|
|
314
|
+
}, u.stdSerializers = r, u.stdTimeFunctions = Object.assign({}, { nullTime: en, epochTime: nn, unixTime: Fr, isoTime: Tr });
|
|
315
|
+
function g(p) {
|
|
315
316
|
const m = [];
|
|
316
317
|
p.bindings && m.push(p.bindings);
|
|
317
|
-
let
|
|
318
|
-
for (;
|
|
319
|
-
|
|
318
|
+
let b = p[o];
|
|
319
|
+
for (; b.parent; )
|
|
320
|
+
b = b.parent, b.logger.bindings && m.push(b.logger.bindings);
|
|
320
321
|
return m.reverse();
|
|
321
322
|
}
|
|
322
|
-
function
|
|
323
|
+
function v(p, m, b, S) {
|
|
323
324
|
if (Object.defineProperty(p, S, {
|
|
324
|
-
value: i(p.level,
|
|
325
|
+
value: i(p.level, b) > i(S, b) ? se : b[t][S],
|
|
325
326
|
writable: !0,
|
|
326
327
|
enumerable: !0,
|
|
327
328
|
configurable: !0
|
|
328
|
-
}), !m.transmit && p[S] ===
|
|
329
|
+
}), !m.transmit && p[S] === se)
|
|
329
330
|
return;
|
|
330
|
-
p[S] = A(p, m,
|
|
331
|
-
const
|
|
332
|
-
|
|
331
|
+
p[S] = A(p, m, b, S);
|
|
332
|
+
const E = g(p);
|
|
333
|
+
E.length !== 0 && (p[S] = h(E, p[S]));
|
|
333
334
|
}
|
|
334
|
-
function
|
|
335
|
+
function h(p, m) {
|
|
335
336
|
return function() {
|
|
336
337
|
return m.apply(this, [...p, ...arguments]);
|
|
337
338
|
};
|
|
338
339
|
}
|
|
339
|
-
function A(p, m,
|
|
340
|
-
return /* @__PURE__ */ (function(
|
|
340
|
+
function A(p, m, b, S) {
|
|
341
|
+
return /* @__PURE__ */ (function(E) {
|
|
341
342
|
return function() {
|
|
342
|
-
const
|
|
343
|
-
for (var
|
|
344
|
-
if (m.serialize && !m.asObject &&
|
|
345
|
-
const
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
ts:
|
|
343
|
+
const K = m.timestamp(), O = new Array(arguments.length), P = Object.getPrototypeOf && Object.getPrototypeOf(this) === n ? n : this;
|
|
344
|
+
for (var w = 0; w < O.length; w++) O[w] = arguments[w];
|
|
345
|
+
if (m.serialize && !m.asObject && x(O, this._serialize, this.serializers, this._stdErrSerialize), m.asObject || m.formatters ? E.call(P, C(this, S, O, K, m.formatters)) : E.apply(P, O), m.transmit) {
|
|
346
|
+
const Y = m.transmit.level || p._level, ve = b.levels.values[Y], Z = b.levels.values[S];
|
|
347
|
+
if (Z < ve) return;
|
|
348
|
+
_(this, {
|
|
349
|
+
ts: K,
|
|
349
350
|
methodLevel: S,
|
|
350
|
-
methodValue:
|
|
351
|
-
transmitValue:
|
|
351
|
+
methodValue: Z,
|
|
352
|
+
transmitValue: b.levels.values[m.transmit.level || p._level],
|
|
352
353
|
send: m.transmit.send,
|
|
353
|
-
val: i(p._level,
|
|
354
|
-
},
|
|
354
|
+
val: i(p._level, b)
|
|
355
|
+
}, O);
|
|
355
356
|
}
|
|
356
357
|
};
|
|
357
358
|
})(p[t][S]);
|
|
358
359
|
}
|
|
359
|
-
function
|
|
360
|
+
function C(p, m, b, S, E = {}) {
|
|
360
361
|
const {
|
|
361
|
-
level:
|
|
362
|
-
log:
|
|
363
|
-
} =
|
|
364
|
-
p._serialize &&
|
|
365
|
-
const
|
|
366
|
-
let
|
|
367
|
-
const
|
|
368
|
-
S && (
|
|
369
|
-
let
|
|
370
|
-
if (
|
|
371
|
-
for (;
|
|
372
|
-
Object.assign(
|
|
373
|
-
|
|
374
|
-
} else typeof
|
|
375
|
-
return
|
|
376
|
-
}
|
|
377
|
-
function
|
|
378
|
-
for (const
|
|
379
|
-
if (S && p[
|
|
380
|
-
p[
|
|
381
|
-
else if (typeof p[
|
|
382
|
-
for (const
|
|
383
|
-
m && m.indexOf(
|
|
384
|
-
}
|
|
385
|
-
function
|
|
386
|
-
const S = m.send,
|
|
387
|
-
|
|
388
|
-
|
|
362
|
+
level: B = () => p.levels.values[m],
|
|
363
|
+
log: K = (Z) => Z
|
|
364
|
+
} = E;
|
|
365
|
+
p._serialize && x(b, p._serialize, p.serializers, p._stdErrSerialize);
|
|
366
|
+
const O = b.slice();
|
|
367
|
+
let P = O[0];
|
|
368
|
+
const w = {};
|
|
369
|
+
S && (w.time = S), w.level = B(m, p.levels.values[m]);
|
|
370
|
+
let Y = (p._childLevel | 0) + 1;
|
|
371
|
+
if (Y < 1 && (Y = 1), P !== null && typeof P == "object") {
|
|
372
|
+
for (; Y-- && typeof O[0] == "object"; )
|
|
373
|
+
Object.assign(w, O.shift());
|
|
374
|
+
P = O.length ? e(O.shift(), O) : void 0;
|
|
375
|
+
} else typeof P == "string" && (P = e(O.shift(), O));
|
|
376
|
+
return P !== void 0 && (w.msg = P), K(w);
|
|
377
|
+
}
|
|
378
|
+
function x(p, m, b, S) {
|
|
379
|
+
for (const E in p)
|
|
380
|
+
if (S && p[E] instanceof Error)
|
|
381
|
+
p[E] = u.stdSerializers.err(p[E]);
|
|
382
|
+
else if (typeof p[E] == "object" && !Array.isArray(p[E]))
|
|
383
|
+
for (const B in p[E])
|
|
384
|
+
m && m.indexOf(B) > -1 && B in b && (p[E][B] = b[B](p[E][B]));
|
|
385
|
+
}
|
|
386
|
+
function _(p, m, b) {
|
|
387
|
+
const S = m.send, E = m.ts, B = m.methodLevel, K = m.methodValue, O = m.val, P = p._logEvent.bindings;
|
|
388
|
+
x(
|
|
389
|
+
b,
|
|
389
390
|
p._serialize || Object.keys(p.serializers),
|
|
390
391
|
p.serializers,
|
|
391
392
|
p._stdErrSerialize === void 0 ? !0 : p._stdErrSerialize
|
|
392
|
-
), p._logEvent.ts =
|
|
393
|
-
return
|
|
394
|
-
}), p._logEvent.level.label =
|
|
393
|
+
), p._logEvent.ts = E, p._logEvent.messages = b.filter(function(w) {
|
|
394
|
+
return P.indexOf(w) === -1;
|
|
395
|
+
}), p._logEvent.level.label = B, p._logEvent.level.value = K, S(B, p._logEvent, O), p._logEvent = L(P);
|
|
395
396
|
}
|
|
396
|
-
function
|
|
397
|
+
function L(p) {
|
|
397
398
|
return {
|
|
398
399
|
ts: 0,
|
|
399
400
|
messages: [],
|
|
@@ -401,40 +402,40 @@ function Yr() {
|
|
|
401
402
|
level: { label: "", value: 0 }
|
|
402
403
|
};
|
|
403
404
|
}
|
|
404
|
-
function
|
|
405
|
+
function R(p) {
|
|
405
406
|
const m = {
|
|
406
407
|
type: p.constructor.name,
|
|
407
408
|
msg: p.message,
|
|
408
409
|
stack: p.stack
|
|
409
410
|
};
|
|
410
|
-
for (const
|
|
411
|
-
m[
|
|
411
|
+
for (const b in p)
|
|
412
|
+
m[b] === void 0 && (m[b] = p[b]);
|
|
412
413
|
return m;
|
|
413
414
|
}
|
|
414
|
-
function
|
|
415
|
-
return typeof p.timestamp == "function" ? p.timestamp : p.timestamp === !1 ?
|
|
415
|
+
function J(p) {
|
|
416
|
+
return typeof p.timestamp == "function" ? p.timestamp : p.timestamp === !1 ? en : nn;
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
+
function V() {
|
|
418
419
|
return {};
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
+
function I(p) {
|
|
421
422
|
return p;
|
|
422
423
|
}
|
|
423
|
-
function
|
|
424
|
+
function se() {
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
+
function en() {
|
|
426
427
|
return !1;
|
|
427
428
|
}
|
|
428
|
-
function
|
|
429
|
+
function nn() {
|
|
429
430
|
return Date.now();
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
+
function Fr() {
|
|
432
433
|
return Math.round(Date.now() / 1e3);
|
|
433
434
|
}
|
|
434
|
-
function
|
|
435
|
+
function Tr() {
|
|
435
436
|
return new Date(Date.now()).toISOString();
|
|
436
437
|
}
|
|
437
|
-
function
|
|
438
|
+
function Lr() {
|
|
438
439
|
function p(m) {
|
|
439
440
|
return typeof m < "u" && m;
|
|
440
441
|
}
|
|
@@ -449,27 +450,27 @@ function Yr() {
|
|
|
449
450
|
return p(self) || p(window) || p(this) || {};
|
|
450
451
|
}
|
|
451
452
|
}
|
|
452
|
-
return
|
|
453
|
+
return ce.exports.default = u, ce.exports.pino = u, ce.exports;
|
|
453
454
|
}
|
|
454
|
-
var
|
|
455
|
-
const
|
|
455
|
+
var Wr = Kr();
|
|
456
|
+
const qr = /* @__PURE__ */ Yr(Wr), X = qr({
|
|
456
457
|
level: process.env.LOG_LEVEL || "info"
|
|
457
458
|
});
|
|
458
|
-
function
|
|
459
|
+
function Gr() {
|
|
459
460
|
return {
|
|
460
461
|
command: "languages",
|
|
461
462
|
describe: "List supported languages from xcodeproj or xcstrings",
|
|
462
463
|
handler: async (e) => {
|
|
463
|
-
const n = await
|
|
464
|
-
|
|
464
|
+
const n = await Mn(e.path, e.config);
|
|
465
|
+
X.info(n.join(" "));
|
|
465
466
|
}
|
|
466
467
|
};
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
-
const n =
|
|
470
|
-
return (
|
|
469
|
+
function Vr(e) {
|
|
470
|
+
const n = Oe(e, "project.pbxproj");
|
|
471
|
+
return (Br.open(n).rootObject.props.knownRegions ?? []).filter((o) => o !== "Base").sort();
|
|
471
472
|
}
|
|
472
|
-
async function
|
|
473
|
+
async function Xr(e) {
|
|
473
474
|
const n = await me(e), r = /* @__PURE__ */ new Set();
|
|
474
475
|
if (!n.sourceLanguage)
|
|
475
476
|
throw new Error('The xcstrings file is missing "sourceLanguage".');
|
|
@@ -477,115 +478,115 @@ async function Wr(e) {
|
|
|
477
478
|
for (const i of Object.keys(n.strings)) {
|
|
478
479
|
const t = n.strings[i];
|
|
479
480
|
if (t.localizations)
|
|
480
|
-
for (const
|
|
481
|
-
r.add(
|
|
481
|
+
for (const o of Object.keys(t.localizations))
|
|
482
|
+
r.add(o);
|
|
482
483
|
}
|
|
483
484
|
return Array.from(r).sort();
|
|
484
485
|
}
|
|
485
|
-
async function
|
|
486
|
+
async function Mn(e, n) {
|
|
486
487
|
const { sourceLanguage: r } = await me(e);
|
|
487
488
|
if (!r)
|
|
488
489
|
throw new Error('The xcstrings file is missing "sourceLanguage".');
|
|
489
|
-
const i = await
|
|
490
|
+
const i = await We(n);
|
|
490
491
|
if (i?.xcodeprojPaths && i.xcodeprojPaths.length > 0) {
|
|
491
|
-
const
|
|
492
|
-
|
|
492
|
+
const l = /* @__PURE__ */ new Set();
|
|
493
|
+
l.add(r);
|
|
493
494
|
for (const a of i.xcodeprojPaths)
|
|
494
|
-
|
|
495
|
-
return Array.from(
|
|
495
|
+
Vr(a).forEach((c) => l.add(c));
|
|
496
|
+
return Array.from(l).sort();
|
|
496
497
|
}
|
|
497
|
-
const t = await
|
|
498
|
-
return
|
|
498
|
+
const t = await Xr(e), o = new Set(t);
|
|
499
|
+
return o.add(r), Array.from(o).sort();
|
|
499
500
|
}
|
|
500
|
-
function
|
|
501
|
+
function Dn(e) {
|
|
501
502
|
return typeof e > "u" || e === null;
|
|
502
503
|
}
|
|
503
|
-
function
|
|
504
|
+
function Qr(e) {
|
|
504
505
|
return typeof e == "object" && e !== null;
|
|
505
506
|
}
|
|
506
|
-
function
|
|
507
|
-
return Array.isArray(e) ? e :
|
|
507
|
+
function Jr(e) {
|
|
508
|
+
return Array.isArray(e) ? e : Dn(e) ? [] : [e];
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
-
var r, i, t,
|
|
510
|
+
function Zr(e, n) {
|
|
511
|
+
var r, i, t, o;
|
|
511
512
|
if (n)
|
|
512
|
-
for (
|
|
513
|
-
t =
|
|
513
|
+
for (o = Object.keys(n), r = 0, i = o.length; r < i; r += 1)
|
|
514
|
+
t = o[r], e[t] = n[t];
|
|
514
515
|
return e;
|
|
515
516
|
}
|
|
516
|
-
function
|
|
517
|
+
function ei(e, n) {
|
|
517
518
|
var r = "", i;
|
|
518
519
|
for (i = 0; i < n; i += 1)
|
|
519
520
|
r += e;
|
|
520
521
|
return r;
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
+
function ni(e) {
|
|
523
524
|
return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
|
|
524
525
|
}
|
|
525
|
-
var
|
|
526
|
-
isNothing:
|
|
527
|
-
isObject:
|
|
528
|
-
toArray:
|
|
529
|
-
repeat:
|
|
530
|
-
isNegativeZero:
|
|
531
|
-
extend:
|
|
526
|
+
var ri = Dn, ii = Qr, ti = Jr, oi = ei, li = ni, ai = Zr, T = {
|
|
527
|
+
isNothing: ri,
|
|
528
|
+
isObject: ii,
|
|
529
|
+
toArray: ti,
|
|
530
|
+
repeat: oi,
|
|
531
|
+
isNegativeZero: li,
|
|
532
|
+
extend: ai
|
|
532
533
|
};
|
|
533
|
-
function
|
|
534
|
+
function $n(e, n) {
|
|
534
535
|
var r = "", i = e.reason || "(unknown reason)";
|
|
535
536
|
return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !n && e.mark.snippet && (r += `
|
|
536
537
|
|
|
537
538
|
` + e.mark.snippet), i + " " + r) : i;
|
|
538
539
|
}
|
|
539
540
|
function fe(e, n) {
|
|
540
|
-
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message =
|
|
541
|
+
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message = $n(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
|
|
541
542
|
}
|
|
542
543
|
fe.prototype = Object.create(Error.prototype);
|
|
543
544
|
fe.prototype.constructor = fe;
|
|
544
545
|
fe.prototype.toString = function(n) {
|
|
545
|
-
return this.name + ": " +
|
|
546
|
+
return this.name + ": " + $n(this, n);
|
|
546
547
|
};
|
|
547
|
-
var
|
|
548
|
-
function
|
|
549
|
-
var
|
|
550
|
-
return i - n > a && (
|
|
551
|
-
str:
|
|
552
|
-
pos: i - n +
|
|
548
|
+
var M = fe;
|
|
549
|
+
function Ie(e, n, r, i, t) {
|
|
550
|
+
var o = "", l = "", a = Math.floor(t / 2) - 1;
|
|
551
|
+
return i - n > a && (o = " ... ", n = i - a + o.length), r - i > a && (l = " ...", r = i + a - l.length), {
|
|
552
|
+
str: o + e.slice(n, r).replace(/\t/g, "→") + l,
|
|
553
|
+
pos: i - n + o.length
|
|
553
554
|
// relative position
|
|
554
555
|
};
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
-
return
|
|
557
|
+
function Ne(e, n) {
|
|
558
|
+
return T.repeat(" ", n - e.length) + e;
|
|
558
559
|
}
|
|
559
|
-
function
|
|
560
|
+
function si(e, n) {
|
|
560
561
|
if (n = Object.create(n || null), !e.buffer) return null;
|
|
561
562
|
n.maxLength || (n.maxLength = 79), typeof n.indent != "number" && (n.indent = 1), typeof n.linesBefore != "number" && (n.linesBefore = 3), typeof n.linesAfter != "number" && (n.linesAfter = 2);
|
|
562
|
-
for (var r = /\r?\n|\r|\0/g, i = [0], t = [],
|
|
563
|
-
t.push(
|
|
564
|
-
|
|
565
|
-
var a = "", c, u
|
|
566
|
-
for (
|
|
567
|
-
|
|
563
|
+
for (var r = /\r?\n|\r|\0/g, i = [0], t = [], o, l = -1; o = r.exec(e.buffer); )
|
|
564
|
+
t.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && l < 0 && (l = i.length - 2);
|
|
565
|
+
l < 0 && (l = i.length - 1);
|
|
566
|
+
var a = "", s, c, u = Math.min(e.line + n.linesAfter, t.length).toString().length, f = n.maxLength - (n.indent + u + 3);
|
|
567
|
+
for (s = 1; s <= n.linesBefore && !(l - s < 0); s++)
|
|
568
|
+
c = Ie(
|
|
568
569
|
e.buffer,
|
|
569
|
-
i[
|
|
570
|
-
t[
|
|
571
|
-
e.position - (i[
|
|
570
|
+
i[l - s],
|
|
571
|
+
t[l - s],
|
|
572
|
+
e.position - (i[l] - i[l - s]),
|
|
572
573
|
f
|
|
573
|
-
), a =
|
|
574
|
+
), a = T.repeat(" ", n.indent) + Ne((e.line - s + 1).toString(), u) + " | " + c.str + `
|
|
574
575
|
` + a;
|
|
575
|
-
for (
|
|
576
|
-
`, a +=
|
|
577
|
-
`,
|
|
578
|
-
|
|
576
|
+
for (c = Ie(e.buffer, i[l], t[l], e.position, f), a += T.repeat(" ", n.indent) + Ne((e.line + 1).toString(), u) + " | " + c.str + `
|
|
577
|
+
`, a += T.repeat("-", n.indent + u + 3 + c.pos) + `^
|
|
578
|
+
`, s = 1; s <= n.linesAfter && !(l + s >= t.length); s++)
|
|
579
|
+
c = Ie(
|
|
579
580
|
e.buffer,
|
|
580
|
-
i[
|
|
581
|
-
t[
|
|
582
|
-
e.position - (i[
|
|
581
|
+
i[l + s],
|
|
582
|
+
t[l + s],
|
|
583
|
+
e.position - (i[l] - i[l + s]),
|
|
583
584
|
f
|
|
584
|
-
), a +=
|
|
585
|
+
), a += T.repeat(" ", n.indent) + Ne((e.line + s + 1).toString(), u) + " | " + c.str + `
|
|
585
586
|
`;
|
|
586
587
|
return a.replace(/\n$/, "");
|
|
587
588
|
}
|
|
588
|
-
var
|
|
589
|
+
var ci = si, ui = [
|
|
589
590
|
"kind",
|
|
590
591
|
"multi",
|
|
591
592
|
"resolve",
|
|
@@ -596,12 +597,12 @@ var oi = ti, li = [
|
|
|
596
597
|
"representName",
|
|
597
598
|
"defaultStyle",
|
|
598
599
|
"styleAliases"
|
|
599
|
-
],
|
|
600
|
+
], fi = [
|
|
600
601
|
"scalar",
|
|
601
602
|
"sequence",
|
|
602
603
|
"mapping"
|
|
603
604
|
];
|
|
604
|
-
function
|
|
605
|
+
function pi(e) {
|
|
605
606
|
var n = {};
|
|
606
607
|
return e !== null && Object.keys(e).forEach(function(r) {
|
|
607
608
|
e[r].forEach(function(i) {
|
|
@@ -609,28 +610,28 @@ function ci(e) {
|
|
|
609
610
|
});
|
|
610
611
|
}), n;
|
|
611
612
|
}
|
|
612
|
-
function
|
|
613
|
+
function di(e, n) {
|
|
613
614
|
if (n = n || {}, Object.keys(n).forEach(function(r) {
|
|
614
|
-
if (
|
|
615
|
-
throw new
|
|
615
|
+
if (ui.indexOf(r) === -1)
|
|
616
|
+
throw new M('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
|
|
616
617
|
}), this.options = n, this.tag = e, this.kind = n.kind || null, this.resolve = n.resolve || function() {
|
|
617
618
|
return !0;
|
|
618
619
|
}, this.construct = n.construct || function(r) {
|
|
619
620
|
return r;
|
|
620
|
-
}, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases =
|
|
621
|
-
throw new
|
|
621
|
+
}, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases = pi(n.styleAliases || null), fi.indexOf(this.kind) === -1)
|
|
622
|
+
throw new M('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
|
|
622
623
|
}
|
|
623
|
-
var
|
|
624
|
-
function
|
|
624
|
+
var j = di;
|
|
625
|
+
function pn(e, n) {
|
|
625
626
|
var r = [];
|
|
626
627
|
return e[n].forEach(function(i) {
|
|
627
628
|
var t = r.length;
|
|
628
|
-
r.forEach(function(
|
|
629
|
-
|
|
629
|
+
r.forEach(function(o, l) {
|
|
630
|
+
o.tag === i.tag && o.kind === i.kind && o.multi === i.multi && (t = l);
|
|
630
631
|
}), r[t] = i;
|
|
631
632
|
}), r;
|
|
632
633
|
}
|
|
633
|
-
function
|
|
634
|
+
function hi() {
|
|
634
635
|
var e = {
|
|
635
636
|
scalar: {},
|
|
636
637
|
sequence: {},
|
|
@@ -650,71 +651,71 @@ function si() {
|
|
|
650
651
|
arguments[n].forEach(i);
|
|
651
652
|
return e;
|
|
652
653
|
}
|
|
653
|
-
function
|
|
654
|
+
function Be(e) {
|
|
654
655
|
return this.extend(e);
|
|
655
656
|
}
|
|
656
|
-
|
|
657
|
+
Be.prototype.extend = function(n) {
|
|
657
658
|
var r = [], i = [];
|
|
658
|
-
if (n instanceof
|
|
659
|
+
if (n instanceof j)
|
|
659
660
|
i.push(n);
|
|
660
661
|
else if (Array.isArray(n))
|
|
661
662
|
i = i.concat(n);
|
|
662
663
|
else if (n && (Array.isArray(n.implicit) || Array.isArray(n.explicit)))
|
|
663
664
|
n.implicit && (r = r.concat(n.implicit)), n.explicit && (i = i.concat(n.explicit));
|
|
664
665
|
else
|
|
665
|
-
throw new
|
|
666
|
-
r.forEach(function(
|
|
667
|
-
if (!(
|
|
668
|
-
throw new
|
|
669
|
-
if (
|
|
670
|
-
throw new
|
|
671
|
-
if (
|
|
672
|
-
throw new
|
|
673
|
-
}), i.forEach(function(
|
|
674
|
-
if (!(
|
|
675
|
-
throw new
|
|
666
|
+
throw new M("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
667
|
+
r.forEach(function(o) {
|
|
668
|
+
if (!(o instanceof j))
|
|
669
|
+
throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
670
|
+
if (o.loadKind && o.loadKind !== "scalar")
|
|
671
|
+
throw new M("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
672
|
+
if (o.multi)
|
|
673
|
+
throw new M("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
674
|
+
}), i.forEach(function(o) {
|
|
675
|
+
if (!(o instanceof j))
|
|
676
|
+
throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
676
677
|
});
|
|
677
|
-
var t = Object.create(
|
|
678
|
-
return t.implicit = (this.implicit || []).concat(r), t.explicit = (this.explicit || []).concat(i), t.compiledImplicit =
|
|
678
|
+
var t = Object.create(Be.prototype);
|
|
679
|
+
return t.implicit = (this.implicit || []).concat(r), t.explicit = (this.explicit || []).concat(i), t.compiledImplicit = pn(t, "implicit"), t.compiledExplicit = pn(t, "explicit"), t.compiledTypeMap = hi(t.compiledImplicit, t.compiledExplicit), t;
|
|
679
680
|
};
|
|
680
|
-
var
|
|
681
|
+
var Bn = Be, zn = new j("tag:yaml.org,2002:str", {
|
|
681
682
|
kind: "scalar",
|
|
682
683
|
construct: function(e) {
|
|
683
684
|
return e !== null ? e : "";
|
|
684
685
|
}
|
|
685
|
-
}), Un = new
|
|
686
|
+
}), Un = new j("tag:yaml.org,2002:seq", {
|
|
686
687
|
kind: "sequence",
|
|
687
688
|
construct: function(e) {
|
|
688
689
|
return e !== null ? e : [];
|
|
689
690
|
}
|
|
690
|
-
}), Yn = new
|
|
691
|
+
}), Yn = new j("tag:yaml.org,2002:map", {
|
|
691
692
|
kind: "mapping",
|
|
692
693
|
construct: function(e) {
|
|
693
694
|
return e !== null ? e : {};
|
|
694
695
|
}
|
|
695
|
-
}),
|
|
696
|
+
}), Hn = new Bn({
|
|
696
697
|
explicit: [
|
|
697
|
-
|
|
698
|
+
zn,
|
|
698
699
|
Un,
|
|
699
700
|
Yn
|
|
700
701
|
]
|
|
701
702
|
});
|
|
702
|
-
function
|
|
703
|
+
function gi(e) {
|
|
703
704
|
if (e === null) return !0;
|
|
704
705
|
var n = e.length;
|
|
705
706
|
return n === 1 && e === "~" || n === 4 && (e === "null" || e === "Null" || e === "NULL");
|
|
706
707
|
}
|
|
707
|
-
function
|
|
708
|
+
function mi() {
|
|
708
709
|
return null;
|
|
709
710
|
}
|
|
710
|
-
function
|
|
711
|
+
function yi(e) {
|
|
711
712
|
return e === null;
|
|
712
713
|
}
|
|
713
|
-
var
|
|
714
|
+
var Kn = new j("tag:yaml.org,2002:null", {
|
|
714
715
|
kind: "scalar",
|
|
715
|
-
resolve:
|
|
716
|
-
construct:
|
|
717
|
-
predicate:
|
|
716
|
+
resolve: gi,
|
|
717
|
+
construct: mi,
|
|
718
|
+
predicate: yi,
|
|
718
719
|
represent: {
|
|
719
720
|
canonical: function() {
|
|
720
721
|
return "~";
|
|
@@ -734,22 +735,22 @@ var $n = new T("tag:yaml.org,2002:null", {
|
|
|
734
735
|
},
|
|
735
736
|
defaultStyle: "lowercase"
|
|
736
737
|
});
|
|
737
|
-
function
|
|
738
|
+
function vi(e) {
|
|
738
739
|
if (e === null) return !1;
|
|
739
740
|
var n = e.length;
|
|
740
741
|
return n === 4 && (e === "true" || e === "True" || e === "TRUE") || n === 5 && (e === "false" || e === "False" || e === "FALSE");
|
|
741
742
|
}
|
|
742
|
-
function
|
|
743
|
+
function xi(e) {
|
|
743
744
|
return e === "true" || e === "True" || e === "TRUE";
|
|
744
745
|
}
|
|
745
|
-
function
|
|
746
|
+
function wi(e) {
|
|
746
747
|
return Object.prototype.toString.call(e) === "[object Boolean]";
|
|
747
748
|
}
|
|
748
|
-
var
|
|
749
|
+
var Wn = new j("tag:yaml.org,2002:bool", {
|
|
749
750
|
kind: "scalar",
|
|
750
|
-
resolve:
|
|
751
|
-
construct:
|
|
752
|
-
predicate:
|
|
751
|
+
resolve: vi,
|
|
752
|
+
construct: xi,
|
|
753
|
+
predicate: wi,
|
|
753
754
|
represent: {
|
|
754
755
|
lowercase: function(e) {
|
|
755
756
|
return e ? "true" : "false";
|
|
@@ -763,16 +764,16 @@ var Hn = new T("tag:yaml.org,2002:bool", {
|
|
|
763
764
|
},
|
|
764
765
|
defaultStyle: "lowercase"
|
|
765
766
|
});
|
|
766
|
-
function
|
|
767
|
+
function bi(e) {
|
|
767
768
|
return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
|
|
768
769
|
}
|
|
769
|
-
function
|
|
770
|
+
function Ai(e) {
|
|
770
771
|
return 48 <= e && e <= 55;
|
|
771
772
|
}
|
|
772
|
-
function
|
|
773
|
+
function Ci(e) {
|
|
773
774
|
return 48 <= e && e <= 57;
|
|
774
775
|
}
|
|
775
|
-
function
|
|
776
|
+
function ki(e) {
|
|
776
777
|
if (e === null) return !1;
|
|
777
778
|
var n = e.length, r = 0, i = !1, t;
|
|
778
779
|
if (!n) return !1;
|
|
@@ -789,7 +790,7 @@ function bi(e) {
|
|
|
789
790
|
if (t === "x") {
|
|
790
791
|
for (r++; r < n; r++)
|
|
791
792
|
if (t = e[r], t !== "_") {
|
|
792
|
-
if (!
|
|
793
|
+
if (!bi(e.charCodeAt(r))) return !1;
|
|
793
794
|
i = !0;
|
|
794
795
|
}
|
|
795
796
|
return i && t !== "_";
|
|
@@ -797,7 +798,7 @@ function bi(e) {
|
|
|
797
798
|
if (t === "o") {
|
|
798
799
|
for (r++; r < n; r++)
|
|
799
800
|
if (t = e[r], t !== "_") {
|
|
800
|
-
if (!
|
|
801
|
+
if (!Ai(e.charCodeAt(r))) return !1;
|
|
801
802
|
i = !0;
|
|
802
803
|
}
|
|
803
804
|
return i && t !== "_";
|
|
@@ -806,13 +807,13 @@ function bi(e) {
|
|
|
806
807
|
if (t === "_") return !1;
|
|
807
808
|
for (; r < n; r++)
|
|
808
809
|
if (t = e[r], t !== "_") {
|
|
809
|
-
if (!
|
|
810
|
+
if (!Ci(e.charCodeAt(r)))
|
|
810
811
|
return !1;
|
|
811
812
|
i = !0;
|
|
812
813
|
}
|
|
813
814
|
return !(!i || t === "_");
|
|
814
815
|
}
|
|
815
|
-
function
|
|
816
|
+
function Si(e) {
|
|
816
817
|
var n = e, r = 1, i;
|
|
817
818
|
if (n.indexOf("_") !== -1 && (n = n.replace(/_/g, "")), i = n[0], (i === "-" || i === "+") && (i === "-" && (r = -1), n = n.slice(1), i = n[0]), n === "0") return 0;
|
|
818
819
|
if (i === "0") {
|
|
@@ -822,14 +823,14 @@ function wi(e) {
|
|
|
822
823
|
}
|
|
823
824
|
return r * parseInt(n, 10);
|
|
824
825
|
}
|
|
825
|
-
function
|
|
826
|
-
return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !
|
|
826
|
+
function Ei(e) {
|
|
827
|
+
return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !T.isNegativeZero(e);
|
|
827
828
|
}
|
|
828
|
-
var
|
|
829
|
+
var qn = new j("tag:yaml.org,2002:int", {
|
|
829
830
|
kind: "scalar",
|
|
830
|
-
resolve:
|
|
831
|
-
construct:
|
|
832
|
-
predicate:
|
|
831
|
+
resolve: ki,
|
|
832
|
+
construct: Si,
|
|
833
|
+
predicate: Ei,
|
|
833
834
|
represent: {
|
|
834
835
|
binary: function(e) {
|
|
835
836
|
return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
|
|
@@ -852,21 +853,21 @@ var Kn = new T("tag:yaml.org,2002:int", {
|
|
|
852
853
|
decimal: [10, "dec"],
|
|
853
854
|
hexadecimal: [16, "hex"]
|
|
854
855
|
}
|
|
855
|
-
}),
|
|
856
|
+
}), _i = new RegExp(
|
|
856
857
|
// 2.5e4, 2.5 and integers
|
|
857
858
|
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
858
859
|
);
|
|
859
|
-
function
|
|
860
|
-
return !(e === null || !
|
|
860
|
+
function Oi(e) {
|
|
861
|
+
return !(e === null || !_i.test(e) || // Quick hack to not allow integers end with `_`
|
|
861
862
|
// Probably should update regexp & check speed
|
|
862
863
|
e[e.length - 1] === "_");
|
|
863
864
|
}
|
|
864
|
-
function
|
|
865
|
+
function Fi(e) {
|
|
865
866
|
var n, r;
|
|
866
867
|
return n = e.replace(/_/g, "").toLowerCase(), r = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : r * parseFloat(n, 10);
|
|
867
868
|
}
|
|
868
|
-
var
|
|
869
|
-
function
|
|
869
|
+
var Ti = /^[-+]?[0-9]+e/;
|
|
870
|
+
function Li(e, n) {
|
|
870
871
|
var r;
|
|
871
872
|
if (isNaN(e))
|
|
872
873
|
switch (n) {
|
|
@@ -895,204 +896,204 @@ function ki(e, n) {
|
|
|
895
896
|
case "camelcase":
|
|
896
897
|
return "-.Inf";
|
|
897
898
|
}
|
|
898
|
-
else if (
|
|
899
|
+
else if (T.isNegativeZero(e))
|
|
899
900
|
return "-0.0";
|
|
900
|
-
return r = e.toString(10),
|
|
901
|
+
return r = e.toString(10), Ti.test(r) ? r.replace("e", ".e") : r;
|
|
901
902
|
}
|
|
902
|
-
function
|
|
903
|
-
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 ||
|
|
903
|
+
function ji(e) {
|
|
904
|
+
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || T.isNegativeZero(e));
|
|
904
905
|
}
|
|
905
|
-
var
|
|
906
|
+
var Gn = new j("tag:yaml.org,2002:float", {
|
|
906
907
|
kind: "scalar",
|
|
907
|
-
resolve:
|
|
908
|
-
construct:
|
|
909
|
-
predicate:
|
|
910
|
-
represent:
|
|
908
|
+
resolve: Oi,
|
|
909
|
+
construct: Fi,
|
|
910
|
+
predicate: ji,
|
|
911
|
+
represent: Li,
|
|
911
912
|
defaultStyle: "lowercase"
|
|
912
|
-
}),
|
|
913
|
+
}), Vn = Hn.extend({
|
|
913
914
|
implicit: [
|
|
914
|
-
$n,
|
|
915
|
-
Hn,
|
|
916
915
|
Kn,
|
|
917
|
-
Wn
|
|
916
|
+
Wn,
|
|
917
|
+
qn,
|
|
918
|
+
Gn
|
|
918
919
|
]
|
|
919
|
-
}),
|
|
920
|
+
}), Xn = Vn, Qn = new RegExp(
|
|
920
921
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
921
|
-
),
|
|
922
|
+
), Jn = new RegExp(
|
|
922
923
|
"^([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]))?))?$"
|
|
923
924
|
);
|
|
924
|
-
function
|
|
925
|
-
return e === null ? !1 :
|
|
925
|
+
function Ii(e) {
|
|
926
|
+
return e === null ? !1 : Qn.exec(e) !== null || Jn.exec(e) !== null;
|
|
926
927
|
}
|
|
927
|
-
function
|
|
928
|
-
var n, r, i, t,
|
|
929
|
-
if (n =
|
|
928
|
+
function Ni(e) {
|
|
929
|
+
var n, r, i, t, o, l, a, s = 0, c = null, u, f, d;
|
|
930
|
+
if (n = Qn.exec(e), n === null && (n = Jn.exec(e)), n === null) throw new Error("Date resolve error");
|
|
930
931
|
if (r = +n[1], i = +n[2] - 1, t = +n[3], !n[4])
|
|
931
932
|
return new Date(Date.UTC(r, i, t));
|
|
932
|
-
if (
|
|
933
|
-
for (
|
|
934
|
-
|
|
935
|
-
|
|
933
|
+
if (o = +n[4], l = +n[5], a = +n[6], n[7]) {
|
|
934
|
+
for (s = n[7].slice(0, 3); s.length < 3; )
|
|
935
|
+
s += "0";
|
|
936
|
+
s = +s;
|
|
936
937
|
}
|
|
937
|
-
return n[9] && (
|
|
938
|
+
return n[9] && (u = +n[10], f = +(n[11] || 0), c = (u * 60 + f) * 6e4, n[9] === "-" && (c = -c)), d = new Date(Date.UTC(r, i, t, o, l, a, s)), c && d.setTime(d.getTime() - c), d;
|
|
938
939
|
}
|
|
939
|
-
function
|
|
940
|
+
function Ri(e) {
|
|
940
941
|
return e.toISOString();
|
|
941
942
|
}
|
|
942
|
-
var
|
|
943
|
+
var Zn = new j("tag:yaml.org,2002:timestamp", {
|
|
943
944
|
kind: "scalar",
|
|
944
|
-
resolve:
|
|
945
|
-
construct:
|
|
945
|
+
resolve: Ii,
|
|
946
|
+
construct: Ni,
|
|
946
947
|
instanceOf: Date,
|
|
947
|
-
represent:
|
|
948
|
+
represent: Ri
|
|
948
949
|
});
|
|
949
|
-
function
|
|
950
|
+
function Pi(e) {
|
|
950
951
|
return e === "<<" || e === null;
|
|
951
952
|
}
|
|
952
|
-
var
|
|
953
|
+
var er = new j("tag:yaml.org,2002:merge", {
|
|
953
954
|
kind: "scalar",
|
|
954
|
-
resolve:
|
|
955
|
-
}),
|
|
955
|
+
resolve: Pi
|
|
956
|
+
}), qe = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
956
957
|
\r`;
|
|
957
|
-
function
|
|
958
|
+
function Mi(e) {
|
|
958
959
|
if (e === null) return !1;
|
|
959
|
-
var n, r, i = 0, t = e.length,
|
|
960
|
+
var n, r, i = 0, t = e.length, o = qe;
|
|
960
961
|
for (r = 0; r < t; r++)
|
|
961
|
-
if (n =
|
|
962
|
+
if (n = o.indexOf(e.charAt(r)), !(n > 64)) {
|
|
962
963
|
if (n < 0) return !1;
|
|
963
964
|
i += 6;
|
|
964
965
|
}
|
|
965
966
|
return i % 8 === 0;
|
|
966
967
|
}
|
|
967
|
-
function
|
|
968
|
-
var n, r, i = e.replace(/[\r\n=]/g, ""), t = i.length,
|
|
968
|
+
function Di(e) {
|
|
969
|
+
var n, r, i = e.replace(/[\r\n=]/g, ""), t = i.length, o = qe, l = 0, a = [];
|
|
969
970
|
for (n = 0; n < t; n++)
|
|
970
|
-
n % 4 === 0 && n && (a.push(
|
|
971
|
-
return r = t % 4 * 6, r === 0 ? (a.push(
|
|
971
|
+
n % 4 === 0 && n && (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)), l = l << 6 | o.indexOf(i.charAt(n));
|
|
972
|
+
return r = t % 4 * 6, r === 0 ? (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)) : r === 18 ? (a.push(l >> 10 & 255), a.push(l >> 2 & 255)) : r === 12 && a.push(l >> 4 & 255), new Uint8Array(a);
|
|
972
973
|
}
|
|
973
|
-
function
|
|
974
|
-
var n = "", r = 0, i, t,
|
|
975
|
-
for (i = 0; i <
|
|
976
|
-
i % 3 === 0 && i && (n +=
|
|
977
|
-
return t =
|
|
974
|
+
function $i(e) {
|
|
975
|
+
var n = "", r = 0, i, t, o = e.length, l = qe;
|
|
976
|
+
for (i = 0; i < o; i++)
|
|
977
|
+
i % 3 === 0 && i && (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]), r = (r << 8) + e[i];
|
|
978
|
+
return t = o % 3, t === 0 ? (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]) : t === 2 ? (n += l[r >> 10 & 63], n += l[r >> 4 & 63], n += l[r << 2 & 63], n += l[64]) : t === 1 && (n += l[r >> 2 & 63], n += l[r << 4 & 63], n += l[64], n += l[64]), n;
|
|
978
979
|
}
|
|
979
|
-
function
|
|
980
|
+
function Bi(e) {
|
|
980
981
|
return Object.prototype.toString.call(e) === "[object Uint8Array]";
|
|
981
982
|
}
|
|
982
|
-
var
|
|
983
|
+
var nr = new j("tag:yaml.org,2002:binary", {
|
|
983
984
|
kind: "scalar",
|
|
984
|
-
resolve:
|
|
985
|
-
construct:
|
|
986
|
-
predicate:
|
|
987
|
-
represent:
|
|
988
|
-
}),
|
|
989
|
-
function
|
|
985
|
+
resolve: Mi,
|
|
986
|
+
construct: Di,
|
|
987
|
+
predicate: Bi,
|
|
988
|
+
represent: $i
|
|
989
|
+
}), zi = Object.prototype.hasOwnProperty, Ui = Object.prototype.toString;
|
|
990
|
+
function Yi(e) {
|
|
990
991
|
if (e === null) return !0;
|
|
991
|
-
var n = [], r, i, t,
|
|
992
|
+
var n = [], r, i, t, o, l, a = e;
|
|
992
993
|
for (r = 0, i = a.length; r < i; r += 1) {
|
|
993
|
-
if (t = a[r],
|
|
994
|
-
for (
|
|
995
|
-
if (
|
|
996
|
-
if (!
|
|
994
|
+
if (t = a[r], l = !1, Ui.call(t) !== "[object Object]") return !1;
|
|
995
|
+
for (o in t)
|
|
996
|
+
if (zi.call(t, o))
|
|
997
|
+
if (!l) l = !0;
|
|
997
998
|
else return !1;
|
|
998
|
-
if (!
|
|
999
|
-
if (n.indexOf(
|
|
999
|
+
if (!l) return !1;
|
|
1000
|
+
if (n.indexOf(o) === -1) n.push(o);
|
|
1000
1001
|
else return !1;
|
|
1001
1002
|
}
|
|
1002
1003
|
return !0;
|
|
1003
1004
|
}
|
|
1004
|
-
function
|
|
1005
|
+
function Hi(e) {
|
|
1005
1006
|
return e !== null ? e : [];
|
|
1006
1007
|
}
|
|
1007
|
-
var
|
|
1008
|
+
var rr = new j("tag:yaml.org,2002:omap", {
|
|
1008
1009
|
kind: "sequence",
|
|
1009
|
-
resolve:
|
|
1010
|
-
construct:
|
|
1011
|
-
}),
|
|
1012
|
-
function
|
|
1010
|
+
resolve: Yi,
|
|
1011
|
+
construct: Hi
|
|
1012
|
+
}), Ki = Object.prototype.toString;
|
|
1013
|
+
function Wi(e) {
|
|
1013
1014
|
if (e === null) return !0;
|
|
1014
|
-
var n, r, i, t,
|
|
1015
|
-
for (
|
|
1016
|
-
if (i =
|
|
1017
|
-
|
|
1015
|
+
var n, r, i, t, o, l = e;
|
|
1016
|
+
for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1) {
|
|
1017
|
+
if (i = l[n], Ki.call(i) !== "[object Object]" || (t = Object.keys(i), t.length !== 1)) return !1;
|
|
1018
|
+
o[n] = [t[0], i[t[0]]];
|
|
1018
1019
|
}
|
|
1019
1020
|
return !0;
|
|
1020
1021
|
}
|
|
1021
|
-
function
|
|
1022
|
+
function qi(e) {
|
|
1022
1023
|
if (e === null) return [];
|
|
1023
|
-
var n, r, i, t,
|
|
1024
|
-
for (
|
|
1025
|
-
i =
|
|
1026
|
-
return
|
|
1024
|
+
var n, r, i, t, o, l = e;
|
|
1025
|
+
for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1)
|
|
1026
|
+
i = l[n], t = Object.keys(i), o[n] = [t[0], i[t[0]]];
|
|
1027
|
+
return o;
|
|
1027
1028
|
}
|
|
1028
|
-
var
|
|
1029
|
+
var ir = new j("tag:yaml.org,2002:pairs", {
|
|
1029
1030
|
kind: "sequence",
|
|
1030
|
-
resolve:
|
|
1031
|
-
construct:
|
|
1032
|
-
}),
|
|
1033
|
-
function
|
|
1031
|
+
resolve: Wi,
|
|
1032
|
+
construct: qi
|
|
1033
|
+
}), Gi = Object.prototype.hasOwnProperty;
|
|
1034
|
+
function Vi(e) {
|
|
1034
1035
|
if (e === null) return !0;
|
|
1035
1036
|
var n, r = e;
|
|
1036
1037
|
for (n in r)
|
|
1037
|
-
if (
|
|
1038
|
+
if (Gi.call(r, n) && r[n] !== null)
|
|
1038
1039
|
return !1;
|
|
1039
1040
|
return !0;
|
|
1040
1041
|
}
|
|
1041
|
-
function
|
|
1042
|
+
function Xi(e) {
|
|
1042
1043
|
return e !== null ? e : {};
|
|
1043
1044
|
}
|
|
1044
|
-
var
|
|
1045
|
+
var tr = new j("tag:yaml.org,2002:set", {
|
|
1045
1046
|
kind: "mapping",
|
|
1046
|
-
resolve:
|
|
1047
|
-
construct:
|
|
1048
|
-
}), Ge =
|
|
1047
|
+
resolve: Vi,
|
|
1048
|
+
construct: Xi
|
|
1049
|
+
}), Ge = Xn.extend({
|
|
1049
1050
|
implicit: [
|
|
1050
|
-
|
|
1051
|
-
|
|
1051
|
+
Zn,
|
|
1052
|
+
er
|
|
1052
1053
|
],
|
|
1053
1054
|
explicit: [
|
|
1054
|
-
Zn,
|
|
1055
|
-
er,
|
|
1056
1055
|
nr,
|
|
1057
|
-
rr
|
|
1056
|
+
rr,
|
|
1057
|
+
ir,
|
|
1058
|
+
tr
|
|
1058
1059
|
]
|
|
1059
|
-
}),
|
|
1060
|
+
}), G = Object.prototype.hasOwnProperty, Ce = 1, or = 2, lr = 3, ke = 4, Re = 1, Qi = 2, dn = 3, Ji = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Zi = /[\x85\u2028\u2029]/, et = /[,\[\]\{\}]/, ar = /^(?:!|!!|![a-z\-]+!)$/i, sr = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
1060
1061
|
function hn(e) {
|
|
1061
1062
|
return Object.prototype.toString.call(e);
|
|
1062
1063
|
}
|
|
1063
|
-
function
|
|
1064
|
+
function H(e) {
|
|
1064
1065
|
return e === 10 || e === 13;
|
|
1065
1066
|
}
|
|
1066
|
-
function
|
|
1067
|
+
function Q(e) {
|
|
1067
1068
|
return e === 9 || e === 32;
|
|
1068
1069
|
}
|
|
1069
|
-
function
|
|
1070
|
+
function U(e) {
|
|
1070
1071
|
return e === 9 || e === 32 || e === 10 || e === 13;
|
|
1071
1072
|
}
|
|
1072
|
-
function
|
|
1073
|
+
function ie(e) {
|
|
1073
1074
|
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1074
1075
|
}
|
|
1075
|
-
function
|
|
1076
|
+
function nt(e) {
|
|
1076
1077
|
var n;
|
|
1077
1078
|
return 48 <= e && e <= 57 ? e - 48 : (n = e | 32, 97 <= n && n <= 102 ? n - 97 + 10 : -1);
|
|
1078
1079
|
}
|
|
1079
|
-
function
|
|
1080
|
+
function rt(e) {
|
|
1080
1081
|
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1081
1082
|
}
|
|
1082
|
-
function
|
|
1083
|
+
function it(e) {
|
|
1083
1084
|
return 48 <= e && e <= 57 ? e - 48 : -1;
|
|
1084
1085
|
}
|
|
1085
|
-
function
|
|
1086
|
+
function gn(e) {
|
|
1086
1087
|
return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
|
|
1087
1088
|
` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "
" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
|
|
1088
1089
|
}
|
|
1089
|
-
function
|
|
1090
|
+
function tt(e) {
|
|
1090
1091
|
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
|
|
1091
1092
|
(e - 65536 >> 10) + 55296,
|
|
1092
1093
|
(e - 65536 & 1023) + 56320
|
|
1093
1094
|
);
|
|
1094
1095
|
}
|
|
1095
|
-
function
|
|
1096
|
+
function cr(e, n, r) {
|
|
1096
1097
|
n === "__proto__" ? Object.defineProperty(e, n, {
|
|
1097
1098
|
configurable: !0,
|
|
1098
1099
|
enumerable: !0,
|
|
@@ -1100,13 +1101,13 @@ function ar(e, n, r) {
|
|
|
1100
1101
|
value: r
|
|
1101
1102
|
}) : e[n] = r;
|
|
1102
1103
|
}
|
|
1103
|
-
var
|
|
1104
|
-
for (var
|
|
1105
|
-
|
|
1106
|
-
function
|
|
1104
|
+
var ur = new Array(256), fr = new Array(256);
|
|
1105
|
+
for (var ne = 0; ne < 256; ne++)
|
|
1106
|
+
ur[ne] = gn(ne) ? 1 : 0, fr[ne] = gn(ne);
|
|
1107
|
+
function ot(e, n) {
|
|
1107
1108
|
this.input = e, this.filename = n.filename || null, this.schema = n.schema || Ge, this.onWarning = n.onWarning || null, this.legacy = n.legacy || !1, this.json = n.json || !1, this.listener = n.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
|
|
1108
1109
|
}
|
|
1109
|
-
function
|
|
1110
|
+
function pr(e, n) {
|
|
1110
1111
|
var r = {
|
|
1111
1112
|
name: e.filename,
|
|
1112
1113
|
buffer: e.input.slice(0, -1),
|
|
@@ -1115,168 +1116,168 @@ function sr(e, n) {
|
|
|
1115
1116
|
line: e.line,
|
|
1116
1117
|
column: e.position - e.lineStart
|
|
1117
1118
|
};
|
|
1118
|
-
return r.snippet =
|
|
1119
|
+
return r.snippet = ci(r), new M(n, r);
|
|
1119
1120
|
}
|
|
1120
1121
|
function y(e, n) {
|
|
1121
|
-
throw
|
|
1122
|
+
throw pr(e, n);
|
|
1122
1123
|
}
|
|
1123
|
-
function
|
|
1124
|
-
e.onWarning && e.onWarning.call(null,
|
|
1124
|
+
function Se(e, n) {
|
|
1125
|
+
e.onWarning && e.onWarning.call(null, pr(e, n));
|
|
1125
1126
|
}
|
|
1126
|
-
var
|
|
1127
|
+
var mn = {
|
|
1127
1128
|
YAML: function(n, r, i) {
|
|
1128
|
-
var t,
|
|
1129
|
-
n.version !== null && y(n, "duplication of %YAML directive"), i.length !== 1 && y(n, "YAML directive accepts exactly one argument"), t = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), t === null && y(n, "ill-formed argument of the YAML directive"),
|
|
1129
|
+
var t, o, l;
|
|
1130
|
+
n.version !== null && y(n, "duplication of %YAML directive"), i.length !== 1 && y(n, "YAML directive accepts exactly one argument"), t = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), t === null && y(n, "ill-formed argument of the YAML directive"), o = parseInt(t[1], 10), l = parseInt(t[2], 10), o !== 1 && y(n, "unacceptable YAML version of the document"), n.version = i[0], n.checkLineBreaks = l < 2, l !== 1 && l !== 2 && Se(n, "unsupported YAML version of the document");
|
|
1130
1131
|
},
|
|
1131
1132
|
TAG: function(n, r, i) {
|
|
1132
|
-
var t,
|
|
1133
|
-
i.length !== 2 && y(n, "TAG directive accepts exactly two arguments"), t = i[0],
|
|
1133
|
+
var t, o;
|
|
1134
|
+
i.length !== 2 && y(n, "TAG directive accepts exactly two arguments"), t = i[0], o = i[1], ar.test(t) || y(n, "ill-formed tag handle (first argument) of the TAG directive"), G.call(n.tagMap, t) && y(n, 'there is a previously declared suffix for "' + t + '" tag handle'), sr.test(o) || y(n, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
1134
1135
|
try {
|
|
1135
|
-
|
|
1136
|
+
o = decodeURIComponent(o);
|
|
1136
1137
|
} catch {
|
|
1137
|
-
y(n, "tag prefix is malformed: " +
|
|
1138
|
+
y(n, "tag prefix is malformed: " + o);
|
|
1138
1139
|
}
|
|
1139
|
-
n.tagMap[t] =
|
|
1140
|
+
n.tagMap[t] = o;
|
|
1140
1141
|
}
|
|
1141
1142
|
};
|
|
1142
|
-
function
|
|
1143
|
-
var t,
|
|
1143
|
+
function q(e, n, r, i) {
|
|
1144
|
+
var t, o, l, a;
|
|
1144
1145
|
if (n < r) {
|
|
1145
1146
|
if (a = e.input.slice(n, r), i)
|
|
1146
|
-
for (t = 0,
|
|
1147
|
-
|
|
1148
|
-
else
|
|
1147
|
+
for (t = 0, o = a.length; t < o; t += 1)
|
|
1148
|
+
l = a.charCodeAt(t), l === 9 || 32 <= l && l <= 1114111 || y(e, "expected valid JSON character");
|
|
1149
|
+
else Ji.test(a) && y(e, "the stream contains non-printable characters");
|
|
1149
1150
|
e.result += a;
|
|
1150
1151
|
}
|
|
1151
1152
|
}
|
|
1152
|
-
function
|
|
1153
|
-
var t,
|
|
1154
|
-
for (
|
|
1155
|
-
|
|
1153
|
+
function yn(e, n, r, i) {
|
|
1154
|
+
var t, o, l, a;
|
|
1155
|
+
for (T.isObject(r) || y(e, "cannot merge mappings; the provided source object is unacceptable"), t = Object.keys(r), l = 0, a = t.length; l < a; l += 1)
|
|
1156
|
+
o = t[l], G.call(n, o) || (cr(n, o, r[o]), i[o] = !0);
|
|
1156
1157
|
}
|
|
1157
|
-
function
|
|
1158
|
-
var
|
|
1158
|
+
function te(e, n, r, i, t, o, l, a, s) {
|
|
1159
|
+
var c, u;
|
|
1159
1160
|
if (Array.isArray(t))
|
|
1160
|
-
for (t = Array.prototype.slice.call(t),
|
|
1161
|
-
Array.isArray(t[
|
|
1161
|
+
for (t = Array.prototype.slice.call(t), c = 0, u = t.length; c < u; c += 1)
|
|
1162
|
+
Array.isArray(t[c]) && y(e, "nested arrays are not supported inside keys"), typeof t == "object" && hn(t[c]) === "[object Object]" && (t[c] = "[object Object]");
|
|
1162
1163
|
if (typeof t == "object" && hn(t) === "[object Object]" && (t = "[object Object]"), t = String(t), n === null && (n = {}), i === "tag:yaml.org,2002:merge")
|
|
1163
|
-
if (Array.isArray(
|
|
1164
|
-
for (
|
|
1165
|
-
|
|
1164
|
+
if (Array.isArray(o))
|
|
1165
|
+
for (c = 0, u = o.length; c < u; c += 1)
|
|
1166
|
+
yn(e, n, o[c], r);
|
|
1166
1167
|
else
|
|
1167
|
-
|
|
1168
|
+
yn(e, n, o, r);
|
|
1168
1169
|
else
|
|
1169
|
-
!e.json && !
|
|
1170
|
+
!e.json && !G.call(r, t) && G.call(n, t) && (e.line = l || e.line, e.lineStart = a || e.lineStart, e.position = s || e.position, y(e, "duplicated mapping key")), cr(n, t, o), delete r[t];
|
|
1170
1171
|
return n;
|
|
1171
1172
|
}
|
|
1172
|
-
function
|
|
1173
|
+
function Ve(e) {
|
|
1173
1174
|
var n;
|
|
1174
1175
|
n = e.input.charCodeAt(e.position), n === 10 ? e.position++ : n === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : y(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
|
|
1175
1176
|
}
|
|
1176
|
-
function
|
|
1177
|
+
function F(e, n, r) {
|
|
1177
1178
|
for (var i = 0, t = e.input.charCodeAt(e.position); t !== 0; ) {
|
|
1178
|
-
for (;
|
|
1179
|
+
for (; Q(t); )
|
|
1179
1180
|
t === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), t = e.input.charCodeAt(++e.position);
|
|
1180
1181
|
if (n && t === 35)
|
|
1181
1182
|
do
|
|
1182
1183
|
t = e.input.charCodeAt(++e.position);
|
|
1183
1184
|
while (t !== 10 && t !== 13 && t !== 0);
|
|
1184
|
-
if (
|
|
1185
|
-
for (
|
|
1185
|
+
if (H(t))
|
|
1186
|
+
for (Ve(e), t = e.input.charCodeAt(e.position), i++, e.lineIndent = 0; t === 32; )
|
|
1186
1187
|
e.lineIndent++, t = e.input.charCodeAt(++e.position);
|
|
1187
1188
|
else
|
|
1188
1189
|
break;
|
|
1189
1190
|
}
|
|
1190
|
-
return r !== -1 && i !== 0 && e.lineIndent < r &&
|
|
1191
|
+
return r !== -1 && i !== 0 && e.lineIndent < r && Se(e, "deficient indentation"), i;
|
|
1191
1192
|
}
|
|
1192
|
-
function
|
|
1193
|
+
function Fe(e) {
|
|
1193
1194
|
var n = e.position, r;
|
|
1194
|
-
return r = e.input.charCodeAt(n), !!((r === 45 || r === 46) && r === e.input.charCodeAt(n + 1) && r === e.input.charCodeAt(n + 2) && (n += 3, r = e.input.charCodeAt(n), r === 0 ||
|
|
1195
|
+
return r = e.input.charCodeAt(n), !!((r === 45 || r === 46) && r === e.input.charCodeAt(n + 1) && r === e.input.charCodeAt(n + 2) && (n += 3, r = e.input.charCodeAt(n), r === 0 || U(r)));
|
|
1195
1196
|
}
|
|
1196
|
-
function
|
|
1197
|
-
n === 1 ? e.result += " " : n > 1 && (e.result +=
|
|
1197
|
+
function Xe(e, n) {
|
|
1198
|
+
n === 1 ? e.result += " " : n > 1 && (e.result += T.repeat(`
|
|
1198
1199
|
`, n - 1));
|
|
1199
1200
|
}
|
|
1200
|
-
function
|
|
1201
|
-
var i, t,
|
|
1202
|
-
if (
|
|
1201
|
+
function lt(e, n, r) {
|
|
1202
|
+
var i, t, o, l, a, s, c, u, f = e.kind, d = e.result, g;
|
|
1203
|
+
if (g = e.input.charCodeAt(e.position), U(g) || ie(g) || g === 35 || g === 38 || g === 42 || g === 33 || g === 124 || g === 62 || g === 39 || g === 34 || g === 37 || g === 64 || g === 96 || (g === 63 || g === 45) && (t = e.input.charCodeAt(e.position + 1), U(t) || r && ie(t)))
|
|
1203
1204
|
return !1;
|
|
1204
|
-
for (e.kind = "scalar", e.result = "",
|
|
1205
|
-
if (
|
|
1206
|
-
if (t = e.input.charCodeAt(e.position + 1),
|
|
1205
|
+
for (e.kind = "scalar", e.result = "", o = l = e.position, a = !1; g !== 0; ) {
|
|
1206
|
+
if (g === 58) {
|
|
1207
|
+
if (t = e.input.charCodeAt(e.position + 1), U(t) || r && ie(t))
|
|
1207
1208
|
break;
|
|
1208
|
-
} else if (
|
|
1209
|
-
if (i = e.input.charCodeAt(e.position - 1),
|
|
1209
|
+
} else if (g === 35) {
|
|
1210
|
+
if (i = e.input.charCodeAt(e.position - 1), U(i))
|
|
1210
1211
|
break;
|
|
1211
1212
|
} else {
|
|
1212
|
-
if (e.position === e.lineStart &&
|
|
1213
|
+
if (e.position === e.lineStart && Fe(e) || r && ie(g))
|
|
1213
1214
|
break;
|
|
1214
|
-
if (
|
|
1215
|
-
if (
|
|
1216
|
-
a = !0,
|
|
1215
|
+
if (H(g))
|
|
1216
|
+
if (s = e.line, c = e.lineStart, u = e.lineIndent, F(e, !1, -1), e.lineIndent >= n) {
|
|
1217
|
+
a = !0, g = e.input.charCodeAt(e.position);
|
|
1217
1218
|
continue;
|
|
1218
1219
|
} else {
|
|
1219
|
-
e.position =
|
|
1220
|
+
e.position = l, e.line = s, e.lineStart = c, e.lineIndent = u;
|
|
1220
1221
|
break;
|
|
1221
1222
|
}
|
|
1222
1223
|
}
|
|
1223
|
-
a && (
|
|
1224
|
+
a && (q(e, o, l, !1), Xe(e, e.line - s), o = l = e.position, a = !1), Q(g) || (l = e.position + 1), g = e.input.charCodeAt(++e.position);
|
|
1224
1225
|
}
|
|
1225
|
-
return
|
|
1226
|
+
return q(e, o, l, !1), e.result ? !0 : (e.kind = f, e.result = d, !1);
|
|
1226
1227
|
}
|
|
1227
|
-
function
|
|
1228
|
+
function at(e, n) {
|
|
1228
1229
|
var r, i, t;
|
|
1229
1230
|
if (r = e.input.charCodeAt(e.position), r !== 39)
|
|
1230
1231
|
return !1;
|
|
1231
1232
|
for (e.kind = "scalar", e.result = "", e.position++, i = t = e.position; (r = e.input.charCodeAt(e.position)) !== 0; )
|
|
1232
1233
|
if (r === 39)
|
|
1233
|
-
if (
|
|
1234
|
+
if (q(e, i, e.position, !0), r = e.input.charCodeAt(++e.position), r === 39)
|
|
1234
1235
|
i = e.position, e.position++, t = e.position;
|
|
1235
1236
|
else
|
|
1236
1237
|
return !0;
|
|
1237
|
-
else
|
|
1238
|
+
else H(r) ? (q(e, i, t, !0), Xe(e, F(e, !1, n)), i = t = e.position) : e.position === e.lineStart && Fe(e) ? y(e, "unexpected end of the document within a single quoted scalar") : (e.position++, t = e.position);
|
|
1238
1239
|
y(e, "unexpected end of the stream within a single quoted scalar");
|
|
1239
1240
|
}
|
|
1240
|
-
function
|
|
1241
|
-
var r, i, t,
|
|
1241
|
+
function st(e, n) {
|
|
1242
|
+
var r, i, t, o, l, a;
|
|
1242
1243
|
if (a = e.input.charCodeAt(e.position), a !== 34)
|
|
1243
1244
|
return !1;
|
|
1244
1245
|
for (e.kind = "scalar", e.result = "", e.position++, r = i = e.position; (a = e.input.charCodeAt(e.position)) !== 0; ) {
|
|
1245
1246
|
if (a === 34)
|
|
1246
|
-
return
|
|
1247
|
+
return q(e, r, e.position, !0), e.position++, !0;
|
|
1247
1248
|
if (a === 92) {
|
|
1248
|
-
if (
|
|
1249
|
-
|
|
1250
|
-
else if (a < 256 &&
|
|
1251
|
-
e.result +=
|
|
1252
|
-
else if ((
|
|
1253
|
-
for (t =
|
|
1254
|
-
a = e.input.charCodeAt(++e.position), (
|
|
1255
|
-
e.result +=
|
|
1249
|
+
if (q(e, r, e.position, !0), a = e.input.charCodeAt(++e.position), H(a))
|
|
1250
|
+
F(e, !1, n);
|
|
1251
|
+
else if (a < 256 && ur[a])
|
|
1252
|
+
e.result += fr[a], e.position++;
|
|
1253
|
+
else if ((l = rt(a)) > 0) {
|
|
1254
|
+
for (t = l, o = 0; t > 0; t--)
|
|
1255
|
+
a = e.input.charCodeAt(++e.position), (l = nt(a)) >= 0 ? o = (o << 4) + l : y(e, "expected hexadecimal character");
|
|
1256
|
+
e.result += tt(o), e.position++;
|
|
1256
1257
|
} else
|
|
1257
1258
|
y(e, "unknown escape sequence");
|
|
1258
1259
|
r = i = e.position;
|
|
1259
|
-
} else
|
|
1260
|
+
} else H(a) ? (q(e, r, i, !0), Xe(e, F(e, !1, n)), r = i = e.position) : e.position === e.lineStart && Fe(e) ? y(e, "unexpected end of the document within a double quoted scalar") : (e.position++, i = e.position);
|
|
1260
1261
|
}
|
|
1261
1262
|
y(e, "unexpected end of the stream within a double quoted scalar");
|
|
1262
1263
|
}
|
|
1263
|
-
function
|
|
1264
|
-
var r = !0, i, t,
|
|
1265
|
-
if (
|
|
1266
|
-
|
|
1267
|
-
else if (
|
|
1268
|
-
|
|
1264
|
+
function ct(e, n) {
|
|
1265
|
+
var r = !0, i, t, o, l = e.tag, a, s = e.anchor, c, u, f, d, g, v = /* @__PURE__ */ Object.create(null), h, A, C, x;
|
|
1266
|
+
if (x = e.input.charCodeAt(e.position), x === 91)
|
|
1267
|
+
u = 93, g = !1, a = [];
|
|
1268
|
+
else if (x === 123)
|
|
1269
|
+
u = 125, g = !0, a = {};
|
|
1269
1270
|
else
|
|
1270
1271
|
return !1;
|
|
1271
|
-
for (e.anchor !== null && (e.anchorMap[e.anchor] = a),
|
|
1272
|
-
if (
|
|
1273
|
-
return e.position++, e.tag =
|
|
1274
|
-
r ?
|
|
1272
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = a), x = e.input.charCodeAt(++e.position); x !== 0; ) {
|
|
1273
|
+
if (F(e, !0, n), x = e.input.charCodeAt(e.position), x === u)
|
|
1274
|
+
return e.position++, e.tag = l, e.anchor = s, e.kind = g ? "mapping" : "sequence", e.result = a, !0;
|
|
1275
|
+
r ? x === 44 && y(e, "expected the node content, but found ','") : y(e, "missed comma between flow collection entries"), A = h = C = null, f = d = !1, x === 63 && (c = e.input.charCodeAt(e.position + 1), U(c) && (f = d = !0, e.position++, F(e, !0, n))), i = e.line, t = e.lineStart, o = e.position, oe(e, n, Ce, !1, !0), A = e.tag, h = e.result, F(e, !0, n), x = e.input.charCodeAt(e.position), (d || e.line === i) && x === 58 && (f = !0, x = e.input.charCodeAt(++e.position), F(e, !0, n), oe(e, n, Ce, !1, !0), C = e.result), g ? te(e, a, v, A, h, C, i, t, o) : f ? a.push(te(e, null, v, A, h, C, i, t, o)) : a.push(h), F(e, !0, n), x = e.input.charCodeAt(e.position), x === 44 ? (r = !0, x = e.input.charCodeAt(++e.position)) : r = !1;
|
|
1275
1276
|
}
|
|
1276
1277
|
y(e, "unexpected end of the stream within a flow collection");
|
|
1277
1278
|
}
|
|
1278
|
-
function
|
|
1279
|
-
var r, i, t =
|
|
1279
|
+
function ut(e, n) {
|
|
1280
|
+
var r, i, t = Re, o = !1, l = !1, a = n, s = 0, c = !1, u, f;
|
|
1280
1281
|
if (f = e.input.charCodeAt(e.position), f === 124)
|
|
1281
1282
|
i = !1;
|
|
1282
1283
|
else if (f === 62)
|
|
@@ -1285,172 +1286,172 @@ function lt(e, n) {
|
|
|
1285
1286
|
return !1;
|
|
1286
1287
|
for (e.kind = "scalar", e.result = ""; f !== 0; )
|
|
1287
1288
|
if (f = e.input.charCodeAt(++e.position), f === 43 || f === 45)
|
|
1288
|
-
|
|
1289
|
-
else if ((
|
|
1290
|
-
|
|
1289
|
+
Re === t ? t = f === 43 ? dn : Qi : y(e, "repeat of a chomping mode identifier");
|
|
1290
|
+
else if ((u = it(f)) >= 0)
|
|
1291
|
+
u === 0 ? y(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : l ? y(e, "repeat of an indentation width identifier") : (a = n + u - 1, l = !0);
|
|
1291
1292
|
else
|
|
1292
1293
|
break;
|
|
1293
|
-
if (
|
|
1294
|
+
if (Q(f)) {
|
|
1294
1295
|
do
|
|
1295
1296
|
f = e.input.charCodeAt(++e.position);
|
|
1296
|
-
while (
|
|
1297
|
+
while (Q(f));
|
|
1297
1298
|
if (f === 35)
|
|
1298
1299
|
do
|
|
1299
1300
|
f = e.input.charCodeAt(++e.position);
|
|
1300
|
-
while (!
|
|
1301
|
+
while (!H(f) && f !== 0);
|
|
1301
1302
|
}
|
|
1302
1303
|
for (; f !== 0; ) {
|
|
1303
|
-
for (
|
|
1304
|
+
for (Ve(e), e.lineIndent = 0, f = e.input.charCodeAt(e.position); (!l || e.lineIndent < a) && f === 32; )
|
|
1304
1305
|
e.lineIndent++, f = e.input.charCodeAt(++e.position);
|
|
1305
|
-
if (!
|
|
1306
|
-
|
|
1306
|
+
if (!l && e.lineIndent > a && (a = e.lineIndent), H(f)) {
|
|
1307
|
+
s++;
|
|
1307
1308
|
continue;
|
|
1308
1309
|
}
|
|
1309
1310
|
if (e.lineIndent < a) {
|
|
1310
|
-
t ===
|
|
1311
|
-
`,
|
|
1311
|
+
t === dn ? e.result += T.repeat(`
|
|
1312
|
+
`, o ? 1 + s : s) : t === Re && o && (e.result += `
|
|
1312
1313
|
`);
|
|
1313
1314
|
break;
|
|
1314
1315
|
}
|
|
1315
|
-
for (i ?
|
|
1316
|
-
`,
|
|
1317
|
-
`,
|
|
1318
|
-
`,
|
|
1319
|
-
`,
|
|
1316
|
+
for (i ? Q(f) ? (c = !0, e.result += T.repeat(`
|
|
1317
|
+
`, o ? 1 + s : s)) : c ? (c = !1, e.result += T.repeat(`
|
|
1318
|
+
`, s + 1)) : s === 0 ? o && (e.result += " ") : e.result += T.repeat(`
|
|
1319
|
+
`, s) : e.result += T.repeat(`
|
|
1320
|
+
`, o ? 1 + s : s), o = !0, l = !0, s = 0, r = e.position; !H(f) && f !== 0; )
|
|
1320
1321
|
f = e.input.charCodeAt(++e.position);
|
|
1321
|
-
|
|
1322
|
+
q(e, r, e.position, !1);
|
|
1322
1323
|
}
|
|
1323
1324
|
return !0;
|
|
1324
1325
|
}
|
|
1325
|
-
function
|
|
1326
|
-
var r, i = e.tag, t = e.anchor,
|
|
1326
|
+
function vn(e, n) {
|
|
1327
|
+
var r, i = e.tag, t = e.anchor, o = [], l, a = !1, s;
|
|
1327
1328
|
if (e.firstTabInLine !== -1) return !1;
|
|
1328
|
-
for (e.anchor !== null && (e.anchorMap[e.anchor] =
|
|
1329
|
-
if (a = !0, e.position++,
|
|
1330
|
-
|
|
1329
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = o), s = e.input.charCodeAt(e.position); s !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, y(e, "tab characters must not be used in indentation")), !(s !== 45 || (l = e.input.charCodeAt(e.position + 1), !U(l)))); ) {
|
|
1330
|
+
if (a = !0, e.position++, F(e, !0, -1) && e.lineIndent <= n) {
|
|
1331
|
+
o.push(null), s = e.input.charCodeAt(e.position);
|
|
1331
1332
|
continue;
|
|
1332
1333
|
}
|
|
1333
|
-
if (r = e.line,
|
|
1334
|
+
if (r = e.line, oe(e, n, lr, !1, !0), o.push(e.result), F(e, !0, -1), s = e.input.charCodeAt(e.position), (e.line === r || e.lineIndent > n) && s !== 0)
|
|
1334
1335
|
y(e, "bad indentation of a sequence entry");
|
|
1335
1336
|
else if (e.lineIndent < n)
|
|
1336
1337
|
break;
|
|
1337
1338
|
}
|
|
1338
|
-
return a ? (e.tag = i, e.anchor = t, e.kind = "sequence", e.result =
|
|
1339
|
+
return a ? (e.tag = i, e.anchor = t, e.kind = "sequence", e.result = o, !0) : !1;
|
|
1339
1340
|
}
|
|
1340
|
-
function
|
|
1341
|
-
var i, t,
|
|
1341
|
+
function ft(e, n, r) {
|
|
1342
|
+
var i, t, o, l, a, s, c = e.tag, u = e.anchor, f = {}, d = /* @__PURE__ */ Object.create(null), g = null, v = null, h = null, A = !1, C = !1, x;
|
|
1342
1343
|
if (e.firstTabInLine !== -1) return !1;
|
|
1343
|
-
for (e.anchor !== null && (e.anchorMap[e.anchor] = f),
|
|
1344
|
-
if (!A && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, y(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1),
|
|
1345
|
-
|
|
1344
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = f), x = e.input.charCodeAt(e.position); x !== 0; ) {
|
|
1345
|
+
if (!A && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, y(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1), o = e.line, (x === 63 || x === 58) && U(i))
|
|
1346
|
+
x === 63 ? (A && (te(e, f, d, g, v, null, l, a, s), g = v = h = null), C = !0, A = !0, t = !0) : A ? (A = !1, t = !0) : y(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, x = i;
|
|
1346
1347
|
else {
|
|
1347
|
-
if (
|
|
1348
|
+
if (l = e.line, a = e.lineStart, s = e.position, !oe(e, r, or, !1, !0))
|
|
1348
1349
|
break;
|
|
1349
|
-
if (e.line ===
|
|
1350
|
-
for (
|
|
1351
|
-
|
|
1352
|
-
if (
|
|
1353
|
-
|
|
1354
|
-
else if (
|
|
1350
|
+
if (e.line === o) {
|
|
1351
|
+
for (x = e.input.charCodeAt(e.position); Q(x); )
|
|
1352
|
+
x = e.input.charCodeAt(++e.position);
|
|
1353
|
+
if (x === 58)
|
|
1354
|
+
x = e.input.charCodeAt(++e.position), U(x) || y(e, "a whitespace character is expected after the key-value separator within a block mapping"), A && (te(e, f, d, g, v, null, l, a, s), g = v = h = null), C = !0, A = !1, t = !1, g = e.tag, v = e.result;
|
|
1355
|
+
else if (C)
|
|
1355
1356
|
y(e, "can not read an implicit mapping pair; a colon is missed");
|
|
1356
1357
|
else
|
|
1357
|
-
return e.tag =
|
|
1358
|
-
} else if (
|
|
1358
|
+
return e.tag = c, e.anchor = u, !0;
|
|
1359
|
+
} else if (C)
|
|
1359
1360
|
y(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1360
1361
|
else
|
|
1361
|
-
return e.tag =
|
|
1362
|
+
return e.tag = c, e.anchor = u, !0;
|
|
1362
1363
|
}
|
|
1363
|
-
if ((e.line ===
|
|
1364
|
+
if ((e.line === o || e.lineIndent > n) && (A && (l = e.line, a = e.lineStart, s = e.position), oe(e, n, ke, !0, t) && (A ? v = e.result : h = e.result), A || (te(e, f, d, g, v, h, l, a, s), g = v = h = null), F(e, !0, -1), x = e.input.charCodeAt(e.position)), (e.line === o || e.lineIndent > n) && x !== 0)
|
|
1364
1365
|
y(e, "bad indentation of a mapping entry");
|
|
1365
1366
|
else if (e.lineIndent < n)
|
|
1366
1367
|
break;
|
|
1367
1368
|
}
|
|
1368
|
-
return A &&
|
|
1369
|
+
return A && te(e, f, d, g, v, null, l, a, s), C && (e.tag = c, e.anchor = u, e.kind = "mapping", e.result = f), C;
|
|
1369
1370
|
}
|
|
1370
|
-
function
|
|
1371
|
-
var n, r = !1, i = !1, t,
|
|
1372
|
-
if (
|
|
1373
|
-
if (e.tag !== null && y(e, "duplication of a tag property"),
|
|
1371
|
+
function pt(e) {
|
|
1372
|
+
var n, r = !1, i = !1, t, o, l;
|
|
1373
|
+
if (l = e.input.charCodeAt(e.position), l !== 33) return !1;
|
|
1374
|
+
if (e.tag !== null && y(e, "duplication of a tag property"), l = e.input.charCodeAt(++e.position), l === 60 ? (r = !0, l = e.input.charCodeAt(++e.position)) : l === 33 ? (i = !0, t = "!!", l = e.input.charCodeAt(++e.position)) : t = "!", n = e.position, r) {
|
|
1374
1375
|
do
|
|
1375
|
-
|
|
1376
|
-
while (
|
|
1377
|
-
e.position < e.length ? (
|
|
1376
|
+
l = e.input.charCodeAt(++e.position);
|
|
1377
|
+
while (l !== 0 && l !== 62);
|
|
1378
|
+
e.position < e.length ? (o = e.input.slice(n, e.position), l = e.input.charCodeAt(++e.position)) : y(e, "unexpected end of the stream within a verbatim tag");
|
|
1378
1379
|
} else {
|
|
1379
|
-
for (;
|
|
1380
|
-
|
|
1381
|
-
|
|
1380
|
+
for (; l !== 0 && !U(l); )
|
|
1381
|
+
l === 33 && (i ? y(e, "tag suffix cannot contain exclamation marks") : (t = e.input.slice(n - 1, e.position + 1), ar.test(t) || y(e, "named tag handle cannot contain such characters"), i = !0, n = e.position + 1)), l = e.input.charCodeAt(++e.position);
|
|
1382
|
+
o = e.input.slice(n, e.position), et.test(o) && y(e, "tag suffix cannot contain flow indicator characters");
|
|
1382
1383
|
}
|
|
1383
|
-
|
|
1384
|
+
o && !sr.test(o) && y(e, "tag name cannot contain such characters: " + o);
|
|
1384
1385
|
try {
|
|
1385
|
-
|
|
1386
|
+
o = decodeURIComponent(o);
|
|
1386
1387
|
} catch {
|
|
1387
|
-
y(e, "tag name is malformed: " +
|
|
1388
|
+
y(e, "tag name is malformed: " + o);
|
|
1388
1389
|
}
|
|
1389
|
-
return r ? e.tag =
|
|
1390
|
+
return r ? e.tag = o : G.call(e.tagMap, t) ? e.tag = e.tagMap[t] + o : t === "!" ? e.tag = "!" + o : t === "!!" ? e.tag = "tag:yaml.org,2002:" + o : y(e, 'undeclared tag handle "' + t + '"'), !0;
|
|
1390
1391
|
}
|
|
1391
|
-
function
|
|
1392
|
+
function dt(e) {
|
|
1392
1393
|
var n, r;
|
|
1393
1394
|
if (r = e.input.charCodeAt(e.position), r !== 38) return !1;
|
|
1394
|
-
for (e.anchor !== null && y(e, "duplication of an anchor property"), r = e.input.charCodeAt(++e.position), n = e.position; r !== 0 && !
|
|
1395
|
+
for (e.anchor !== null && y(e, "duplication of an anchor property"), r = e.input.charCodeAt(++e.position), n = e.position; r !== 0 && !U(r) && !ie(r); )
|
|
1395
1396
|
r = e.input.charCodeAt(++e.position);
|
|
1396
1397
|
return e.position === n && y(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(n, e.position), !0;
|
|
1397
1398
|
}
|
|
1398
|
-
function
|
|
1399
|
+
function ht(e) {
|
|
1399
1400
|
var n, r, i;
|
|
1400
1401
|
if (i = e.input.charCodeAt(e.position), i !== 42) return !1;
|
|
1401
|
-
for (i = e.input.charCodeAt(++e.position), n = e.position; i !== 0 && !
|
|
1402
|
+
for (i = e.input.charCodeAt(++e.position), n = e.position; i !== 0 && !U(i) && !ie(i); )
|
|
1402
1403
|
i = e.input.charCodeAt(++e.position);
|
|
1403
|
-
return e.position === n && y(e, "name of an alias node must contain at least one character"), r = e.input.slice(n, e.position),
|
|
1404
|
-
}
|
|
1405
|
-
function
|
|
1406
|
-
var
|
|
1407
|
-
if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null,
|
|
1408
|
-
for (;
|
|
1409
|
-
|
|
1410
|
-
if (a && (a =
|
|
1404
|
+
return e.position === n && y(e, "name of an alias node must contain at least one character"), r = e.input.slice(n, e.position), G.call(e.anchorMap, r) || y(e, 'unidentified alias "' + r + '"'), e.result = e.anchorMap[r], F(e, !0, -1), !0;
|
|
1405
|
+
}
|
|
1406
|
+
function oe(e, n, r, i, t) {
|
|
1407
|
+
var o, l, a, s = 1, c = !1, u = !1, f, d, g, v, h, A;
|
|
1408
|
+
if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, o = l = a = ke === r || lr === r, i && F(e, !0, -1) && (c = !0, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)), s === 1)
|
|
1409
|
+
for (; pt(e) || dt(e); )
|
|
1410
|
+
F(e, !0, -1) ? (c = !0, a = o, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)) : a = !1;
|
|
1411
|
+
if (a && (a = c || t), (s === 1 || ke === r) && (Ce === r || or === r ? h = n : h = n + 1, A = e.position - e.lineStart, s === 1 ? a && (vn(e, A) || ft(e, A, h)) || ct(e, h) ? u = !0 : (l && ut(e, h) || at(e, h) || st(e, h) ? u = !0 : ht(e) ? (u = !0, (e.tag !== null || e.anchor !== null) && y(e, "alias node should not have any properties")) : lt(e, h, Ce === r) && (u = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : s === 0 && (u = a && vn(e, A))), e.tag === null)
|
|
1411
1412
|
e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
|
|
1412
1413
|
else if (e.tag === "?") {
|
|
1413
|
-
for (e.result !== null && e.kind !== "scalar" && y(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0,
|
|
1414
|
-
if (
|
|
1415
|
-
e.result =
|
|
1414
|
+
for (e.result !== null && e.kind !== "scalar" && y(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0, d = e.implicitTypes.length; f < d; f += 1)
|
|
1415
|
+
if (v = e.implicitTypes[f], v.resolve(e.result)) {
|
|
1416
|
+
e.result = v.construct(e.result), e.tag = v.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
|
|
1416
1417
|
break;
|
|
1417
1418
|
}
|
|
1418
1419
|
} else if (e.tag !== "!") {
|
|
1419
|
-
if (
|
|
1420
|
-
|
|
1420
|
+
if (G.call(e.typeMap[e.kind || "fallback"], e.tag))
|
|
1421
|
+
v = e.typeMap[e.kind || "fallback"][e.tag];
|
|
1421
1422
|
else
|
|
1422
|
-
for (
|
|
1423
|
-
if (e.tag.slice(0,
|
|
1424
|
-
|
|
1423
|
+
for (v = null, g = e.typeMap.multi[e.kind || "fallback"], f = 0, d = g.length; f < d; f += 1)
|
|
1424
|
+
if (e.tag.slice(0, g[f].tag.length) === g[f].tag) {
|
|
1425
|
+
v = g[f];
|
|
1425
1426
|
break;
|
|
1426
1427
|
}
|
|
1427
|
-
|
|
1428
|
-
}
|
|
1429
|
-
return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null ||
|
|
1430
|
-
}
|
|
1431
|
-
function
|
|
1432
|
-
var n = e.position, r, i, t,
|
|
1433
|
-
for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (
|
|
1434
|
-
for (
|
|
1435
|
-
|
|
1436
|
-
for (i = e.input.slice(r, e.position), t = [], i.length < 1 && y(e, "directive name must not be less than one character in length");
|
|
1437
|
-
for (;
|
|
1438
|
-
|
|
1439
|
-
if (
|
|
1428
|
+
v || y(e, "unknown tag !<" + e.tag + ">"), e.result !== null && v.kind !== e.kind && y(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + v.kind + '", not "' + e.kind + '"'), v.resolve(e.result, e.tag) ? (e.result = v.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : y(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
|
|
1429
|
+
}
|
|
1430
|
+
return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || u;
|
|
1431
|
+
}
|
|
1432
|
+
function gt(e) {
|
|
1433
|
+
var n = e.position, r, i, t, o = !1, l;
|
|
1434
|
+
for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (l = e.input.charCodeAt(e.position)) !== 0 && (F(e, !0, -1), l = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || l !== 37)); ) {
|
|
1435
|
+
for (o = !0, l = e.input.charCodeAt(++e.position), r = e.position; l !== 0 && !U(l); )
|
|
1436
|
+
l = e.input.charCodeAt(++e.position);
|
|
1437
|
+
for (i = e.input.slice(r, e.position), t = [], i.length < 1 && y(e, "directive name must not be less than one character in length"); l !== 0; ) {
|
|
1438
|
+
for (; Q(l); )
|
|
1439
|
+
l = e.input.charCodeAt(++e.position);
|
|
1440
|
+
if (l === 35) {
|
|
1440
1441
|
do
|
|
1441
|
-
|
|
1442
|
-
while (
|
|
1442
|
+
l = e.input.charCodeAt(++e.position);
|
|
1443
|
+
while (l !== 0 && !H(l));
|
|
1443
1444
|
break;
|
|
1444
1445
|
}
|
|
1445
|
-
if (
|
|
1446
|
-
for (r = e.position;
|
|
1447
|
-
|
|
1446
|
+
if (H(l)) break;
|
|
1447
|
+
for (r = e.position; l !== 0 && !U(l); )
|
|
1448
|
+
l = e.input.charCodeAt(++e.position);
|
|
1448
1449
|
t.push(e.input.slice(r, e.position));
|
|
1449
1450
|
}
|
|
1450
|
-
|
|
1451
|
+
l !== 0 && Ve(e), G.call(mn, i) ? mn[i](e, i, t) : Se(e, 'unknown document directive "' + i + '"');
|
|
1451
1452
|
}
|
|
1452
|
-
if (
|
|
1453
|
-
e.input.charCodeAt(e.position) === 46 && (e.position += 3,
|
|
1453
|
+
if (F(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, F(e, !0, -1)) : o && y(e, "directives end mark is expected"), oe(e, e.lineIndent - 1, ke, !1, !0), F(e, !0, -1), e.checkLineBreaks && Zi.test(e.input.slice(n, e.position)) && Se(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && Fe(e)) {
|
|
1454
|
+
e.input.charCodeAt(e.position) === 46 && (e.position += 3, F(e, !0, -1));
|
|
1454
1455
|
return;
|
|
1455
1456
|
}
|
|
1456
1457
|
if (e.position < e.length - 1)
|
|
@@ -1458,52 +1459,52 @@ function ft(e) {
|
|
|
1458
1459
|
else
|
|
1459
1460
|
return;
|
|
1460
1461
|
}
|
|
1461
|
-
function
|
|
1462
|
+
function dr(e, n) {
|
|
1462
1463
|
e = String(e), n = n || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
|
|
1463
1464
|
`), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
|
|
1464
|
-
var r = new
|
|
1465
|
+
var r = new ot(e, n), i = e.indexOf("\0");
|
|
1465
1466
|
for (i !== -1 && (r.position = i, y(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; )
|
|
1466
1467
|
r.lineIndent += 1, r.position += 1;
|
|
1467
1468
|
for (; r.position < r.length - 1; )
|
|
1468
|
-
|
|
1469
|
+
gt(r);
|
|
1469
1470
|
return r.documents;
|
|
1470
1471
|
}
|
|
1471
|
-
function
|
|
1472
|
+
function mt(e, n, r) {
|
|
1472
1473
|
n !== null && typeof n == "object" && typeof r > "u" && (r = n, n = null);
|
|
1473
|
-
var i =
|
|
1474
|
+
var i = dr(e, r);
|
|
1474
1475
|
if (typeof n != "function")
|
|
1475
1476
|
return i;
|
|
1476
|
-
for (var t = 0,
|
|
1477
|
+
for (var t = 0, o = i.length; t < o; t += 1)
|
|
1477
1478
|
n(i[t]);
|
|
1478
1479
|
}
|
|
1479
|
-
function
|
|
1480
|
-
var r =
|
|
1480
|
+
function yt(e, n) {
|
|
1481
|
+
var r = dr(e, n);
|
|
1481
1482
|
if (r.length !== 0) {
|
|
1482
1483
|
if (r.length === 1)
|
|
1483
1484
|
return r[0];
|
|
1484
|
-
throw new
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
var
|
|
1488
|
-
loadAll:
|
|
1489
|
-
load:
|
|
1490
|
-
},
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
var
|
|
1485
|
+
throw new M("expected a single document in the stream, but found more");
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
var vt = mt, xt = yt, hr = {
|
|
1489
|
+
loadAll: vt,
|
|
1490
|
+
load: xt
|
|
1491
|
+
}, gr = Object.prototype.toString, mr = Object.prototype.hasOwnProperty, Qe = 65279, wt = 9, pe = 10, bt = 13, At = 32, Ct = 33, kt = 34, ze = 35, St = 37, Et = 38, _t = 39, Ot = 42, yr = 44, Ft = 45, Ee = 58, Tt = 61, Lt = 62, jt = 63, It = 64, vr = 91, xr = 93, Nt = 96, wr = 123, Rt = 124, br = 125, N = {};
|
|
1492
|
+
N[0] = "\\0";
|
|
1493
|
+
N[7] = "\\a";
|
|
1494
|
+
N[8] = "\\b";
|
|
1495
|
+
N[9] = "\\t";
|
|
1496
|
+
N[10] = "\\n";
|
|
1497
|
+
N[11] = "\\v";
|
|
1498
|
+
N[12] = "\\f";
|
|
1499
|
+
N[13] = "\\r";
|
|
1500
|
+
N[27] = "\\e";
|
|
1501
|
+
N[34] = '\\"';
|
|
1502
|
+
N[92] = "\\\\";
|
|
1503
|
+
N[133] = "\\N";
|
|
1504
|
+
N[160] = "\\_";
|
|
1505
|
+
N[8232] = "\\L";
|
|
1506
|
+
N[8233] = "\\P";
|
|
1507
|
+
var Pt = [
|
|
1507
1508
|
"y",
|
|
1508
1509
|
"Y",
|
|
1509
1510
|
"yes",
|
|
@@ -1520,15 +1521,15 @@ var jt = [
|
|
|
1520
1521
|
"off",
|
|
1521
1522
|
"Off",
|
|
1522
1523
|
"OFF"
|
|
1523
|
-
],
|
|
1524
|
-
function
|
|
1525
|
-
var r, i, t,
|
|
1524
|
+
], Mt = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
1525
|
+
function Dt(e, n) {
|
|
1526
|
+
var r, i, t, o, l, a, s;
|
|
1526
1527
|
if (n === null) return {};
|
|
1527
|
-
for (r = {}, i = Object.keys(n), t = 0,
|
|
1528
|
-
|
|
1528
|
+
for (r = {}, i = Object.keys(n), t = 0, o = i.length; t < o; t += 1)
|
|
1529
|
+
l = i[t], a = String(n[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), s = e.compiledTypeMap.fallback[l], s && mr.call(s.styleAliases, a) && (a = s.styleAliases[a]), r[l] = a;
|
|
1529
1530
|
return r;
|
|
1530
1531
|
}
|
|
1531
|
-
function
|
|
1532
|
+
function $t(e) {
|
|
1532
1533
|
var n, r, i;
|
|
1533
1534
|
if (n = e.toString(16).toUpperCase(), e <= 255)
|
|
1534
1535
|
r = "x", i = 2;
|
|
@@ -1537,327 +1538,327 @@ function Rt(e) {
|
|
|
1537
1538
|
else if (e <= 4294967295)
|
|
1538
1539
|
r = "U", i = 8;
|
|
1539
1540
|
else
|
|
1540
|
-
throw new
|
|
1541
|
-
return "\\" + r +
|
|
1541
|
+
throw new M("code point within a string may not be greater than 0xFFFFFFFF");
|
|
1542
|
+
return "\\" + r + T.repeat("0", i - n.length) + n;
|
|
1542
1543
|
}
|
|
1543
|
-
var
|
|
1544
|
-
function
|
|
1545
|
-
this.schema = e.schema || Ge, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel =
|
|
1544
|
+
var Bt = 1, de = 2;
|
|
1545
|
+
function zt(e) {
|
|
1546
|
+
this.schema = e.schema || Ge, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = T.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = Dt(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? de : Bt, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
|
|
1546
1547
|
}
|
|
1547
1548
|
function xn(e, n) {
|
|
1548
|
-
for (var r =
|
|
1549
|
+
for (var r = T.repeat(" ", n), i = 0, t = -1, o = "", l, a = e.length; i < a; )
|
|
1549
1550
|
t = e.indexOf(`
|
|
1550
|
-
`, i), t === -1 ? (
|
|
1551
|
-
` && (
|
|
1552
|
-
return
|
|
1551
|
+
`, i), t === -1 ? (l = e.slice(i), i = a) : (l = e.slice(i, t + 1), i = t + 1), l.length && l !== `
|
|
1552
|
+
` && (o += r), o += l;
|
|
1553
|
+
return o;
|
|
1553
1554
|
}
|
|
1554
|
-
function
|
|
1555
|
+
function Ue(e, n) {
|
|
1555
1556
|
return `
|
|
1556
|
-
` +
|
|
1557
|
+
` + T.repeat(" ", e.indent * n);
|
|
1557
1558
|
}
|
|
1558
|
-
function
|
|
1559
|
+
function Ut(e, n) {
|
|
1559
1560
|
var r, i, t;
|
|
1560
1561
|
for (r = 0, i = e.implicitTypes.length; r < i; r += 1)
|
|
1561
1562
|
if (t = e.implicitTypes[r], t.resolve(n))
|
|
1562
1563
|
return !0;
|
|
1563
1564
|
return !1;
|
|
1564
1565
|
}
|
|
1565
|
-
function
|
|
1566
|
-
return e ===
|
|
1566
|
+
function _e(e) {
|
|
1567
|
+
return e === At || e === wt;
|
|
1567
1568
|
}
|
|
1568
|
-
function
|
|
1569
|
-
return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !==
|
|
1569
|
+
function he(e) {
|
|
1570
|
+
return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== Qe || 65536 <= e && e <= 1114111;
|
|
1570
1571
|
}
|
|
1571
|
-
function
|
|
1572
|
-
return
|
|
1572
|
+
function wn(e) {
|
|
1573
|
+
return he(e) && e !== Qe && e !== bt && e !== pe;
|
|
1573
1574
|
}
|
|
1574
1575
|
function bn(e, n, r) {
|
|
1575
|
-
var i =
|
|
1576
|
+
var i = wn(e), t = i && !_e(e);
|
|
1576
1577
|
return (
|
|
1577
1578
|
// ns-plain-safe
|
|
1578
1579
|
(r ? (
|
|
1579
1580
|
// c = flow-in
|
|
1580
1581
|
i
|
|
1581
|
-
) : i && e !==
|
|
1582
|
+
) : i && e !== yr && e !== vr && e !== xr && e !== wr && e !== br) && e !== ze && !(n === Ee && !t) || wn(n) && !_e(n) && e === ze || n === Ee && t
|
|
1582
1583
|
);
|
|
1583
1584
|
}
|
|
1584
|
-
function
|
|
1585
|
-
return
|
|
1585
|
+
function Yt(e) {
|
|
1586
|
+
return he(e) && e !== Qe && !_e(e) && e !== Ft && e !== jt && e !== Ee && e !== yr && e !== vr && e !== xr && e !== wr && e !== br && e !== ze && e !== Et && e !== Ot && e !== Ct && e !== Rt && e !== Tt && e !== Lt && e !== _t && e !== kt && e !== St && e !== It && e !== Nt;
|
|
1586
1587
|
}
|
|
1587
|
-
function
|
|
1588
|
-
return !
|
|
1588
|
+
function Ht(e) {
|
|
1589
|
+
return !_e(e) && e !== Ee;
|
|
1589
1590
|
}
|
|
1590
|
-
function
|
|
1591
|
+
function ue(e, n) {
|
|
1591
1592
|
var r = e.charCodeAt(n), i;
|
|
1592
1593
|
return r >= 55296 && r <= 56319 && n + 1 < e.length && (i = e.charCodeAt(n + 1), i >= 56320 && i <= 57343) ? (r - 55296) * 1024 + i - 56320 + 65536 : r;
|
|
1593
1594
|
}
|
|
1594
|
-
function
|
|
1595
|
+
function Ar(e) {
|
|
1595
1596
|
var n = /^\n* /;
|
|
1596
1597
|
return n.test(e);
|
|
1597
1598
|
}
|
|
1598
|
-
var
|
|
1599
|
-
function
|
|
1600
|
-
var
|
|
1601
|
-
if (n ||
|
|
1602
|
-
for (
|
|
1603
|
-
if (
|
|
1604
|
-
return
|
|
1605
|
-
|
|
1599
|
+
var Cr = 1, Ye = 2, kr = 3, Sr = 4, re = 5;
|
|
1600
|
+
function Kt(e, n, r, i, t, o, l, a) {
|
|
1601
|
+
var s, c = 0, u = null, f = !1, d = !1, g = i !== -1, v = -1, h = Yt(ue(e, 0)) && Ht(ue(e, e.length - 1));
|
|
1602
|
+
if (n || l)
|
|
1603
|
+
for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
|
|
1604
|
+
if (c = ue(e, s), !he(c))
|
|
1605
|
+
return re;
|
|
1606
|
+
h = h && bn(c, u, a), u = c;
|
|
1606
1607
|
}
|
|
1607
1608
|
else {
|
|
1608
|
-
for (
|
|
1609
|
-
if (
|
|
1610
|
-
f = !0,
|
|
1611
|
-
|
|
1612
|
-
else if (!
|
|
1613
|
-
return
|
|
1614
|
-
|
|
1609
|
+
for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
|
|
1610
|
+
if (c = ue(e, s), c === pe)
|
|
1611
|
+
f = !0, g && (d = d || // Foldable line = too long, and not more-indented.
|
|
1612
|
+
s - v - 1 > i && e[v + 1] !== " ", v = s);
|
|
1613
|
+
else if (!he(c))
|
|
1614
|
+
return re;
|
|
1615
|
+
h = h && bn(c, u, a), u = c;
|
|
1615
1616
|
}
|
|
1616
|
-
|
|
1617
|
+
d = d || g && s - v - 1 > i && e[v + 1] !== " ";
|
|
1617
1618
|
}
|
|
1618
|
-
return !f && !
|
|
1619
|
+
return !f && !d ? h && !l && !t(e) ? Cr : o === de ? re : Ye : r > 9 && Ar(e) ? re : l ? o === de ? re : Ye : d ? Sr : kr;
|
|
1619
1620
|
}
|
|
1620
|
-
function
|
|
1621
|
+
function Wt(e, n, r, i, t) {
|
|
1621
1622
|
e.dump = (function() {
|
|
1622
1623
|
if (n.length === 0)
|
|
1623
|
-
return e.quotingType ===
|
|
1624
|
-
if (!e.noCompatMode && (
|
|
1625
|
-
return e.quotingType ===
|
|
1626
|
-
var
|
|
1627
|
-
function c
|
|
1628
|
-
return
|
|
1624
|
+
return e.quotingType === de ? '""' : "''";
|
|
1625
|
+
if (!e.noCompatMode && (Pt.indexOf(n) !== -1 || Mt.test(n)))
|
|
1626
|
+
return e.quotingType === de ? '"' + n + '"' : "'" + n + "'";
|
|
1627
|
+
var o = e.indent * Math.max(1, r), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - o), a = i || e.flowLevel > -1 && r >= e.flowLevel;
|
|
1628
|
+
function s(c) {
|
|
1629
|
+
return Ut(e, c);
|
|
1629
1630
|
}
|
|
1630
|
-
switch (
|
|
1631
|
+
switch (Kt(
|
|
1631
1632
|
n,
|
|
1632
1633
|
a,
|
|
1633
1634
|
e.indent,
|
|
1634
|
-
|
|
1635
|
-
|
|
1635
|
+
l,
|
|
1636
|
+
s,
|
|
1636
1637
|
e.quotingType,
|
|
1637
1638
|
e.forceQuotes && !i,
|
|
1638
1639
|
t
|
|
1639
1640
|
)) {
|
|
1640
|
-
case
|
|
1641
|
+
case Cr:
|
|
1641
1642
|
return n;
|
|
1642
|
-
case
|
|
1643
|
+
case Ye:
|
|
1643
1644
|
return "'" + n.replace(/'/g, "''") + "'";
|
|
1644
|
-
case
|
|
1645
|
-
return "|" +
|
|
1646
|
-
case
|
|
1647
|
-
return ">" +
|
|
1648
|
-
case
|
|
1649
|
-
return '"' +
|
|
1645
|
+
case kr:
|
|
1646
|
+
return "|" + An(n, e.indent) + Cn(xn(n, o));
|
|
1647
|
+
case Sr:
|
|
1648
|
+
return ">" + An(n, e.indent) + Cn(xn(qt(n, l), o));
|
|
1649
|
+
case re:
|
|
1650
|
+
return '"' + Gt(n) + '"';
|
|
1650
1651
|
default:
|
|
1651
|
-
throw new
|
|
1652
|
+
throw new M("impossible error: invalid scalar style");
|
|
1652
1653
|
}
|
|
1653
1654
|
})();
|
|
1654
1655
|
}
|
|
1655
|
-
function
|
|
1656
|
-
var r =
|
|
1656
|
+
function An(e, n) {
|
|
1657
|
+
var r = Ar(e) ? String(n) : "", i = e[e.length - 1] === `
|
|
1657
1658
|
`, t = i && (e[e.length - 2] === `
|
|
1658
1659
|
` || e === `
|
|
1659
|
-
`),
|
|
1660
|
-
return r +
|
|
1660
|
+
`), o = t ? "+" : i ? "" : "-";
|
|
1661
|
+
return r + o + `
|
|
1661
1662
|
`;
|
|
1662
1663
|
}
|
|
1663
|
-
function
|
|
1664
|
+
function Cn(e) {
|
|
1664
1665
|
return e[e.length - 1] === `
|
|
1665
1666
|
` ? e.slice(0, -1) : e;
|
|
1666
1667
|
}
|
|
1667
|
-
function
|
|
1668
|
+
function qt(e, n) {
|
|
1668
1669
|
for (var r = /(\n+)([^\n]*)/g, i = (function() {
|
|
1669
|
-
var
|
|
1670
|
+
var c = e.indexOf(`
|
|
1670
1671
|
`);
|
|
1671
|
-
return
|
|
1672
|
+
return c = c !== -1 ? c : e.length, r.lastIndex = c, kn(e.slice(0, c), n);
|
|
1672
1673
|
})(), t = e[0] === `
|
|
1673
|
-
` || e[0] === " ",
|
|
1674
|
-
var a =
|
|
1675
|
-
|
|
1676
|
-
` : "") +
|
|
1674
|
+
` || e[0] === " ", o, l; l = r.exec(e); ) {
|
|
1675
|
+
var a = l[1], s = l[2];
|
|
1676
|
+
o = s[0] === " ", i += a + (!t && !o && s !== "" ? `
|
|
1677
|
+
` : "") + kn(s, n), t = o;
|
|
1677
1678
|
}
|
|
1678
1679
|
return i;
|
|
1679
1680
|
}
|
|
1680
|
-
function
|
|
1681
|
+
function kn(e, n) {
|
|
1681
1682
|
if (e === "" || e[0] === " ") return e;
|
|
1682
|
-
for (var r = / [^ ]/g, i, t = 0,
|
|
1683
|
-
a = i.index, a - t > n && (
|
|
1684
|
-
` + e.slice(t,
|
|
1685
|
-
return
|
|
1686
|
-
`, e.length - t > n &&
|
|
1687
|
-
` + e.slice(
|
|
1688
|
-
}
|
|
1689
|
-
function
|
|
1683
|
+
for (var r = / [^ ]/g, i, t = 0, o, l = 0, a = 0, s = ""; i = r.exec(e); )
|
|
1684
|
+
a = i.index, a - t > n && (o = l > t ? l : a, s += `
|
|
1685
|
+
` + e.slice(t, o), t = o + 1), l = a;
|
|
1686
|
+
return s += `
|
|
1687
|
+
`, e.length - t > n && l > t ? s += e.slice(t, l) + `
|
|
1688
|
+
` + e.slice(l + 1) : s += e.slice(t), s.slice(1);
|
|
1689
|
+
}
|
|
1690
|
+
function Gt(e) {
|
|
1690
1691
|
for (var n = "", r = 0, i, t = 0; t < e.length; r >= 65536 ? t += 2 : t++)
|
|
1691
|
-
r =
|
|
1692
|
+
r = ue(e, t), i = N[r], !i && he(r) ? (n += e[t], r >= 65536 && (n += e[t + 1])) : n += i || $t(r);
|
|
1692
1693
|
return n;
|
|
1693
1694
|
}
|
|
1694
|
-
function
|
|
1695
|
-
var i = "", t = e.tag,
|
|
1696
|
-
for (
|
|
1697
|
-
a = r[
|
|
1695
|
+
function Vt(e, n, r) {
|
|
1696
|
+
var i = "", t = e.tag, o, l, a;
|
|
1697
|
+
for (o = 0, l = r.length; o < l; o += 1)
|
|
1698
|
+
a = r[o], e.replacer && (a = e.replacer.call(r, String(o), a)), (W(e, n, a, !1, !1) || typeof a > "u" && W(e, n, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
|
|
1698
1699
|
e.tag = t, e.dump = "[" + i + "]";
|
|
1699
1700
|
}
|
|
1700
|
-
function
|
|
1701
|
-
var t = "",
|
|
1702
|
-
for (
|
|
1703
|
-
|
|
1704
|
-
e.tag =
|
|
1701
|
+
function Sn(e, n, r, i) {
|
|
1702
|
+
var t = "", o = e.tag, l, a, s;
|
|
1703
|
+
for (l = 0, a = r.length; l < a; l += 1)
|
|
1704
|
+
s = r[l], e.replacer && (s = e.replacer.call(r, String(l), s)), (W(e, n + 1, s, !0, !0, !1, !0) || typeof s > "u" && W(e, n + 1, null, !0, !0, !1, !0)) && ((!i || t !== "") && (t += Ue(e, n)), e.dump && pe === e.dump.charCodeAt(0) ? t += "-" : t += "- ", t += e.dump);
|
|
1705
|
+
e.tag = o, e.dump = t || "[]";
|
|
1705
1706
|
}
|
|
1706
|
-
function
|
|
1707
|
-
var i = "", t = e.tag,
|
|
1708
|
-
for (
|
|
1709
|
-
|
|
1707
|
+
function Xt(e, n, r) {
|
|
1708
|
+
var i = "", t = e.tag, o = Object.keys(r), l, a, s, c, u;
|
|
1709
|
+
for (l = 0, a = o.length; l < a; l += 1)
|
|
1710
|
+
u = "", i !== "" && (u += ", "), e.condenseFlow && (u += '"'), s = o[l], c = r[s], e.replacer && (c = e.replacer.call(r, s, c)), W(e, n, s, !1, !1) && (e.dump.length > 1024 && (u += "? "), u += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), W(e, n, c, !1, !1) && (u += e.dump, i += u));
|
|
1710
1711
|
e.tag = t, e.dump = "{" + i + "}";
|
|
1711
1712
|
}
|
|
1712
|
-
function
|
|
1713
|
-
var t = "",
|
|
1713
|
+
function Qt(e, n, r, i) {
|
|
1714
|
+
var t = "", o = e.tag, l = Object.keys(r), a, s, c, u, f, d;
|
|
1714
1715
|
if (e.sortKeys === !0)
|
|
1715
|
-
|
|
1716
|
+
l.sort();
|
|
1716
1717
|
else if (typeof e.sortKeys == "function")
|
|
1717
|
-
|
|
1718
|
+
l.sort(e.sortKeys);
|
|
1718
1719
|
else if (e.sortKeys)
|
|
1719
|
-
throw new
|
|
1720
|
-
for (a = 0,
|
|
1721
|
-
|
|
1722
|
-
e.tag =
|
|
1723
|
-
}
|
|
1724
|
-
function
|
|
1725
|
-
var i, t,
|
|
1726
|
-
for (t = r ? e.explicitTypes : e.implicitTypes,
|
|
1727
|
-
if (a = t[
|
|
1720
|
+
throw new M("sortKeys must be a boolean or a function");
|
|
1721
|
+
for (a = 0, s = l.length; a < s; a += 1)
|
|
1722
|
+
d = "", (!i || t !== "") && (d += Ue(e, n)), c = l[a], u = r[c], e.replacer && (u = e.replacer.call(r, c, u)), W(e, n + 1, c, !0, !0, !0) && (f = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, f && (e.dump && pe === e.dump.charCodeAt(0) ? d += "?" : d += "? "), d += e.dump, f && (d += Ue(e, n)), W(e, n + 1, u, !0, f) && (e.dump && pe === e.dump.charCodeAt(0) ? d += ":" : d += ": ", d += e.dump, t += d));
|
|
1723
|
+
e.tag = o, e.dump = t || "{}";
|
|
1724
|
+
}
|
|
1725
|
+
function En(e, n, r) {
|
|
1726
|
+
var i, t, o, l, a, s;
|
|
1727
|
+
for (t = r ? e.explicitTypes : e.implicitTypes, o = 0, l = t.length; o < l; o += 1)
|
|
1728
|
+
if (a = t[o], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof n == "object" && n instanceof a.instanceOf) && (!a.predicate || a.predicate(n))) {
|
|
1728
1729
|
if (r ? a.multi && a.representName ? e.tag = a.representName(n) : e.tag = a.tag : e.tag = "?", a.represent) {
|
|
1729
|
-
if (
|
|
1730
|
-
i = a.represent(n,
|
|
1731
|
-
else if (
|
|
1732
|
-
i = a.represent[
|
|
1730
|
+
if (s = e.styleMap[a.tag] || a.defaultStyle, gr.call(a.represent) === "[object Function]")
|
|
1731
|
+
i = a.represent(n, s);
|
|
1732
|
+
else if (mr.call(a.represent, s))
|
|
1733
|
+
i = a.represent[s](n, s);
|
|
1733
1734
|
else
|
|
1734
|
-
throw new
|
|
1735
|
+
throw new M("!<" + a.tag + '> tag resolver accepts not "' + s + '" style');
|
|
1735
1736
|
e.dump = i;
|
|
1736
1737
|
}
|
|
1737
1738
|
return !0;
|
|
1738
1739
|
}
|
|
1739
1740
|
return !1;
|
|
1740
1741
|
}
|
|
1741
|
-
function
|
|
1742
|
-
e.tag = null, e.dump = r,
|
|
1743
|
-
var a =
|
|
1742
|
+
function W(e, n, r, i, t, o, l) {
|
|
1743
|
+
e.tag = null, e.dump = r, En(e, r, !1) || En(e, r, !0);
|
|
1744
|
+
var a = gr.call(e.dump), s = i, c;
|
|
1744
1745
|
i && (i = e.flowLevel < 0 || e.flowLevel > n);
|
|
1745
|
-
var
|
|
1746
|
-
if (
|
|
1746
|
+
var u = a === "[object Object]" || a === "[object Array]", f, d;
|
|
1747
|
+
if (u && (f = e.duplicates.indexOf(r), d = f !== -1), (e.tag !== null && e.tag !== "?" || d || e.indent !== 2 && n > 0) && (t = !1), d && e.usedDuplicates[f])
|
|
1747
1748
|
e.dump = "*ref_" + f;
|
|
1748
1749
|
else {
|
|
1749
|
-
if (
|
|
1750
|
-
i && Object.keys(e.dump).length !== 0 ? (
|
|
1750
|
+
if (u && d && !e.usedDuplicates[f] && (e.usedDuplicates[f] = !0), a === "[object Object]")
|
|
1751
|
+
i && Object.keys(e.dump).length !== 0 ? (Qt(e, n, e.dump, t), d && (e.dump = "&ref_" + f + e.dump)) : (Xt(e, n, e.dump), d && (e.dump = "&ref_" + f + " " + e.dump));
|
|
1751
1752
|
else if (a === "[object Array]")
|
|
1752
|
-
i && e.dump.length !== 0 ? (e.noArrayIndent && !
|
|
1753
|
+
i && e.dump.length !== 0 ? (e.noArrayIndent && !l && n > 0 ? Sn(e, n - 1, e.dump, t) : Sn(e, n, e.dump, t), d && (e.dump = "&ref_" + f + e.dump)) : (Vt(e, n, e.dump), d && (e.dump = "&ref_" + f + " " + e.dump));
|
|
1753
1754
|
else if (a === "[object String]")
|
|
1754
|
-
e.tag !== "?" &&
|
|
1755
|
+
e.tag !== "?" && Wt(e, e.dump, n, o, s);
|
|
1755
1756
|
else {
|
|
1756
1757
|
if (a === "[object Undefined]")
|
|
1757
1758
|
return !1;
|
|
1758
1759
|
if (e.skipInvalid) return !1;
|
|
1759
|
-
throw new
|
|
1760
|
+
throw new M("unacceptable kind of an object to dump " + a);
|
|
1760
1761
|
}
|
|
1761
|
-
e.tag !== null && e.tag !== "?" && (
|
|
1762
|
+
e.tag !== null && e.tag !== "?" && (c = encodeURI(
|
|
1762
1763
|
e.tag[0] === "!" ? e.tag.slice(1) : e.tag
|
|
1763
|
-
).replace(/!/g, "%21"), e.tag[0] === "!" ?
|
|
1764
|
+
).replace(/!/g, "%21"), e.tag[0] === "!" ? c = "!" + c : c.slice(0, 18) === "tag:yaml.org,2002:" ? c = "!!" + c.slice(18) : c = "!<" + c + ">", e.dump = c + " " + e.dump);
|
|
1764
1765
|
}
|
|
1765
1766
|
return !0;
|
|
1766
1767
|
}
|
|
1767
|
-
function
|
|
1768
|
-
var r = [], i = [], t,
|
|
1769
|
-
for (He(e, r, i), t = 0,
|
|
1768
|
+
function Jt(e, n) {
|
|
1769
|
+
var r = [], i = [], t, o;
|
|
1770
|
+
for (He(e, r, i), t = 0, o = i.length; t < o; t += 1)
|
|
1770
1771
|
n.duplicates.push(r[i[t]]);
|
|
1771
|
-
n.usedDuplicates = new Array(
|
|
1772
|
+
n.usedDuplicates = new Array(o);
|
|
1772
1773
|
}
|
|
1773
1774
|
function He(e, n, r) {
|
|
1774
|
-
var i, t,
|
|
1775
|
+
var i, t, o;
|
|
1775
1776
|
if (e !== null && typeof e == "object")
|
|
1776
1777
|
if (t = n.indexOf(e), t !== -1)
|
|
1777
1778
|
r.indexOf(t) === -1 && r.push(t);
|
|
1778
1779
|
else if (n.push(e), Array.isArray(e))
|
|
1779
|
-
for (t = 0,
|
|
1780
|
+
for (t = 0, o = e.length; t < o; t += 1)
|
|
1780
1781
|
He(e[t], n, r);
|
|
1781
1782
|
else
|
|
1782
|
-
for (i = Object.keys(e), t = 0,
|
|
1783
|
+
for (i = Object.keys(e), t = 0, o = i.length; t < o; t += 1)
|
|
1783
1784
|
He(e[i[t]], n, r);
|
|
1784
1785
|
}
|
|
1785
|
-
function
|
|
1786
|
+
function Zt(e, n) {
|
|
1786
1787
|
n = n || {};
|
|
1787
|
-
var r = new
|
|
1788
|
-
r.noRefs ||
|
|
1788
|
+
var r = new zt(n);
|
|
1789
|
+
r.noRefs || Jt(e, r);
|
|
1789
1790
|
var i = e;
|
|
1790
|
-
return r.replacer && (i = r.replacer.call({ "": i }, "", i)),
|
|
1791
|
+
return r.replacer && (i = r.replacer.call({ "": i }, "", i)), W(r, 0, i, !0, !0) ? r.dump + `
|
|
1791
1792
|
` : "";
|
|
1792
1793
|
}
|
|
1793
|
-
var
|
|
1794
|
-
dump:
|
|
1794
|
+
var eo = Zt, no = {
|
|
1795
|
+
dump: eo
|
|
1795
1796
|
};
|
|
1796
|
-
function
|
|
1797
|
+
function Je(e, n) {
|
|
1797
1798
|
return function() {
|
|
1798
1799
|
throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + n + " instead, which is now safe by default.");
|
|
1799
1800
|
};
|
|
1800
1801
|
}
|
|
1801
|
-
var
|
|
1802
|
-
binary:
|
|
1803
|
-
float:
|
|
1802
|
+
var ro = j, io = Bn, to = Hn, oo = Vn, lo = Xn, ao = Ge, so = hr.load, co = hr.loadAll, uo = no.dump, fo = M, po = {
|
|
1803
|
+
binary: nr,
|
|
1804
|
+
float: Gn,
|
|
1804
1805
|
map: Yn,
|
|
1805
|
-
null:
|
|
1806
|
-
pairs:
|
|
1807
|
-
set:
|
|
1808
|
-
timestamp:
|
|
1809
|
-
bool:
|
|
1810
|
-
int:
|
|
1811
|
-
merge:
|
|
1812
|
-
omap:
|
|
1806
|
+
null: Kn,
|
|
1807
|
+
pairs: ir,
|
|
1808
|
+
set: tr,
|
|
1809
|
+
timestamp: Zn,
|
|
1810
|
+
bool: Wn,
|
|
1811
|
+
int: qn,
|
|
1812
|
+
merge: er,
|
|
1813
|
+
omap: rr,
|
|
1813
1814
|
seq: Un,
|
|
1814
|
-
str:
|
|
1815
|
-
},
|
|
1816
|
-
Type:
|
|
1817
|
-
Schema:
|
|
1818
|
-
FAILSAFE_SCHEMA:
|
|
1819
|
-
JSON_SCHEMA:
|
|
1820
|
-
CORE_SCHEMA:
|
|
1821
|
-
DEFAULT_SCHEMA:
|
|
1822
|
-
load:
|
|
1823
|
-
loadAll:
|
|
1824
|
-
dump:
|
|
1825
|
-
YAMLException:
|
|
1826
|
-
types:
|
|
1827
|
-
safeLoad:
|
|
1828
|
-
safeLoadAll:
|
|
1829
|
-
safeDump:
|
|
1815
|
+
str: zn
|
|
1816
|
+
}, ho = Je("safeLoad", "load"), go = Je("safeLoadAll", "loadAll"), mo = Je("safeDump", "dump"), _n = {
|
|
1817
|
+
Type: ro,
|
|
1818
|
+
Schema: io,
|
|
1819
|
+
FAILSAFE_SCHEMA: to,
|
|
1820
|
+
JSON_SCHEMA: oo,
|
|
1821
|
+
CORE_SCHEMA: lo,
|
|
1822
|
+
DEFAULT_SCHEMA: ao,
|
|
1823
|
+
load: so,
|
|
1824
|
+
loadAll: co,
|
|
1825
|
+
dump: uo,
|
|
1826
|
+
YAMLException: fo,
|
|
1827
|
+
types: po,
|
|
1828
|
+
safeLoad: ho,
|
|
1829
|
+
safeLoadAll: go,
|
|
1830
|
+
safeDump: mo
|
|
1830
1831
|
};
|
|
1831
|
-
const
|
|
1832
|
+
const be = (e) => e instanceof Error ? e.message : String(e), Ae = (e, n) => {
|
|
1832
1833
|
if (e && typeof e == "object" && !Array.isArray(e))
|
|
1833
1834
|
return e;
|
|
1834
1835
|
throw new Error(`Parsed --strings as ${n}, but it was not an object.`);
|
|
1835
|
-
},
|
|
1836
|
+
}, yo = (e, n) => {
|
|
1836
1837
|
const r = e.trim();
|
|
1837
1838
|
if (!r)
|
|
1838
1839
|
return {};
|
|
1839
1840
|
if (n === "json")
|
|
1840
1841
|
try {
|
|
1841
|
-
return
|
|
1842
|
+
return Ae(De.parse(r), "json");
|
|
1842
1843
|
} catch (t) {
|
|
1843
|
-
throw new Error(`Failed to parse --strings as JSON. Hint: check --strings-format=json. ${
|
|
1844
|
+
throw new Error(`Failed to parse --strings as JSON. Hint: check --strings-format=json. ${be(t)}`);
|
|
1844
1845
|
}
|
|
1845
1846
|
if (n === "yaml")
|
|
1846
1847
|
try {
|
|
1847
|
-
return
|
|
1848
|
+
return Ae(_n.load(r), "yaml");
|
|
1848
1849
|
} catch (t) {
|
|
1849
|
-
throw new Error(`Failed to parse --strings as YAML. Hint: check --strings-format=yaml. ${
|
|
1850
|
+
throw new Error(`Failed to parse --strings as YAML. Hint: check --strings-format=yaml. ${be(t)}`);
|
|
1850
1851
|
}
|
|
1851
1852
|
const i = [];
|
|
1852
1853
|
try {
|
|
1853
|
-
return
|
|
1854
|
+
return Ae(_n.load(r), "yaml");
|
|
1854
1855
|
} catch (t) {
|
|
1855
|
-
i.push(`yaml error: ${
|
|
1856
|
+
i.push(`yaml error: ${be(t)}`);
|
|
1856
1857
|
}
|
|
1857
1858
|
try {
|
|
1858
|
-
return
|
|
1859
|
+
return Ae(De.parse(r), "json");
|
|
1859
1860
|
} catch (t) {
|
|
1860
|
-
i.push(`json error: ${
|
|
1861
|
+
i.push(`json error: ${be(t)}`);
|
|
1861
1862
|
}
|
|
1862
1863
|
throw new Error(`Failed to parse --strings input. Provide valid YAML or JSON, or specify --strings-format. ${i.join(" | ")}`);
|
|
1863
1864
|
};
|
|
@@ -1871,48 +1872,147 @@ async function Er() {
|
|
|
1871
1872
|
}), process.stdin.readableEnded && e("");
|
|
1872
1873
|
});
|
|
1873
1874
|
}
|
|
1874
|
-
|
|
1875
|
-
if (e
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1875
|
+
const _r = (e) => {
|
|
1876
|
+
if (e === void 0) return "translated";
|
|
1877
|
+
if ($e.includes(e))
|
|
1878
|
+
return e;
|
|
1879
|
+
throw new Error(`Invalid state "${e}". Allowed values: ${$e.join(", ")}.`);
|
|
1880
|
+
}, Or = (e, n) => {
|
|
1881
|
+
if (typeof e == "string")
|
|
1882
|
+
return { value: e, state: void 0 };
|
|
1883
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
1884
|
+
const r = e;
|
|
1885
|
+
if (typeof r.value != "string")
|
|
1886
|
+
throw new Error(`${n} must include a string "value".`);
|
|
1887
|
+
let i;
|
|
1888
|
+
return r.state !== void 0 && (i = _r(String(r.state))), { value: r.value, state: i };
|
|
1889
|
+
}
|
|
1890
|
+
throw new Error(`${n} must be a string or an object with "value" (and optional "state").`);
|
|
1891
|
+
}, Ke = (e, n) => {
|
|
1892
|
+
if (e === void 0) return;
|
|
1893
|
+
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1894
|
+
throw new Error(`${n} must be an object of language -> text.`);
|
|
1895
|
+
const r = {};
|
|
1896
|
+
for (const [i, t] of Object.entries(e))
|
|
1897
|
+
r[i] = Or(t, `${n} for "${i}"`);
|
|
1898
|
+
return r;
|
|
1899
|
+
}, vo = (e, n) => {
|
|
1900
|
+
if (e == null)
|
|
1901
|
+
return {};
|
|
1902
|
+
if (typeof e == "string")
|
|
1903
|
+
return { comment: e };
|
|
1904
|
+
if (typeof e != "object" || Array.isArray(e))
|
|
1905
|
+
throw new Error(`Value for "${n}" must be an object.`);
|
|
1906
|
+
const r = e, i = {};
|
|
1907
|
+
typeof r.comment == "string" && (i.comment = r.comment);
|
|
1908
|
+
const t = Ke(r.translations, `translations for "${n}"`) || {}, o = {};
|
|
1909
|
+
for (const [a, s] of Object.entries(r))
|
|
1910
|
+
a === "comment" || a === "translations" || (o[a] = Or(s, `Translation for "${a}" in "${n}"`));
|
|
1911
|
+
const l = { ...t, ...o };
|
|
1912
|
+
return Object.keys(l).length > 0 && (i.translations = l), i;
|
|
1913
|
+
}, xo = (e) => {
|
|
1914
|
+
if (typeof e == "string") return !0;
|
|
1915
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
1916
|
+
const n = e;
|
|
1917
|
+
return typeof n.value == "string" && (n.state === void 0 || typeof n.state == "string");
|
|
1918
|
+
}
|
|
1919
|
+
return !1;
|
|
1920
|
+
}, wo = (e) => Object.values(e).every((n) => xo(n)), bo = (e) => {
|
|
1921
|
+
if (wo(e))
|
|
1922
|
+
return { kind: "single", translations: Ke(e, "translations") || {} };
|
|
1923
|
+
if (Object.keys(e).every((i) => i === "translations" || i === "comment") && "translations" in e) {
|
|
1924
|
+
const i = Ke(e.translations, "translations") || {}, t = typeof e.comment == "string" ? e.comment : void 0;
|
|
1925
|
+
return { kind: "single", translations: i, comment: t };
|
|
1926
|
+
}
|
|
1927
|
+
const r = {};
|
|
1928
|
+
for (const [i, t] of Object.entries(e))
|
|
1929
|
+
r[i] = vo(t, i);
|
|
1930
|
+
return { kind: "multi", entries: r };
|
|
1931
|
+
}, Ao = (e, n) => {
|
|
1932
|
+
if (!e) return n;
|
|
1933
|
+
if (e.kind !== n.kind)
|
|
1934
|
+
throw new Error("Cannot merge single and multi --strings payloads. Provide one consistent shape.");
|
|
1935
|
+
if (e.kind === "single" && n.kind === "single")
|
|
1936
|
+
return {
|
|
1937
|
+
kind: "single",
|
|
1938
|
+
translations: { ...e.translations, ...n.translations },
|
|
1939
|
+
comment: e.comment ?? n.comment
|
|
1940
|
+
};
|
|
1941
|
+
if (e.kind === "multi" && n.kind === "multi") {
|
|
1942
|
+
const r = { ...e.entries };
|
|
1943
|
+
for (const [i, t] of Object.entries(n.entries)) {
|
|
1944
|
+
const o = r[i] || {};
|
|
1945
|
+
r[i] = {
|
|
1946
|
+
comment: t.comment ?? o.comment,
|
|
1947
|
+
translations: { ...o.translations || {}, ...t.translations || {} }
|
|
1948
|
+
};
|
|
1891
1949
|
}
|
|
1950
|
+
return { kind: "multi", entries: r };
|
|
1951
|
+
}
|
|
1952
|
+
return e;
|
|
1953
|
+
};
|
|
1954
|
+
async function Co(e, n = Er, r = "auto") {
|
|
1955
|
+
if (e === void 0)
|
|
1956
|
+
return;
|
|
1957
|
+
const i = async (t) => {
|
|
1958
|
+
if (t.trim())
|
|
1959
|
+
return bo(yo(t, r));
|
|
1960
|
+
};
|
|
1961
|
+
if (e === "") {
|
|
1962
|
+
const t = await n();
|
|
1963
|
+
return i(t);
|
|
1964
|
+
}
|
|
1965
|
+
if (typeof e == "string")
|
|
1966
|
+
return i(e);
|
|
1967
|
+
if (Array.isArray(e)) {
|
|
1968
|
+
let t;
|
|
1969
|
+
for (const o of e)
|
|
1970
|
+
if (typeof o == "string") {
|
|
1971
|
+
const l = await i(o);
|
|
1972
|
+
l && (t = Ao(t, l));
|
|
1973
|
+
}
|
|
1974
|
+
return t;
|
|
1975
|
+
}
|
|
1976
|
+
if (typeof e == "boolean" && e === !0) {
|
|
1977
|
+
const t = await n();
|
|
1978
|
+
return i(t);
|
|
1892
1979
|
}
|
|
1893
1980
|
}
|
|
1894
|
-
async function
|
|
1981
|
+
async function ko({
|
|
1895
1982
|
path: e,
|
|
1896
1983
|
key: n,
|
|
1897
1984
|
comment: r,
|
|
1898
1985
|
stringsArg: i,
|
|
1899
1986
|
stringsFormat: t,
|
|
1900
|
-
defaultString:
|
|
1901
|
-
language:
|
|
1987
|
+
defaultString: o,
|
|
1988
|
+
language: l,
|
|
1902
1989
|
stdinReader: a = Er,
|
|
1903
|
-
configPath:
|
|
1990
|
+
configPath: s,
|
|
1991
|
+
state: c
|
|
1904
1992
|
}) {
|
|
1905
|
-
const u = await
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1993
|
+
const u = await Co(i, a, t), f = _r(c);
|
|
1994
|
+
if (u?.kind === "multi") {
|
|
1995
|
+
if (n || r || o !== void 0 || l)
|
|
1996
|
+
throw new Error("When adding multiple strings via --strings payload, omit --key, --comment, --text, and --language.");
|
|
1997
|
+
const h = [];
|
|
1998
|
+
for (const [A, C] of Object.entries(u.entries))
|
|
1999
|
+
await On(e, A, C.comment, C.translations, s, void 0, void 0, f), h.push(A);
|
|
2000
|
+
return { kind: "multi", keys: h };
|
|
2001
|
+
}
|
|
2002
|
+
const d = n;
|
|
2003
|
+
if (!d)
|
|
2004
|
+
throw new Error("--key is required unless the --strings payload contains multiple keys.");
|
|
2005
|
+
const g = u?.kind === "single" ? u.translations : void 0, v = u?.kind === "single" ? u.comment : void 0;
|
|
2006
|
+
return await On(e, d, r ?? v, g, s, o, l, f), { kind: "single", keys: [d] };
|
|
2007
|
+
}
|
|
2008
|
+
function So() {
|
|
1909
2009
|
return {
|
|
1910
2010
|
command: "add",
|
|
1911
2011
|
describe: "Add a string",
|
|
1912
2012
|
builder: (e) => e.option("key", {
|
|
1913
2013
|
type: "string",
|
|
1914
|
-
describe: "The key of the string",
|
|
1915
|
-
demandOption: !
|
|
2014
|
+
describe: "The key of the string (omit when adding multiple keys via --strings)",
|
|
2015
|
+
demandOption: !1
|
|
1916
2016
|
}).option("comment", {
|
|
1917
2017
|
type: "string",
|
|
1918
2018
|
describe: "The comment for the string"
|
|
@@ -1920,6 +2020,10 @@ function go() {
|
|
|
1920
2020
|
type: "string",
|
|
1921
2021
|
alias: "l",
|
|
1922
2022
|
describe: "The language of the string provided with --text"
|
|
2023
|
+
}).option("state", {
|
|
2024
|
+
type: "string",
|
|
2025
|
+
choices: $e,
|
|
2026
|
+
describe: "State to apply to added strings (translated | needs_review | new | stale)"
|
|
1923
2027
|
}).option("text", {
|
|
1924
2028
|
type: "string",
|
|
1925
2029
|
describe: "The string value for the default language"
|
|
@@ -1933,7 +2037,7 @@ function go() {
|
|
|
1933
2037
|
describe: "Format for the data provided with --strings"
|
|
1934
2038
|
}),
|
|
1935
2039
|
handler: async (e) => {
|
|
1936
|
-
await
|
|
2040
|
+
const n = await ko({
|
|
1937
2041
|
path: e.path,
|
|
1938
2042
|
key: e.key,
|
|
1939
2043
|
comment: e.comment,
|
|
@@ -1941,57 +2045,76 @@ function go() {
|
|
|
1941
2045
|
stringsFormat: e["strings-format"],
|
|
1942
2046
|
defaultString: e.text,
|
|
1943
2047
|
language: e.language,
|
|
2048
|
+
state: e.state,
|
|
1944
2049
|
stdinReader: void 0,
|
|
1945
2050
|
configPath: e.config
|
|
1946
|
-
})
|
|
2051
|
+
});
|
|
2052
|
+
X.info(k.green(`✓ Added keys:
|
|
2053
|
+
${n.keys.map((r) => `- ${r}`).join(`
|
|
2054
|
+
`)}`));
|
|
1947
2055
|
}
|
|
1948
2056
|
};
|
|
1949
2057
|
}
|
|
1950
|
-
async function
|
|
1951
|
-
const
|
|
1952
|
-
if (!
|
|
2058
|
+
async function On(e, n, r, i, t, o, l, a) {
|
|
2059
|
+
const s = await me(e);
|
|
2060
|
+
if (!s.sourceLanguage)
|
|
1953
2061
|
throw new Error('The xcstrings file is missing "sourceLanguage".');
|
|
1954
|
-
const c =
|
|
1955
|
-
|
|
1956
|
-
const
|
|
1957
|
-
let
|
|
1958
|
-
const g = async (
|
|
1959
|
-
|
|
2062
|
+
const c = s.sourceLanguage;
|
|
2063
|
+
s.strings || (s.strings = {});
|
|
2064
|
+
const f = (await We(t))?.missingLanguagePolicy || "skip";
|
|
2065
|
+
let d;
|
|
2066
|
+
const g = async (_) => f === "include" ? !0 : (d || (d = await Mn(e, t)), d.includes(_)), v = (_) => {
|
|
2067
|
+
X.warn(`Language "${_}" is not supported. Skipped adding its translation (missingLanguagePolicy=skip).`);
|
|
2068
|
+
}, h = {
|
|
2069
|
+
...s.strings[n],
|
|
1960
2070
|
extractionState: "manual"
|
|
1961
2071
|
};
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
if (
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
2072
|
+
r && (h.comment = r);
|
|
2073
|
+
const A = a ?? "translated", C = (_) => {
|
|
2074
|
+
if (_ !== void 0)
|
|
2075
|
+
return typeof _ == "string" ? { value: _ } : _;
|
|
2076
|
+
};
|
|
2077
|
+
if (o !== void 0) {
|
|
2078
|
+
const _ = l ?? c;
|
|
2079
|
+
if (!await g(_))
|
|
2080
|
+
v(_);
|
|
2081
|
+
else {
|
|
2082
|
+
h.localizations = h.localizations || {};
|
|
2083
|
+
const L = C(i?.[_]);
|
|
2084
|
+
h.localizations[_] = {
|
|
2085
|
+
stringUnit: {
|
|
2086
|
+
state: L?.state ?? A,
|
|
2087
|
+
value: o
|
|
2088
|
+
}
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
1972
2091
|
}
|
|
1973
2092
|
const x = i ? { ...i } : void 0;
|
|
1974
2093
|
if (x) {
|
|
1975
|
-
const
|
|
1976
|
-
for (const [
|
|
1977
|
-
if (
|
|
2094
|
+
const _ = [];
|
|
2095
|
+
for (const [L, R] of Object.entries(x)) {
|
|
2096
|
+
if (o !== void 0 && L === (l ?? c))
|
|
1978
2097
|
continue;
|
|
1979
|
-
(
|
|
2098
|
+
if (f === "include" ? !0 : L === c || await g(L)) {
|
|
2099
|
+
const I = C(R);
|
|
2100
|
+
I && _.push([L, I]);
|
|
2101
|
+
} else
|
|
2102
|
+
v(L);
|
|
1980
2103
|
}
|
|
1981
|
-
if (
|
|
2104
|
+
if (_.length > 0) {
|
|
1982
2105
|
h.localizations = h.localizations || {};
|
|
1983
|
-
for (const [
|
|
1984
|
-
h.localizations[
|
|
2106
|
+
for (const [L, R] of _)
|
|
2107
|
+
h.localizations[L] = {
|
|
1985
2108
|
stringUnit: {
|
|
1986
|
-
state:
|
|
1987
|
-
value:
|
|
2109
|
+
state: R.state ?? A,
|
|
2110
|
+
value: R.value
|
|
1988
2111
|
}
|
|
1989
2112
|
};
|
|
1990
2113
|
}
|
|
1991
2114
|
}
|
|
1992
|
-
|
|
2115
|
+
s.strings[n] = h, await Pn(e, s);
|
|
1993
2116
|
}
|
|
1994
|
-
function
|
|
2117
|
+
function Eo() {
|
|
1995
2118
|
return {
|
|
1996
2119
|
command: "remove",
|
|
1997
2120
|
describe: "Remove a string",
|
|
@@ -2015,7 +2138,7 @@ function yo() {
|
|
|
2015
2138
|
throw new Error("Either --key or --languages must be provided");
|
|
2016
2139
|
}),
|
|
2017
2140
|
handler: async (e) => {
|
|
2018
|
-
const n = await
|
|
2141
|
+
const n = await Oo(
|
|
2019
2142
|
e.path,
|
|
2020
2143
|
e.key,
|
|
2021
2144
|
e.languages,
|
|
@@ -2023,126 +2146,126 @@ function yo() {
|
|
|
2023
2146
|
), r = Object.entries(n).map(([i, t]) => `- [${t.join(" ")}] ${i}`).join(`
|
|
2024
2147
|
`);
|
|
2025
2148
|
if (e.dryRun) {
|
|
2026
|
-
r.length === 0 ?
|
|
2149
|
+
r.length === 0 ? X.info(k.yellow("No matching strings found.")) : X.info(k.blue(`Would remove:
|
|
2027
2150
|
${r}`));
|
|
2028
2151
|
return;
|
|
2029
2152
|
}
|
|
2030
|
-
r.length === 0 ?
|
|
2153
|
+
r.length === 0 ? X.info(k.yellow("No matching strings found.")) : X.info(k.green(`✓ Removed
|
|
2031
2154
|
${r}`));
|
|
2032
2155
|
}
|
|
2033
2156
|
};
|
|
2034
2157
|
}
|
|
2035
|
-
function
|
|
2158
|
+
function _o(e, n, r, i, t) {
|
|
2036
2159
|
if (e.localizations) {
|
|
2037
|
-
for (const
|
|
2038
|
-
e.localizations[
|
|
2160
|
+
for (const o of n)
|
|
2161
|
+
e.localizations[o] && (t[i] ??= [], t[i].push(o), r || delete e.localizations[o]);
|
|
2039
2162
|
!r && e.localizations && Object.keys(e.localizations).length === 0 && delete e.localizations;
|
|
2040
2163
|
}
|
|
2041
2164
|
}
|
|
2042
|
-
async function
|
|
2043
|
-
const t = await me(e),
|
|
2044
|
-
t.strings =
|
|
2045
|
-
const a = n ? [n] : Object.keys(
|
|
2046
|
-
let
|
|
2047
|
-
for (const
|
|
2048
|
-
const
|
|
2049
|
-
if (!
|
|
2165
|
+
async function Oo(e, n, r, i = !1) {
|
|
2166
|
+
const t = await me(e), o = {}, l = t.strings || {};
|
|
2167
|
+
t.strings = l;
|
|
2168
|
+
const a = n ? [n] : Object.keys(l);
|
|
2169
|
+
let s = !1;
|
|
2170
|
+
for (const c of a) {
|
|
2171
|
+
const u = l[c];
|
|
2172
|
+
if (!u)
|
|
2050
2173
|
continue;
|
|
2051
2174
|
if (!r || r.length === 0) {
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2175
|
+
const g = Object.keys(u.localizations ?? {});
|
|
2176
|
+
o[c] = g, i || delete l[c], s = !0;
|
|
2054
2177
|
continue;
|
|
2055
2178
|
}
|
|
2056
|
-
|
|
2057
|
-
const f =
|
|
2058
|
-
!(
|
|
2179
|
+
_o(u, r, i, c, o);
|
|
2180
|
+
const f = o[c]?.length ?? 0;
|
|
2181
|
+
!(u.localizations && Object.keys(u.localizations).length > 0) && f > 0 && (i || delete l[c]), f > 0 && (s = !0);
|
|
2059
2182
|
}
|
|
2060
|
-
return !i &&
|
|
2183
|
+
return !i && s && await Pn(e, t), o;
|
|
2061
2184
|
}
|
|
2062
2185
|
const Pe = "xcstrings-cli.json5";
|
|
2063
|
-
function
|
|
2186
|
+
function Fo() {
|
|
2064
2187
|
return {
|
|
2065
2188
|
command: "init",
|
|
2066
2189
|
describe: "Initialize configuration file",
|
|
2067
2190
|
handler: async () => {
|
|
2068
|
-
await
|
|
2191
|
+
await jo();
|
|
2069
2192
|
}
|
|
2070
2193
|
};
|
|
2071
2194
|
}
|
|
2072
|
-
async function
|
|
2195
|
+
async function To(e) {
|
|
2073
2196
|
const n = [];
|
|
2074
2197
|
async function r(i) {
|
|
2075
2198
|
try {
|
|
2076
|
-
const t = await
|
|
2077
|
-
for (const
|
|
2078
|
-
const
|
|
2079
|
-
|
|
2199
|
+
const t = await Rn(i, { withFileTypes: !0 });
|
|
2200
|
+
for (const o of t) {
|
|
2201
|
+
const l = Oe(i, o.name);
|
|
2202
|
+
o.isDirectory() ? !o.name.startsWith(".") && o.name !== "node_modules" && await r(l) : o.name.endsWith(".xcstrings") && n.push(l);
|
|
2080
2203
|
}
|
|
2081
2204
|
} catch {
|
|
2082
2205
|
}
|
|
2083
2206
|
}
|
|
2084
2207
|
return await r(e), n;
|
|
2085
2208
|
}
|
|
2086
|
-
async function
|
|
2209
|
+
async function Lo(e) {
|
|
2087
2210
|
const n = [];
|
|
2088
2211
|
let r = e;
|
|
2089
2212
|
try {
|
|
2090
|
-
const i = await
|
|
2213
|
+
const i = await Rn(r, { withFileTypes: !0 });
|
|
2091
2214
|
for (const t of i)
|
|
2092
|
-
t.isDirectory() && t.name.endsWith(".xcodeproj") && n.push(
|
|
2215
|
+
t.isDirectory() && t.name.endsWith(".xcodeproj") && n.push(Oe(r, t.name));
|
|
2093
2216
|
} catch {
|
|
2094
2217
|
}
|
|
2095
2218
|
return n;
|
|
2096
2219
|
}
|
|
2097
|
-
async function
|
|
2220
|
+
async function jo() {
|
|
2098
2221
|
const e = process.cwd();
|
|
2099
|
-
console.log(), console.log(
|
|
2100
|
-
const n = await
|
|
2101
|
-
console.log(
|
|
2102
|
-
const r = await
|
|
2222
|
+
console.log(), console.log(k.bold.cyan("🚀 xcstrings-cli Configuration Setup")), console.log(k.dim("─".repeat(40))), console.log(), console.log(k.yellow("🔍 Searching for .xcstrings files..."));
|
|
2223
|
+
const n = await To(e);
|
|
2224
|
+
console.log(k.yellow("🔍 Searching for .xcodeproj directories..."));
|
|
2225
|
+
const r = await Lo(e);
|
|
2103
2226
|
console.log();
|
|
2104
2227
|
let i = [];
|
|
2105
2228
|
if (n.length > 0) {
|
|
2106
|
-
console.log(
|
|
2107
|
-
const
|
|
2108
|
-
name:
|
|
2109
|
-
value:
|
|
2229
|
+
console.log(k.green(`✓ Found ${n.length} .xcstrings file(s)`)), console.log();
|
|
2230
|
+
const c = n.map((u) => ({
|
|
2231
|
+
name: k.white(we(e, u)) + k.dim(` (${u})`),
|
|
2232
|
+
value: we(e, u),
|
|
2110
2233
|
checked: !0
|
|
2111
2234
|
}));
|
|
2112
|
-
i = await
|
|
2113
|
-
message:
|
|
2114
|
-
choices:
|
|
2235
|
+
i = await an({
|
|
2236
|
+
message: k.bold("Select .xcstrings files to manage:"),
|
|
2237
|
+
choices: c
|
|
2115
2238
|
});
|
|
2116
2239
|
} else
|
|
2117
|
-
console.log(
|
|
2240
|
+
console.log(k.dim(" No .xcstrings files found in current directory"));
|
|
2118
2241
|
console.log();
|
|
2119
2242
|
let t = [];
|
|
2120
2243
|
if (r.length > 0) {
|
|
2121
|
-
console.log(
|
|
2122
|
-
const
|
|
2123
|
-
name:
|
|
2124
|
-
value:
|
|
2244
|
+
console.log(k.green(`✓ Found ${r.length} .xcodeproj director${r.length === 1 ? "y" : "ies"}`)), console.log();
|
|
2245
|
+
const c = r.map((u) => ({
|
|
2246
|
+
name: k.white(we(e, u) || u) + k.dim(` (${u})`),
|
|
2247
|
+
value: we(e, u) || u,
|
|
2125
2248
|
checked: !0
|
|
2126
2249
|
}));
|
|
2127
|
-
t = await
|
|
2128
|
-
message:
|
|
2129
|
-
choices:
|
|
2250
|
+
t = await an({
|
|
2251
|
+
message: k.bold("Select .xcodeproj directories for language detection:"),
|
|
2252
|
+
choices: c
|
|
2130
2253
|
});
|
|
2131
2254
|
} else
|
|
2132
|
-
console.log(
|
|
2133
|
-
if (console.log(), console.log(
|
|
2134
|
-
message:
|
|
2255
|
+
console.log(k.dim(" No .xcodeproj directories found"));
|
|
2256
|
+
if (console.log(), console.log(k.dim("─".repeat(40))), console.log(), console.log(k.bold("📋 Configuration Summary:")), console.log(), console.log(k.cyan(" xcstringsPaths:")), i.length > 0 ? i.forEach((c) => console.log(k.white(` • ${c}`))) : console.log(k.dim(" (none)")), console.log(), console.log(k.cyan(" xcodeprojPaths:")), t.length > 0 ? t.forEach((c) => console.log(k.white(` • ${c}`))) : console.log(k.dim(" (none)")), console.log(), !await Dr({
|
|
2257
|
+
message: k.bold(`Create ${k.yellow(Pe)}?`),
|
|
2135
2258
|
default: !0
|
|
2136
2259
|
})) {
|
|
2137
|
-
console.log(
|
|
2260
|
+
console.log(k.dim(" Configuration cancelled."));
|
|
2138
2261
|
return;
|
|
2139
2262
|
}
|
|
2140
|
-
const
|
|
2141
|
-
`), a = t.map((
|
|
2142
|
-
`),
|
|
2263
|
+
const l = i.map((c) => ` "${c}"`).join(`,
|
|
2264
|
+
`), a = t.map((c) => ` "${c}"`).join(`,
|
|
2265
|
+
`), s = `{
|
|
2143
2266
|
// Paths to .xcstrings files to manage. Specify relative or absolute paths.
|
|
2144
2267
|
xcstringsPaths: [
|
|
2145
|
-
${
|
|
2268
|
+
${l}
|
|
2146
2269
|
],
|
|
2147
2270
|
// Paths to .xcodeproj directories. Used for discovering supported languages.
|
|
2148
2271
|
xcodeprojPaths: [
|
|
@@ -2152,35 +2275,35 @@ ${a}
|
|
|
2152
2275
|
missingLanguagePolicy: "skip",
|
|
2153
2276
|
}
|
|
2154
2277
|
`;
|
|
2155
|
-
await
|
|
2278
|
+
await Nn(Pe, s, "utf-8"), console.log(), console.log(k.bold.green(`✓ Created ${Pe}`)), console.log(k.dim(` Run ${k.cyan("xcstrings --help")} to see available commands.`)), console.log();
|
|
2156
2279
|
}
|
|
2157
|
-
var
|
|
2158
|
-
return
|
|
2280
|
+
var Io = Object.prototype.toString, ae = Array.isArray || function(n) {
|
|
2281
|
+
return Io.call(n) === "[object Array]";
|
|
2159
2282
|
};
|
|
2160
|
-
function
|
|
2283
|
+
function Ze(e) {
|
|
2161
2284
|
return typeof e == "function";
|
|
2162
2285
|
}
|
|
2163
|
-
function
|
|
2164
|
-
return
|
|
2286
|
+
function No(e) {
|
|
2287
|
+
return ae(e) ? "array" : typeof e;
|
|
2165
2288
|
}
|
|
2166
|
-
function
|
|
2289
|
+
function Me(e) {
|
|
2167
2290
|
return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
2168
2291
|
}
|
|
2169
|
-
function
|
|
2292
|
+
function Fn(e, n) {
|
|
2170
2293
|
return e != null && typeof e == "object" && n in e;
|
|
2171
2294
|
}
|
|
2172
|
-
function
|
|
2295
|
+
function Ro(e, n) {
|
|
2173
2296
|
return e != null && typeof e != "object" && e.hasOwnProperty && e.hasOwnProperty(n);
|
|
2174
2297
|
}
|
|
2175
|
-
var
|
|
2176
|
-
function
|
|
2177
|
-
return
|
|
2298
|
+
var Po = RegExp.prototype.test;
|
|
2299
|
+
function Mo(e, n) {
|
|
2300
|
+
return Po.call(e, n);
|
|
2178
2301
|
}
|
|
2179
|
-
var
|
|
2180
|
-
function
|
|
2181
|
-
return !
|
|
2302
|
+
var Do = /\S/;
|
|
2303
|
+
function $o(e) {
|
|
2304
|
+
return !Mo(Do, e);
|
|
2182
2305
|
}
|
|
2183
|
-
var
|
|
2306
|
+
var Bo = {
|
|
2184
2307
|
"&": "&",
|
|
2185
2308
|
"<": "<",
|
|
2186
2309
|
">": ">",
|
|
@@ -2190,67 +2313,67 @@ var Lo = {
|
|
|
2190
2313
|
"`": "`",
|
|
2191
2314
|
"=": "="
|
|
2192
2315
|
};
|
|
2193
|
-
function
|
|
2316
|
+
function zo(e) {
|
|
2194
2317
|
return String(e).replace(/[&<>"'`=\/]/g, function(r) {
|
|
2195
|
-
return
|
|
2318
|
+
return Bo[r];
|
|
2196
2319
|
});
|
|
2197
2320
|
}
|
|
2198
|
-
var
|
|
2199
|
-
function
|
|
2321
|
+
var Uo = /\s*/, Yo = /\s+/, Tn = /\s*=/, Ho = /\s*\}/, Ko = /#|\^|\/|>|\{|&|=|!/;
|
|
2322
|
+
function Wo(e, n) {
|
|
2200
2323
|
if (!e)
|
|
2201
2324
|
return [];
|
|
2202
|
-
var r = !1, i = [], t = [],
|
|
2203
|
-
function
|
|
2204
|
-
if (
|
|
2205
|
-
for (;
|
|
2206
|
-
delete t[
|
|
2325
|
+
var r = !1, i = [], t = [], o = [], l = !1, a = !1, s = "", c = 0;
|
|
2326
|
+
function u() {
|
|
2327
|
+
if (l && !a)
|
|
2328
|
+
for (; o.length; )
|
|
2329
|
+
delete t[o.pop()];
|
|
2207
2330
|
else
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
}
|
|
2211
|
-
var f,
|
|
2212
|
-
function
|
|
2213
|
-
if (typeof
|
|
2214
|
-
throw new Error("Invalid tags: " +
|
|
2215
|
-
f = new RegExp(
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
for (var
|
|
2219
|
-
if (A =
|
|
2220
|
-
for (var
|
|
2221
|
-
|
|
2222
|
-
` && (
|
|
2223
|
-
if (!
|
|
2331
|
+
o = [];
|
|
2332
|
+
l = !1, a = !1;
|
|
2333
|
+
}
|
|
2334
|
+
var f, d, g;
|
|
2335
|
+
function v(I) {
|
|
2336
|
+
if (typeof I == "string" && (I = I.split(Yo, 2)), !ae(I) || I.length !== 2)
|
|
2337
|
+
throw new Error("Invalid tags: " + I);
|
|
2338
|
+
f = new RegExp(Me(I[0]) + "\\s*"), d = new RegExp("\\s*" + Me(I[1])), g = new RegExp("\\s*" + Me("}" + I[1]));
|
|
2339
|
+
}
|
|
2340
|
+
v(n || D.tags);
|
|
2341
|
+
for (var h = new ye(e), A, C, x, _, L, R; !h.eos(); ) {
|
|
2342
|
+
if (A = h.pos, x = h.scanUntil(f), x)
|
|
2343
|
+
for (var J = 0, V = x.length; J < V; ++J)
|
|
2344
|
+
_ = x.charAt(J), $o(_) ? (o.push(t.length), s += _) : (a = !0, r = !0, s += " "), t.push(["text", _, A, A + 1]), A += 1, _ === `
|
|
2345
|
+
` && (u(), s = "", c = 0, r = !1);
|
|
2346
|
+
if (!h.scan(f))
|
|
2224
2347
|
break;
|
|
2225
|
-
if (
|
|
2226
|
-
throw new Error("Unclosed tag at " +
|
|
2227
|
-
if (
|
|
2228
|
-
i.push(
|
|
2229
|
-
else if (
|
|
2230
|
-
if (
|
|
2231
|
-
throw new Error('Unopened section "' +
|
|
2232
|
-
if (
|
|
2233
|
-
throw new Error('Unclosed section "' +
|
|
2234
|
-
} else
|
|
2235
|
-
}
|
|
2236
|
-
if (
|
|
2237
|
-
throw new Error('Unclosed section "' +
|
|
2238
|
-
return
|
|
2239
|
-
}
|
|
2240
|
-
function
|
|
2241
|
-
for (var n = [], r, i, t = 0,
|
|
2348
|
+
if (l = !0, C = h.scan(Ko) || "name", h.scan(Uo), C === "=" ? (x = h.scanUntil(Tn), h.scan(Tn), h.scanUntil(d)) : C === "{" ? (x = h.scanUntil(g), h.scan(Ho), h.scanUntil(d), C = "&") : x = h.scanUntil(d), !h.scan(d))
|
|
2349
|
+
throw new Error("Unclosed tag at " + h.pos);
|
|
2350
|
+
if (C == ">" ? L = [C, x, A, h.pos, s, c, r] : L = [C, x, A, h.pos], c++, t.push(L), C === "#" || C === "^")
|
|
2351
|
+
i.push(L);
|
|
2352
|
+
else if (C === "/") {
|
|
2353
|
+
if (R = i.pop(), !R)
|
|
2354
|
+
throw new Error('Unopened section "' + x + '" at ' + A);
|
|
2355
|
+
if (R[1] !== x)
|
|
2356
|
+
throw new Error('Unclosed section "' + R[1] + '" at ' + A);
|
|
2357
|
+
} else C === "name" || C === "{" || C === "&" ? a = !0 : C === "=" && v(x);
|
|
2358
|
+
}
|
|
2359
|
+
if (u(), R = i.pop(), R)
|
|
2360
|
+
throw new Error('Unclosed section "' + R[1] + '" at ' + h.pos);
|
|
2361
|
+
return Go(qo(t));
|
|
2362
|
+
}
|
|
2363
|
+
function qo(e) {
|
|
2364
|
+
for (var n = [], r, i, t = 0, o = e.length; t < o; ++t)
|
|
2242
2365
|
r = e[t], r && (r[0] === "text" && i && i[0] === "text" ? (i[1] += r[1], i[3] = r[3]) : (n.push(r), i = r));
|
|
2243
2366
|
return n;
|
|
2244
2367
|
}
|
|
2245
|
-
function
|
|
2246
|
-
for (var n = [], r = n, i = [], t,
|
|
2247
|
-
switch (t = e[
|
|
2368
|
+
function Go(e) {
|
|
2369
|
+
for (var n = [], r = n, i = [], t, o, l = 0, a = e.length; l < a; ++l)
|
|
2370
|
+
switch (t = e[l], t[0]) {
|
|
2248
2371
|
case "#":
|
|
2249
2372
|
case "^":
|
|
2250
2373
|
r.push(t), i.push(t), r = t[4] = [];
|
|
2251
2374
|
break;
|
|
2252
2375
|
case "/":
|
|
2253
|
-
|
|
2376
|
+
o = i.pop(), o[5] = t[2], r = i.length > 0 ? i[i.length - 1][4] : n;
|
|
2254
2377
|
break;
|
|
2255
2378
|
default:
|
|
2256
2379
|
r.push(t);
|
|
@@ -2284,34 +2407,34 @@ ye.prototype.scanUntil = function(n) {
|
|
|
2284
2407
|
}
|
|
2285
2408
|
return this.pos += i.length, i;
|
|
2286
2409
|
};
|
|
2287
|
-
function
|
|
2410
|
+
function le(e, n) {
|
|
2288
2411
|
this.view = e, this.cache = { ".": this.view }, this.parent = n;
|
|
2289
2412
|
}
|
|
2290
|
-
|
|
2291
|
-
return new
|
|
2413
|
+
le.prototype.push = function(n) {
|
|
2414
|
+
return new le(n, this);
|
|
2292
2415
|
};
|
|
2293
|
-
|
|
2416
|
+
le.prototype.lookup = function(n) {
|
|
2294
2417
|
var r = this.cache, i;
|
|
2295
2418
|
if (r.hasOwnProperty(n))
|
|
2296
2419
|
i = r[n];
|
|
2297
2420
|
else {
|
|
2298
|
-
for (var t = this,
|
|
2421
|
+
for (var t = this, o, l, a, s = !1; t; ) {
|
|
2299
2422
|
if (n.indexOf(".") > 0)
|
|
2300
|
-
for (
|
|
2301
|
-
a ===
|
|
2423
|
+
for (o = t.view, l = n.split("."), a = 0; o != null && a < l.length; )
|
|
2424
|
+
a === l.length - 1 && (s = Fn(o, l[a]) || Ro(o, l[a])), o = o[l[a++]];
|
|
2302
2425
|
else
|
|
2303
|
-
|
|
2304
|
-
if (
|
|
2305
|
-
i =
|
|
2426
|
+
o = t.view[n], s = Fn(t.view, n);
|
|
2427
|
+
if (s) {
|
|
2428
|
+
i = o;
|
|
2306
2429
|
break;
|
|
2307
2430
|
}
|
|
2308
2431
|
t = t.parent;
|
|
2309
2432
|
}
|
|
2310
2433
|
r[n] = i;
|
|
2311
2434
|
}
|
|
2312
|
-
return
|
|
2435
|
+
return Ze(i) && (i = i.call(this.view)), i;
|
|
2313
2436
|
};
|
|
2314
|
-
function
|
|
2437
|
+
function $() {
|
|
2315
2438
|
this.templateCache = {
|
|
2316
2439
|
_cache: {},
|
|
2317
2440
|
set: function(n, r) {
|
|
@@ -2325,86 +2448,86 @@ function R() {
|
|
|
2325
2448
|
}
|
|
2326
2449
|
};
|
|
2327
2450
|
}
|
|
2328
|
-
|
|
2451
|
+
$.prototype.clearCache = function() {
|
|
2329
2452
|
typeof this.templateCache < "u" && this.templateCache.clear();
|
|
2330
2453
|
};
|
|
2331
|
-
|
|
2332
|
-
var i = this.templateCache, t = n + ":" + (r ||
|
|
2333
|
-
return
|
|
2454
|
+
$.prototype.parse = function(n, r) {
|
|
2455
|
+
var i = this.templateCache, t = n + ":" + (r || D.tags).join(":"), o = typeof i < "u", l = o ? i.get(t) : void 0;
|
|
2456
|
+
return l == null && (l = Wo(n, r), o && i.set(t, l)), l;
|
|
2334
2457
|
};
|
|
2335
|
-
|
|
2336
|
-
var
|
|
2337
|
-
return this.renderTokens(
|
|
2458
|
+
$.prototype.render = function(n, r, i, t) {
|
|
2459
|
+
var o = this.getConfigTags(t), l = this.parse(n, o), a = r instanceof le ? r : new le(r, void 0);
|
|
2460
|
+
return this.renderTokens(l, a, i, n, t);
|
|
2338
2461
|
};
|
|
2339
|
-
|
|
2340
|
-
for (var
|
|
2341
|
-
|
|
2342
|
-
return
|
|
2462
|
+
$.prototype.renderTokens = function(n, r, i, t, o) {
|
|
2463
|
+
for (var l = "", a, s, c, u = 0, f = n.length; u < f; ++u)
|
|
2464
|
+
c = void 0, a = n[u], s = a[0], s === "#" ? c = this.renderSection(a, r, i, t, o) : s === "^" ? c = this.renderInverted(a, r, i, t, o) : s === ">" ? c = this.renderPartial(a, r, i, o) : s === "&" ? c = this.unescapedValue(a, r) : s === "name" ? c = this.escapedValue(a, r, o) : s === "text" && (c = this.rawValue(a)), c !== void 0 && (l += c);
|
|
2465
|
+
return l;
|
|
2343
2466
|
};
|
|
2344
|
-
|
|
2345
|
-
var
|
|
2346
|
-
function
|
|
2347
|
-
return
|
|
2348
|
-
}
|
|
2349
|
-
if (
|
|
2350
|
-
if (
|
|
2351
|
-
for (var
|
|
2352
|
-
a += this.renderTokens(n[4], r.push(
|
|
2353
|
-
else if (typeof
|
|
2354
|
-
a += this.renderTokens(n[4], r.push(
|
|
2355
|
-
else if (
|
|
2467
|
+
$.prototype.renderSection = function(n, r, i, t, o) {
|
|
2468
|
+
var l = this, a = "", s = r.lookup(n[1]);
|
|
2469
|
+
function c(d) {
|
|
2470
|
+
return l.render(d, r, i, o);
|
|
2471
|
+
}
|
|
2472
|
+
if (s) {
|
|
2473
|
+
if (ae(s))
|
|
2474
|
+
for (var u = 0, f = s.length; u < f; ++u)
|
|
2475
|
+
a += this.renderTokens(n[4], r.push(s[u]), i, t, o);
|
|
2476
|
+
else if (typeof s == "object" || typeof s == "string" || typeof s == "number")
|
|
2477
|
+
a += this.renderTokens(n[4], r.push(s), i, t, o);
|
|
2478
|
+
else if (Ze(s)) {
|
|
2356
2479
|
if (typeof t != "string")
|
|
2357
2480
|
throw new Error("Cannot use higher-order sections without the original template");
|
|
2358
|
-
|
|
2481
|
+
s = s.call(r.view, t.slice(n[3], n[5]), c), s != null && (a += s);
|
|
2359
2482
|
} else
|
|
2360
|
-
a += this.renderTokens(n[4], r, i, t,
|
|
2483
|
+
a += this.renderTokens(n[4], r, i, t, o);
|
|
2361
2484
|
return a;
|
|
2362
2485
|
}
|
|
2363
2486
|
};
|
|
2364
|
-
|
|
2365
|
-
var
|
|
2366
|
-
if (!
|
|
2367
|
-
return this.renderTokens(n[4], r, i, t,
|
|
2487
|
+
$.prototype.renderInverted = function(n, r, i, t, o) {
|
|
2488
|
+
var l = r.lookup(n[1]);
|
|
2489
|
+
if (!l || ae(l) && l.length === 0)
|
|
2490
|
+
return this.renderTokens(n[4], r, i, t, o);
|
|
2368
2491
|
};
|
|
2369
|
-
|
|
2370
|
-
for (var t = r.replace(/[^ \t]/g, ""),
|
|
2371
|
-
`),
|
|
2372
|
-
l
|
|
2373
|
-
return
|
|
2492
|
+
$.prototype.indentPartial = function(n, r, i) {
|
|
2493
|
+
for (var t = r.replace(/[^ \t]/g, ""), o = n.split(`
|
|
2494
|
+
`), l = 0; l < o.length; l++)
|
|
2495
|
+
o[l].length && (l > 0 || !i) && (o[l] = t + o[l]);
|
|
2496
|
+
return o.join(`
|
|
2374
2497
|
`);
|
|
2375
2498
|
};
|
|
2376
|
-
|
|
2499
|
+
$.prototype.renderPartial = function(n, r, i, t) {
|
|
2377
2500
|
if (i) {
|
|
2378
|
-
var
|
|
2379
|
-
if (
|
|
2380
|
-
var a = n[6],
|
|
2381
|
-
|
|
2382
|
-
var f = this.parse(
|
|
2383
|
-
return this.renderTokens(f, r, i,
|
|
2501
|
+
var o = this.getConfigTags(t), l = Ze(i) ? i(n[1]) : i[n[1]];
|
|
2502
|
+
if (l != null) {
|
|
2503
|
+
var a = n[6], s = n[5], c = n[4], u = l;
|
|
2504
|
+
s == 0 && c && (u = this.indentPartial(l, c, a));
|
|
2505
|
+
var f = this.parse(u, o);
|
|
2506
|
+
return this.renderTokens(f, r, i, u, t);
|
|
2384
2507
|
}
|
|
2385
2508
|
}
|
|
2386
2509
|
};
|
|
2387
|
-
|
|
2510
|
+
$.prototype.unescapedValue = function(n, r) {
|
|
2388
2511
|
var i = r.lookup(n[1]);
|
|
2389
2512
|
if (i != null)
|
|
2390
2513
|
return i;
|
|
2391
2514
|
};
|
|
2392
|
-
|
|
2393
|
-
var t = this.getConfigEscape(i) ||
|
|
2394
|
-
if (
|
|
2395
|
-
return typeof
|
|
2515
|
+
$.prototype.escapedValue = function(n, r, i) {
|
|
2516
|
+
var t = this.getConfigEscape(i) || D.escape, o = r.lookup(n[1]);
|
|
2517
|
+
if (o != null)
|
|
2518
|
+
return typeof o == "number" && t === D.escape ? String(o) : t(o);
|
|
2396
2519
|
};
|
|
2397
|
-
|
|
2520
|
+
$.prototype.rawValue = function(n) {
|
|
2398
2521
|
return n[1];
|
|
2399
2522
|
};
|
|
2400
|
-
|
|
2401
|
-
return
|
|
2523
|
+
$.prototype.getConfigTags = function(n) {
|
|
2524
|
+
return ae(n) ? n : n && typeof n == "object" ? n.tags : void 0;
|
|
2402
2525
|
};
|
|
2403
|
-
|
|
2404
|
-
if (n && typeof n == "object" && !
|
|
2526
|
+
$.prototype.getConfigEscape = function(n) {
|
|
2527
|
+
if (n && typeof n == "object" && !ae(n))
|
|
2405
2528
|
return n.escape;
|
|
2406
2529
|
};
|
|
2407
|
-
var
|
|
2530
|
+
var D = {
|
|
2408
2531
|
name: "mustache.js",
|
|
2409
2532
|
version: "4.2.0",
|
|
2410
2533
|
tags: ["{{", "}}"],
|
|
@@ -2429,35 +2552,35 @@ var N = {
|
|
|
2429
2552
|
get templateCache() {
|
|
2430
2553
|
return ge.templateCache;
|
|
2431
2554
|
}
|
|
2432
|
-
}, ge = new
|
|
2433
|
-
|
|
2555
|
+
}, ge = new $();
|
|
2556
|
+
D.clearCache = function() {
|
|
2434
2557
|
return ge.clearCache();
|
|
2435
2558
|
};
|
|
2436
|
-
|
|
2559
|
+
D.parse = function(n, r) {
|
|
2437
2560
|
return ge.parse(n, r);
|
|
2438
2561
|
};
|
|
2439
|
-
|
|
2562
|
+
D.render = function(n, r, i, t) {
|
|
2440
2563
|
if (typeof n != "string")
|
|
2441
|
-
throw new TypeError('Invalid template! Template should be a "string" but "' +
|
|
2564
|
+
throw new TypeError('Invalid template! Template should be a "string" but "' + No(n) + '" was given as the first argument for mustache#render(template, view, partials)');
|
|
2442
2565
|
return ge.render(n, r, i, t);
|
|
2443
2566
|
};
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
function
|
|
2567
|
+
D.escape = zo;
|
|
2568
|
+
D.Scanner = ye;
|
|
2569
|
+
D.Context = le;
|
|
2570
|
+
D.Writer = $;
|
|
2571
|
+
function Ln(e, {
|
|
2449
2572
|
glob: n,
|
|
2450
2573
|
regex: r,
|
|
2451
2574
|
substring: i
|
|
2452
2575
|
}) {
|
|
2453
|
-
const t = [n, r, i].filter((
|
|
2576
|
+
const t = [n, r, i].filter((o) => o !== void 0);
|
|
2454
2577
|
if (t.length !== 0) {
|
|
2455
2578
|
if (t.length > 1)
|
|
2456
2579
|
throw new Error(`Specify only one of --${e}, --${e}-glob, --${e}-regex, --${e}-substring`);
|
|
2457
2580
|
return r !== void 0 ? { pattern: r, mode: "regex" } : i !== void 0 ? { pattern: i, mode: "substring" } : { pattern: n, mode: "glob" };
|
|
2458
2581
|
}
|
|
2459
2582
|
}
|
|
2460
|
-
function
|
|
2583
|
+
function Vo() {
|
|
2461
2584
|
return {
|
|
2462
2585
|
command: "list",
|
|
2463
2586
|
describe: "List strings in the xcstrings file",
|
|
@@ -2494,39 +2617,39 @@ function Uo() {
|
|
|
2494
2617
|
type: "string",
|
|
2495
2618
|
describe: "Mustache template. Available variables: {{language}}, {{key}}, {{text}}"
|
|
2496
2619
|
}).check((n) => {
|
|
2497
|
-
const r = [n.key, n["key-glob"]].filter((
|
|
2620
|
+
const r = [n.key, n["key-glob"]].filter((s) => s !== void 0).length, i = n["key-regex"] ? 1 : 0, t = n["key-substring"] ? 1 : 0;
|
|
2498
2621
|
if (r + i + t > 1)
|
|
2499
2622
|
throw new Error("Specify only one of --key/--key-glob, --key-regex, or --key-substring");
|
|
2500
|
-
const
|
|
2501
|
-
if (
|
|
2623
|
+
const o = [n.text, n["text-glob"]].filter((s) => s !== void 0).length, l = n["text-regex"] ? 1 : 0, a = n["text-substring"] ? 1 : 0;
|
|
2624
|
+
if (o + l + a > 1)
|
|
2502
2625
|
throw new Error("Specify only one of --text/--text-glob, --text-regex, or --text-substring");
|
|
2503
2626
|
return !0;
|
|
2504
2627
|
}),
|
|
2505
2628
|
handler: async (e) => {
|
|
2506
|
-
const n = [e.key, e["key-glob"]].filter((
|
|
2629
|
+
const n = [e.key, e["key-glob"]].filter((l) => l !== void 0), r = [e.text, e["text-glob"]].filter((l) => l !== void 0), i = Ln("key", {
|
|
2507
2630
|
glob: n[0],
|
|
2508
2631
|
regex: e["key-regex"],
|
|
2509
2632
|
substring: e["key-substring"]
|
|
2510
|
-
}), t =
|
|
2633
|
+
}), t = Ln("text", {
|
|
2511
2634
|
glob: r[0],
|
|
2512
2635
|
regex: e["text-regex"],
|
|
2513
2636
|
substring: e["text-substring"]
|
|
2514
|
-
}),
|
|
2637
|
+
}), o = await Jo({
|
|
2515
2638
|
path: e.path,
|
|
2516
2639
|
languages: e.languages,
|
|
2517
2640
|
keyFilter: i,
|
|
2518
2641
|
textFilter: t,
|
|
2519
2642
|
format: e.format
|
|
2520
2643
|
});
|
|
2521
|
-
|
|
2644
|
+
o && console.log(o);
|
|
2522
2645
|
}
|
|
2523
2646
|
};
|
|
2524
2647
|
}
|
|
2525
|
-
function
|
|
2648
|
+
function Xo(e) {
|
|
2526
2649
|
const n = e.replace(/[.+^${}()|\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
2527
2650
|
return new RegExp(`^${n}$`);
|
|
2528
2651
|
}
|
|
2529
|
-
function
|
|
2652
|
+
function jn(e) {
|
|
2530
2653
|
if (!e) return () => !0;
|
|
2531
2654
|
if (e.mode === "regex") {
|
|
2532
2655
|
const r = new RegExp(e.pattern);
|
|
@@ -2536,51 +2659,51 @@ function Tn(e) {
|
|
|
2536
2659
|
const r = e.pattern;
|
|
2537
2660
|
return (i) => i.includes(r);
|
|
2538
2661
|
}
|
|
2539
|
-
const n =
|
|
2662
|
+
const n = Xo(e.pattern);
|
|
2540
2663
|
return (r) => n.test(r);
|
|
2541
2664
|
}
|
|
2542
|
-
function
|
|
2543
|
-
const r =
|
|
2544
|
-
|
|
2665
|
+
function Qo(e, n) {
|
|
2666
|
+
const r = D.escape;
|
|
2667
|
+
D.escape = (i) => i;
|
|
2545
2668
|
try {
|
|
2546
|
-
return
|
|
2669
|
+
return D.render(e, n);
|
|
2547
2670
|
} finally {
|
|
2548
|
-
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
async function
|
|
2552
|
-
const r = (await me(e.path)).strings ?? {}, i =
|
|
2553
|
-
for (const
|
|
2554
|
-
if (!i(
|
|
2555
|
-
const
|
|
2556
|
-
for (const
|
|
2557
|
-
if (
|
|
2558
|
-
const
|
|
2559
|
-
t(
|
|
2671
|
+
D.escape = r;
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
async function Jo(e) {
|
|
2675
|
+
const r = (await me(e.path)).strings ?? {}, i = jn(e.keyFilter), t = jn(e.textFilter), o = e.languages ? new Set(e.languages) : null, l = !!e.format, a = [];
|
|
2676
|
+
for (const s of Object.keys(r)) {
|
|
2677
|
+
if (!i(s)) continue;
|
|
2678
|
+
const u = r[s]?.localizations ?? {}, f = Object.keys(u), d = [];
|
|
2679
|
+
for (const g of f) {
|
|
2680
|
+
if (o && !o.has(g)) continue;
|
|
2681
|
+
const v = u[g]?.stringUnit?.value ?? "";
|
|
2682
|
+
t(v) && (l && e.format ? d.push(Qo(e.format, { language: g, key: s, text: v })) : d.push(` ${g}: ${JSON.stringify(v)}`));
|
|
2560
2683
|
}
|
|
2561
|
-
|
|
2684
|
+
d.length !== 0 && (l ? a.push(...d) : a.push(`${s}:`, ...d));
|
|
2562
2685
|
}
|
|
2563
2686
|
return a.join(`
|
|
2564
2687
|
`);
|
|
2565
2688
|
}
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2689
|
+
const In = Oe(process.cwd(), "Localizable.xcstrings");
|
|
2690
|
+
Nr(Rr(process.argv)).scriptName("xcstrings").usage("$0 <cmd> [args]").option("config", {
|
|
2568
2691
|
type: "string",
|
|
2569
2692
|
describe: "Path to config file"
|
|
2570
2693
|
}).option("path", {
|
|
2571
2694
|
type: "string",
|
|
2572
2695
|
describe: "Path to xcstrings file",
|
|
2573
|
-
default:
|
|
2696
|
+
default: In
|
|
2574
2697
|
}).middleware(async (e) => {
|
|
2575
|
-
const n = await
|
|
2576
|
-
e.path = await
|
|
2698
|
+
const n = await We(e.config);
|
|
2699
|
+
e.path = await zr(e.path, n, In);
|
|
2577
2700
|
}).command([
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2701
|
+
So(),
|
|
2702
|
+
Eo(),
|
|
2703
|
+
Fo(),
|
|
2704
|
+
Gr(),
|
|
2705
|
+
Vo()
|
|
2583
2706
|
]).demandCommand(1, "").strictCommands().recommendCommands().showHelpOnFail(!0).fail((e, n, r) => {
|
|
2584
2707
|
const i = e || n?.message;
|
|
2585
|
-
i && (console.error(
|
|
2708
|
+
i && (console.error(k.red(i)), console.log(), r.showHelp(), process.exit(1)), n && (console.error(n), process.exit(1)), r.showHelp(), process.exit(1);
|
|
2586
2709
|
}).help().argv;
|