From 06823fbf1c2e763a5bf76c3990ca98fbbcd98691 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 14 May 2024 14:05:49 +0800 Subject: updated node_modules --- .../yaml/dist/compose/resolve-flow-scalar.js | 26 +++++++++---------- node_modules/yaml/dist/nodes/Pair.d.ts | 2 +- node_modules/yaml/dist/parse/cst.d.ts | 2 +- node_modules/yaml/dist/parse/parser.js | 5 +++- node_modules/yaml/dist/schema/yaml-1.1/binary.js | 2 +- node_modules/yaml/dist/schema/yaml-1.1/bool.js | 2 +- node_modules/yaml/dist/stringify/foldFlowLines.js | 29 ++++++++++++++-------- .../yaml/dist/stringify/stringifyCollection.js | 20 +++++---------- 8 files changed, 46 insertions(+), 42 deletions(-) (limited to 'node_modules/yaml/dist') diff --git a/node_modules/yaml/dist/compose/resolve-flow-scalar.js b/node_modules/yaml/dist/compose/resolve-flow-scalar.js index cf6257ce..7976f2fd 100644 --- a/node_modules/yaml/dist/compose/resolve-flow-scalar.js +++ b/node_modules/yaml/dist/compose/resolve-flow-scalar.js @@ -191,19 +191,19 @@ function foldNewline(source, offset) { return { fold, offset }; } const escapeCodes = { - '0': '\0', - a: '\x07', - b: '\b', - e: '\x1b', - f: '\f', - n: '\n', - r: '\r', - t: '\t', - v: '\v', - N: '\u0085', - _: '\u00a0', - L: '\u2028', - P: '\u2029', + '0': '\0', // null character + a: '\x07', // bell character + b: '\b', // backspace + e: '\x1b', // escape character + f: '\f', // form feed + n: '\n', // line feed + r: '\r', // carriage return + t: '\t', // horizontal tab + v: '\v', // vertical tab + N: '\u0085', // Unicode next line + _: '\u00a0', // Unicode non-breaking space + L: '\u2028', // Unicode line separator + P: '\u2029', // Unicode paragraph separator ' ': ' ', '"': '"', '/': '/', diff --git a/node_modules/yaml/dist/nodes/Pair.d.ts b/node_modules/yaml/dist/nodes/Pair.d.ts index e87fe66f..6178d3a3 100644 --- a/node_modules/yaml/dist/nodes/Pair.d.ts +++ b/node_modules/yaml/dist/nodes/Pair.d.ts @@ -5,7 +5,7 @@ import type { StringifyContext } from '../stringify/stringify.js'; import { addPairToJSMap } from './addPairToJSMap.js'; import { NODE_TYPE } from './identity.js'; import type { ToJSContext } from './toJS.js'; -export declare function createPair(key: unknown, value: unknown, ctx: CreateNodeContext): Pair | import("./Scalar.js").Scalar | import("./Alias.js").Alias | import("./YAMLSeq.js").YAMLSeq>; +export declare function createPair(key: unknown, value: unknown, ctx: CreateNodeContext): Pair | import("./YAMLMap.js").YAMLMap | import("./YAMLSeq.js").YAMLSeq>; export declare class Pair { readonly [NODE_TYPE]: symbol; /** Always Node or null when parsed, but can be set to anything. */ diff --git a/node_modules/yaml/dist/parse/cst.d.ts b/node_modules/yaml/dist/parse/cst.d.ts index bfe7fc14..ec57ace1 100644 --- a/node_modules/yaml/dist/parse/cst.d.ts +++ b/node_modules/yaml/dist/parse/cst.d.ts @@ -99,7 +99,7 @@ export declare const SCALAR = "\u001F"; /** @returns `true` if `token` is a flow or block collection */ export declare const isCollection: (token: Token | null | undefined) => token is BlockMap | BlockSequence | FlowCollection; /** @returns `true` if `token` is a flow or block scalar; not an alias */ -export declare const isScalar: (token: Token | null | undefined) => token is BlockScalar | FlowScalar; +export declare const isScalar: (token: Token | null | undefined) => token is FlowScalar | BlockScalar; /** Get a printable representation of a lexer token */ export declare function prettyToken(token: string): string; /** Identify the type of a lexer token. May return `null` for unknown tokens. */ diff --git a/node_modules/yaml/dist/parse/parser.js b/node_modules/yaml/dist/parse/parser.js index 8dcdf5dc..7a1493d8 100644 --- a/node_modules/yaml/dist/parse/parser.js +++ b/node_modules/yaml/dist/parse/parser.js @@ -517,7 +517,10 @@ class Parser { return; } if (this.indent >= map.indent) { - const atNextItem = !this.onKeyLine && this.indent === map.indent && it.sep; + const atNextItem = !this.onKeyLine && + this.indent === map.indent && + it.sep && + this.type !== 'seq-item-ind'; // For empty nodes, assign newline-separated not indented empty tokens to following node let start = []; if (atNextItem && it.sep && !it.value) { diff --git a/node_modules/yaml/dist/schema/yaml-1.1/binary.js b/node_modules/yaml/dist/schema/yaml-1.1/binary.js index df93e05b..38fa4980 100644 --- a/node_modules/yaml/dist/schema/yaml-1.1/binary.js +++ b/node_modules/yaml/dist/schema/yaml-1.1/binary.js @@ -4,7 +4,7 @@ var Scalar = require('../../nodes/Scalar.js'); var stringifyString = require('../../stringify/stringifyString.js'); const binary = { - identify: value => value instanceof Uint8Array, + identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array default: false, tag: 'tag:yaml.org,2002:binary', /** diff --git a/node_modules/yaml/dist/schema/yaml-1.1/bool.js b/node_modules/yaml/dist/schema/yaml-1.1/bool.js index fdb3b460..d9879526 100644 --- a/node_modules/yaml/dist/schema/yaml-1.1/bool.js +++ b/node_modules/yaml/dist/schema/yaml-1.1/bool.js @@ -20,7 +20,7 @@ const falseTag = { identify: value => value === false, default: true, tag: 'tag:yaml.org,2002:bool', - test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, + test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, resolve: () => new Scalar.Scalar(false), stringify: boolStringify }; diff --git a/node_modules/yaml/dist/stringify/foldFlowLines.js b/node_modules/yaml/dist/stringify/foldFlowLines.js index efe7a257..829a5601 100644 --- a/node_modules/yaml/dist/stringify/foldFlowLines.js +++ b/node_modules/yaml/dist/stringify/foldFlowLines.js @@ -30,7 +30,7 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = let escStart = -1; let escEnd = -1; if (mode === FOLD_BLOCK) { - i = consumeMoreIndentedLines(text, i); + i = consumeMoreIndentedLines(text, i, indent.length); if (i !== -1) end = i + endStep; } @@ -54,8 +54,8 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = } if (ch === '\n') { if (mode === FOLD_BLOCK) - i = consumeMoreIndentedLines(text, i); - end = i + endStep; + i = consumeMoreIndentedLines(text, i, indent.length); + end = i + indent.length + endStep; split = undefined; } else { @@ -123,15 +123,24 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = * Presumes `i + 1` is at the start of a line * @returns index of last newline in more-indented block */ -function consumeMoreIndentedLines(text, i) { - let ch = text[i + 1]; +function consumeMoreIndentedLines(text, i, indent) { + let end = i; + let start = i + 1; + let ch = text[start]; while (ch === ' ' || ch === '\t') { - do { - ch = text[(i += 1)]; - } while (ch && ch !== '\n'); - ch = text[i + 1]; + if (i < start + indent) { + ch = text[++i]; + } + else { + do { + ch = text[++i]; + } while (ch && ch !== '\n'); + end = i; + start = i + 1; + ch = text[start]; + } } - return i; + return end; } exports.FOLD_BLOCK = FOLD_BLOCK; diff --git a/node_modules/yaml/dist/stringify/stringifyCollection.js b/node_modules/yaml/dist/stringify/stringifyCollection.js index 750efc15..6efffc51 100644 --- a/node_modules/yaml/dist/stringify/stringifyCollection.js +++ b/node_modules/yaml/dist/stringify/stringifyCollection.js @@ -1,6 +1,5 @@ 'use strict'; -var Collection = require('../nodes/Collection.js'); var identity = require('../nodes/identity.js'); var stringify = require('./stringify.js'); var stringifyComment = require('./stringifyComment.js'); @@ -61,7 +60,7 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl onChompKeep(); return str; } -function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) { +function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx; itemIndent += indentStep; const itemCtx = Object.assign({}, ctx, { @@ -114,32 +113,25 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden lines.push(str); linesAtValue = lines.length; } - let str; const { start, end } = flowChars; if (lines.length === 0) { - str = start + end; + return start + end; } else { if (!reqNewline) { const len = lines.reduce((sum, line) => sum + line.length + 2, 2); - reqNewline = len > Collection.Collection.maxFlowStringSingleLineLength; + reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth; } if (reqNewline) { - str = start; + let str = start; for (const line of lines) str += line ? `\n${indentStep}${indent}${line}` : '\n'; - str += `\n${indent}${end}`; + return `${str}\n${indent}${end}`; } else { - str = `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`; + return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`; } } - if (comment) { - str += stringifyComment.lineComment(str, indent, commentString(comment)); - if (onComment) - onComment(); - } - return str; } function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { if (comment && chompKeep) -- cgit v1.2.3