@poe-platform/safe-bash 0.1.677 → 0.1.679
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/safe-bash/chunks/{chunk-MP5J46WX.js → chunk-2RAAINWZ.js} +48 -21
- package/dist/safe-bash/chunks/{chunk-MP5J46WX.js.map → chunk-2RAAINWZ.js.map} +2 -2
- package/dist/safe-bash/commands/yq/index.browser.js +1 -1
- package/dist/safe-bash/commands/yq/parser.d.ts.map +1 -1
- package/dist/safe-bash/commands/yq/parser.js +54 -31
- package/dist/safe-bash/commands/yq/parser.js.map +1 -1
- package/dist/safe-bash/core.browser.js +1 -1
- package/package.json +2 -2
|
@@ -2931,7 +2931,7 @@ function stripComment(text) {
|
|
|
2931
2931
|
return flowDepth > 0 ? text.trimEnd() : text.slice(0, index).trimEnd();
|
|
2932
2932
|
}
|
|
2933
2933
|
}
|
|
2934
|
-
return text.trimEnd();
|
|
2934
|
+
return single || double ? text : text.trimEnd();
|
|
2935
2935
|
}
|
|
2936
2936
|
function mappingColon(text, flow = false) {
|
|
2937
2937
|
let single = false;
|
|
@@ -3077,14 +3077,27 @@ function normalizeTag(raw) {
|
|
|
3077
3077
|
if (!["map", "seq", "str", "null", "bool", "int", "float"].includes(name)) throw schema("SCHEMA_UNSUPPORTED_TAG");
|
|
3078
3078
|
return name;
|
|
3079
3079
|
}
|
|
3080
|
+
function scanQuotedWhitespace(raw, start, end) {
|
|
3081
|
+
let position = start;
|
|
3082
|
+
let breaks = 0;
|
|
3083
|
+
while (position < end) {
|
|
3084
|
+
const character = raw[position];
|
|
3085
|
+
if (character === "\r" || character === "\n") {
|
|
3086
|
+
breaks++;
|
|
3087
|
+
if (character === "\r" && position + 1 < end && raw[position + 1] === "\n") position++;
|
|
3088
|
+
} else if (character !== " " && character !== " ") break;
|
|
3089
|
+
position++;
|
|
3090
|
+
}
|
|
3091
|
+
return { end: position, breaks };
|
|
3092
|
+
}
|
|
3080
3093
|
function decodeDouble(raw) {
|
|
3081
3094
|
let result = "";
|
|
3082
3095
|
for (let index = 1; index < raw.length - 1; index++) {
|
|
3083
3096
|
const character = raw[index];
|
|
3084
|
-
if (
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3097
|
+
if (" \r\n".includes(character)) {
|
|
3098
|
+
const whitespace = scanQuotedWhitespace(raw, index, raw.length - 1);
|
|
3099
|
+
result += whitespace.breaks === 0 ? raw.slice(index, whitespace.end) : whitespace.breaks === 1 ? " " : "\n".repeat(whitespace.breaks - 1);
|
|
3100
|
+
index = whitespace.end - 1;
|
|
3088
3101
|
continue;
|
|
3089
3102
|
}
|
|
3090
3103
|
if (character !== "\\") {
|
|
@@ -3121,8 +3134,9 @@ function decodeDouble(raw) {
|
|
|
3121
3134
|
continue;
|
|
3122
3135
|
}
|
|
3123
3136
|
if (escape === "\n" || escape === "\r") {
|
|
3124
|
-
|
|
3125
|
-
|
|
3137
|
+
const whitespace = scanQuotedWhitespace(raw, index, raw.length - 1);
|
|
3138
|
+
result += "\n".repeat(whitespace.breaks - 1);
|
|
3139
|
+
index = whitespace.end - 1;
|
|
3126
3140
|
continue;
|
|
3127
3141
|
}
|
|
3128
3142
|
const digits = escape === "x" ? 2 : escape === "u" ? 4 : escape === "U" ? 8 : 0;
|
|
@@ -3149,10 +3163,10 @@ function projectDoubleBytes(raw, start = 0, end = raw.length) {
|
|
|
3149
3163
|
let bytes = 0;
|
|
3150
3164
|
for (let index = start + 1; index < end - 1; index++) {
|
|
3151
3165
|
const character = raw[index];
|
|
3152
|
-
if (
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3166
|
+
if (" \r\n".includes(character)) {
|
|
3167
|
+
const whitespace = scanQuotedWhitespace(raw, index, end - 1);
|
|
3168
|
+
bytes += whitespace.breaks === 0 ? whitespace.end - index : Math.max(1, whitespace.breaks - 1);
|
|
3169
|
+
index = whitespace.end - 1;
|
|
3156
3170
|
continue;
|
|
3157
3171
|
}
|
|
3158
3172
|
if (character !== "\\") {
|
|
@@ -3189,8 +3203,9 @@ function projectDoubleBytes(raw, start = 0, end = raw.length) {
|
|
|
3189
3203
|
continue;
|
|
3190
3204
|
}
|
|
3191
3205
|
if (escape === "\n" || escape === "\r") {
|
|
3192
|
-
|
|
3193
|
-
|
|
3206
|
+
const whitespace = scanQuotedWhitespace(raw, index, end - 1);
|
|
3207
|
+
bytes += whitespace.breaks - 1;
|
|
3208
|
+
index = whitespace.end - 1;
|
|
3194
3209
|
continue;
|
|
3195
3210
|
}
|
|
3196
3211
|
const digits = escape === "x" ? 2 : escape === "u" ? 4 : escape === "U" ? 8 : 0;
|
|
@@ -3213,8 +3228,19 @@ function projectDoubleBytes(raw, start = 0, end = raw.length) {
|
|
|
3213
3228
|
return bytes;
|
|
3214
3229
|
}
|
|
3215
3230
|
function decodeSingle(raw) {
|
|
3216
|
-
|
|
3217
|
-
|
|
3231
|
+
let result = "";
|
|
3232
|
+
for (let index = 1; index < raw.length - 1; index++) {
|
|
3233
|
+
const character = raw[index];
|
|
3234
|
+
if (" \r\n".includes(character)) {
|
|
3235
|
+
const whitespace = scanQuotedWhitespace(raw, index, raw.length - 1);
|
|
3236
|
+
result += whitespace.breaks === 0 ? raw.slice(index, whitespace.end) : whitespace.breaks === 1 ? " " : "\n".repeat(whitespace.breaks - 1);
|
|
3237
|
+
index = whitespace.end - 1;
|
|
3238
|
+
} else {
|
|
3239
|
+
result += character;
|
|
3240
|
+
if (character === "'" && raw[index + 1] === "'") index++;
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
return result;
|
|
3218
3244
|
}
|
|
3219
3245
|
function projectSingleBytes(raw, start = 0, end = raw.length) {
|
|
3220
3246
|
let bytes = 0;
|
|
@@ -3223,10 +3249,10 @@ function projectSingleBytes(raw, start = 0, end = raw.length) {
|
|
|
3223
3249
|
if (character === "'" && raw[index + 1] === "'") {
|
|
3224
3250
|
bytes++;
|
|
3225
3251
|
index++;
|
|
3226
|
-
} else if (
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3252
|
+
} else if (" \r\n".includes(character)) {
|
|
3253
|
+
const whitespace = scanQuotedWhitespace(raw, index, end - 1);
|
|
3254
|
+
bytes += whitespace.breaks === 0 ? whitespace.end - index : Math.max(1, whitespace.breaks - 1);
|
|
3255
|
+
index = whitespace.end - 1;
|
|
3230
3256
|
} else {
|
|
3231
3257
|
const codePoint = raw.codePointAt(index);
|
|
3232
3258
|
bytes += utf8Width(codePoint);
|
|
@@ -3818,8 +3844,9 @@ var BlockParser = class {
|
|
|
3818
3844
|
}
|
|
3819
3845
|
balanced = !single && !double && (negativeDepth || depth === 0);
|
|
3820
3846
|
if (balanced || this.#index >= this.lines.length) break;
|
|
3847
|
+
const continuation = this.lines[this.#index++].text;
|
|
3821
3848
|
fragment = `
|
|
3822
|
-
${
|
|
3849
|
+
${single || double ? continuation : continuation.trimStart()}`;
|
|
3823
3850
|
fragments.push(fragment);
|
|
3824
3851
|
}
|
|
3825
3852
|
if (!balanced) throw syntax(lineNumber, 1);
|
|
@@ -5200,4 +5227,4 @@ export {
|
|
|
5200
5227
|
createYqCommands,
|
|
5201
5228
|
yqCommands
|
|
5202
5229
|
};
|
|
5203
|
-
//# sourceMappingURL=chunk-
|
|
5230
|
+
//# sourceMappingURL=chunk-2RAAINWZ.js.map
|