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