Skip to content

Commit 61d782c

Browse files
authored
Maintenance release to ongoing 3.0.0 branch (which is asofyet unreleased) (#145)
1 parent e909e37 commit 61d782c

File tree

4 files changed

+242
-187
lines changed

4 files changed

+242
-187
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog],
66
and this project adheres to [Semantic Versioning].
77

8+
For all 2.x branch changes, please see `v2-lts` branch.
9+
810
## [3.0.0] - unreleased
911

1012
> [!WARNING]
@@ -23,6 +25,7 @@ and this project adheres to [Semantic Versioning].
2325
- This will make it easier to add new schema version support without risking breakage to existing versions
2426
- This makes it much easier to test convenience functionality independently from the schema fields
2527
- So... many... tests...
28+
- Dependencies also updated
2629

2730
## [2.3.0] - 2024-02-07
2831

dist/index.cjs

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25993,21 +25993,29 @@ ${indent}`) + "'";
2599325993
start = start.replace(/\n+/g, `$&${indent}`);
2599425994
}
2599525995
const indentSize = indent ? "2" : "1";
25996-
let header = (literal ? "|" : ">") + (startWithSpace ? indentSize : "") + chomp;
25996+
let header = (startWithSpace ? indentSize : "") + chomp;
2599725997
if (comment) {
2599825998
header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " "));
2599925999
if (onComment)
2600026000
onComment();
2600126001
}
26002-
if (literal) {
26003-
value = value.replace(/\n+/g, `$&${indent}`);
26004-
return `${header}
26005-
${indent}${start}${value}${end}`;
26006-
}
26007-
value = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
26008-
const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true));
26009-
return `${header}
26002+
if (!literal) {
26003+
const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
26004+
let literalFallback = false;
26005+
const foldOptions = getFoldOptions(ctx, true);
26006+
if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) {
26007+
foldOptions.onOverflow = () => {
26008+
literalFallback = true;
26009+
};
26010+
}
26011+
const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
26012+
if (!literalFallback)
26013+
return `>${header}
2601026014
${indent}${body}`;
26015+
}
26016+
value = value.replace(/\n+/g, `$&${indent}`);
26017+
return `|${header}
26018+
${indent}${start}${value}${end}`;
2601126019
}
2601226020
function plainString(item, ctx, onComment, onChompKeep) {
2601326021
const { type, value } = item;
@@ -26337,14 +26345,15 @@ ${ctx.indent}`;
2633726345
var require_log = __commonJS({
2633826346
"node_modules/yaml/dist/log.js"(exports2) {
2633926347
"use strict";
26348+
var node_process = require("node:process");
2634026349
function debug(logLevel, ...messages) {
2634126350
if (logLevel === "debug")
2634226351
console.log(...messages);
2634326352
}
2634426353
function warn(logLevel, warning) {
2634526354
if (logLevel === "debug" || logLevel === "warn") {
26346-
if (typeof process !== "undefined" && process.emitWarning)
26347-
process.emitWarning(warning);
26355+
if (typeof node_process.emitWarning === "function")
26356+
node_process.emitWarning(warning);
2634826357
else
2634926358
console.warn(warning);
2635026359
}
@@ -27202,7 +27211,7 @@ var require_schema2 = __commonJS({
2720227211
identify: (value) => typeof value === "boolean",
2720327212
default: true,
2720427213
tag: "tag:yaml.org,2002:bool",
27205-
test: /^true|false$/,
27214+
test: /^true$|^false$/,
2720627215
resolve: (str) => str === "true",
2720727216
stringify: stringifyJSON
2720827217
},
@@ -27241,6 +27250,7 @@ var require_schema2 = __commonJS({
2724127250
var require_binary = __commonJS({
2724227251
"node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) {
2724327252
"use strict";
27253+
var node_buffer = require("node:buffer");
2724427254
var Scalar = require_Scalar();
2724527255
var stringifyString = require_stringifyString();
2724627256
var binary = {
@@ -27257,8 +27267,8 @@ var require_binary = __commonJS({
2725727267
* document.querySelector('#photo').src = URL.createObjectURL(blob)
2725827268
*/
2725927269
resolve(src, onError) {
27260-
if (typeof Buffer === "function") {
27261-
return Buffer.from(src, "base64");
27270+
if (typeof node_buffer.Buffer === "function") {
27271+
return node_buffer.Buffer.from(src, "base64");
2726227272
} else if (typeof atob === "function") {
2726327273
const str = atob(src.replace(/[\n\r]/g, ""));
2726427274
const buffer = new Uint8Array(str.length);
@@ -27273,8 +27283,8 @@ var require_binary = __commonJS({
2727327283
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
2727427284
const buf = value;
2727527285
let str;
27276-
if (typeof Buffer === "function") {
27277-
str = buf instanceof Buffer ? buf.toString("base64") : Buffer.from(buf.buffer).toString("base64");
27286+
if (typeof node_buffer.Buffer === "function") {
27287+
str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
2727827288
} else if (typeof btoa === "function") {
2727927289
let s = "";
2728027290
for (let i = 0; i < buf.length; ++i)
@@ -27786,7 +27796,7 @@ var require_timestamp = __commonJS({
2778627796
}
2778727797
return new Date(date);
2778827798
},
27789-
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "")
27799+
stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, "")
2779027800
};
2779127801
exports2.floatTime = floatTime;
2779227802
exports2.intTime = intTime;
@@ -28472,7 +28482,7 @@ var require_resolve_props = __commonJS({
2847228482
if (atNewline) {
2847328483
if (comment)
2847428484
comment += token.source;
28475-
else
28485+
else if (!found || indicator !== "seq-item-ind")
2847628486
spaceBefore = true;
2847728487
} else
2847828488
commentSep += token.source;
@@ -29753,6 +29763,7 @@ var require_compose_doc = __commonJS({
2975329763
var require_composer = __commonJS({
2975429764
"node_modules/yaml/dist/compose/composer.js"(exports2) {
2975529765
"use strict";
29766+
var node_process = require("node:process");
2975629767
var directives = require_directives();
2975729768
var Document = require_Document();
2975829769
var errors = require_errors2();
@@ -29868,7 +29879,7 @@ ${cb}` : comment;
2986829879
}
2986929880
/** Advance the composer by one CST token. */
2987029881
*next(token) {
29871-
if (process.env.LOG_STREAM)
29882+
if (node_process.env.LOG_STREAM)
2987229883
console.dir(token, { depth: null });
2987329884
switch (token.type) {
2987429885
case "directive":
@@ -30978,6 +30989,7 @@ var require_line_counter = __commonJS({
3097830989
var require_parser = __commonJS({
3097930990
"node_modules/yaml/dist/parse/parser.js"(exports2) {
3098030991
"use strict";
30992+
var node_process = require("node:process");
3098130993
var cst = require_cst();
3098230994
var lexer = require_lexer();
3098330995
function includesToken(list, type) {
@@ -31101,7 +31113,7 @@ var require_parser = __commonJS({
3110131113
*/
3110231114
*next(source) {
3110331115
this.source = source;
31104-
if (process.env.LOG_TOKENS)
31116+
if (node_process.env.LOG_TOKENS)
3110531117
console.log("|", cst.prettyToken(source));
3110631118
if (this.atScalar) {
3110731119
this.atScalar = false;

0 commit comments

Comments
 (0)