summaryrefslogtreecommitdiff
path: root/node_modules/yaml/dist/nodes
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:10:59 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:41:44 +0800
commitfc87c009806dcc98867f6b58efe29b042aa01dee (patch)
tree8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/yaml/dist/nodes
parent3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff)
node: updatemain
Diffstat (limited to 'node_modules/yaml/dist/nodes')
-rw-r--r--node_modules/yaml/dist/nodes/Alias.d.ts28
-rw-r--r--node_modules/yaml/dist/nodes/Alias.js103
-rw-r--r--node_modules/yaml/dist/nodes/Collection.d.ts73
-rw-r--r--node_modules/yaml/dist/nodes/Collection.js151
-rw-r--r--node_modules/yaml/dist/nodes/Node.d.ts46
-rw-r--r--node_modules/yaml/dist/nodes/Node.js40
-rw-r--r--node_modules/yaml/dist/nodes/Pair.d.ts21
-rw-r--r--node_modules/yaml/dist/nodes/Pair.js39
-rw-r--r--node_modules/yaml/dist/nodes/Scalar.d.ts42
-rw-r--r--node_modules/yaml/dist/nodes/Scalar.js27
-rw-r--r--node_modules/yaml/dist/nodes/YAMLMap.d.ts53
-rw-r--r--node_modules/yaml/dist/nodes/YAMLMap.js147
-rw-r--r--node_modules/yaml/dist/nodes/YAMLSeq.d.ts60
-rw-r--r--node_modules/yaml/dist/nodes/YAMLSeq.js115
-rw-r--r--node_modules/yaml/dist/nodes/addPairToJSMap.d.ts4
-rw-r--r--node_modules/yaml/dist/nodes/addPairToJSMap.js106
-rw-r--r--node_modules/yaml/dist/nodes/identity.d.ts23
-rw-r--r--node_modules/yaml/dist/nodes/identity.js53
-rw-r--r--node_modules/yaml/dist/nodes/toJS.d.ts27
-rw-r--r--node_modules/yaml/dist/nodes/toJS.js39
20 files changed, 0 insertions, 1197 deletions
diff --git a/node_modules/yaml/dist/nodes/Alias.d.ts b/node_modules/yaml/dist/nodes/Alias.d.ts
deleted file mode 100644
index b55ebae8..00000000
--- a/node_modules/yaml/dist/nodes/Alias.d.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import type { Document } from '../doc/Document.js';
-import type { FlowScalar } from '../parse/cst.js';
-import type { StringifyContext } from '../stringify/stringify.js';
-import { NodeBase, Range } from './Node.js';
-import type { Scalar } from './Scalar';
-import { ToJSContext } from './toJS.js';
-import type { YAMLMap } from './YAMLMap.js';
-import type { YAMLSeq } from './YAMLSeq.js';
-export declare namespace Alias {
- interface Parsed extends Alias {
- range: Range;
- srcToken?: FlowScalar & {
- type: 'alias';
- };
- }
-}
-export declare class Alias extends NodeBase {
- source: string;
- anchor?: never;
- constructor(source: string);
- /**
- * Resolve the value of this alias within `doc`, finding the last
- * instance of the `source` anchor before this node.
- */
- resolve(doc: Document): Scalar | YAMLMap | YAMLSeq | undefined;
- toJSON(_arg?: unknown, ctx?: ToJSContext): {} | null;
- toString(ctx?: StringifyContext, _onComment?: () => void, _onChompKeep?: () => void): string;
-}
diff --git a/node_modules/yaml/dist/nodes/Alias.js b/node_modules/yaml/dist/nodes/Alias.js
deleted file mode 100644
index 46b37d94..00000000
--- a/node_modules/yaml/dist/nodes/Alias.js
+++ /dev/null
@@ -1,103 +0,0 @@
-'use strict';
-
-var anchors = require('../doc/anchors.js');
-var visit = require('../visit.js');
-var identity = require('./identity.js');
-var Node = require('./Node.js');
-var toJS = require('./toJS.js');
-
-class Alias extends Node.NodeBase {
- constructor(source) {
- super(identity.ALIAS);
- this.source = source;
- Object.defineProperty(this, 'tag', {
- set() {
- throw new Error('Alias nodes cannot have tags');
- }
- });
- }
- /**
- * Resolve the value of this alias within `doc`, finding the last
- * instance of the `source` anchor before this node.
- */
- resolve(doc) {
- let found = undefined;
- visit.visit(doc, {
- Node: (_key, node) => {
- if (node === this)
- return visit.visit.BREAK;
- if (node.anchor === this.source)
- found = node;
- }
- });
- return found;
- }
- toJSON(_arg, ctx) {
- if (!ctx)
- return { source: this.source };
- const { anchors, doc, maxAliasCount } = ctx;
- const source = this.resolve(doc);
- if (!source) {
- const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
- throw new ReferenceError(msg);
- }
- let data = anchors.get(source);
- if (!data) {
- // Resolve anchors for Node.prototype.toJS()
- toJS.toJS(source, null, ctx);
- data = anchors.get(source);
- }
- /* istanbul ignore if */
- if (!data || data.res === undefined) {
- const msg = 'This should not happen: Alias anchor was not resolved?';
- throw new ReferenceError(msg);
- }
- if (maxAliasCount >= 0) {
- data.count += 1;
- if (data.aliasCount === 0)
- data.aliasCount = getAliasCount(doc, source, anchors);
- if (data.count * data.aliasCount > maxAliasCount) {
- const msg = 'Excessive alias count indicates a resource exhaustion attack';
- throw new ReferenceError(msg);
- }
- }
- return data.res;
- }
- toString(ctx, _onComment, _onChompKeep) {
- const src = `*${this.source}`;
- if (ctx) {
- anchors.anchorIsValid(this.source);
- if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
- const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
- throw new Error(msg);
- }
- if (ctx.implicitKey)
- return `${src} `;
- }
- return src;
- }
-}
-function getAliasCount(doc, node, anchors) {
- if (identity.isAlias(node)) {
- const source = node.resolve(doc);
- const anchor = anchors && source && anchors.get(source);
- return anchor ? anchor.count * anchor.aliasCount : 0;
- }
- else if (identity.isCollection(node)) {
- let count = 0;
- for (const item of node.items) {
- const c = getAliasCount(doc, item, anchors);
- if (c > count)
- count = c;
- }
- return count;
- }
- else if (identity.isPair(node)) {
- const kc = getAliasCount(doc, node.key, anchors);
- const vc = getAliasCount(doc, node.value, anchors);
- return Math.max(kc, vc);
- }
- return 1;
-}
-
-exports.Alias = Alias;
diff --git a/node_modules/yaml/dist/nodes/Collection.d.ts b/node_modules/yaml/dist/nodes/Collection.d.ts
deleted file mode 100644
index 0b5979d9..00000000
--- a/node_modules/yaml/dist/nodes/Collection.d.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import type { Schema } from '../schema/Schema.js';
-import { NODE_TYPE } from './identity.js';
-import { NodeBase } from './Node.js';
-export declare function collectionFromPath(schema: Schema, path: unknown[], value: unknown): import("./Node.js").Node;
-export declare const isEmptyPath: (path: Iterable<unknown> | null | undefined) => path is null | undefined;
-export declare abstract class Collection extends NodeBase {
- schema: Schema | undefined;
- [NODE_TYPE]: symbol;
- items: unknown[];
- /** An optional anchor on this node. Used by alias nodes. */
- anchor?: string;
- /**
- * If true, stringify this and all child nodes using flow rather than
- * block styles.
- */
- flow?: boolean;
- constructor(type: symbol, schema?: Schema);
- /**
- * Create a copy of this collection.
- *
- * @param schema - If defined, overwrites the original's schema
- */
- clone(schema?: Schema): Collection;
- /** Adds a value to the collection. */
- abstract add(value: unknown): void;
- /**
- * Removes a value from the collection.
- * @returns `true` if the item was found and removed.
- */
- abstract delete(key: unknown): boolean;
- /**
- * Returns item at `key`, or `undefined` if not found. By default unwraps
- * scalar values from their surrounding node; to disable set `keepScalar` to
- * `true` (collections are always returned intact).
- */
- abstract get(key: unknown, keepScalar?: boolean): unknown;
- /**
- * Checks if the collection includes a value with the key `key`.
- */
- abstract has(key: unknown): boolean;
- /**
- * Sets a value in this collection. For `!!set`, `value` needs to be a
- * boolean to add/remove the item from the set.
- */
- abstract set(key: unknown, value: unknown): void;
- /**
- * Adds a value to the collection. For `!!map` and `!!omap` the value must
- * be a Pair instance or a `{ key, value }` object, which may not have a key
- * that already exists in the map.
- */
- addIn(path: Iterable<unknown>, value: unknown): void;
- /**
- * Removes a value from the collection.
- * @returns `true` if the item was found and removed.
- */
- deleteIn(path: Iterable<unknown>): boolean;
- /**
- * Returns item at `key`, or `undefined` if not found. By default unwraps
- * scalar values from their surrounding node; to disable set `keepScalar` to
- * `true` (collections are always returned intact).
- */
- getIn(path: Iterable<unknown>, keepScalar?: boolean): unknown;
- hasAllNullValues(allowScalar?: boolean): boolean;
- /**
- * Checks if the collection includes a value with the key `key`.
- */
- hasIn(path: Iterable<unknown>): boolean;
- /**
- * Sets a value in this collection. For `!!set`, `value` needs to be a
- * boolean to add/remove the item from the set.
- */
- setIn(path: Iterable<unknown>, value: unknown): void;
-}
diff --git a/node_modules/yaml/dist/nodes/Collection.js b/node_modules/yaml/dist/nodes/Collection.js
deleted file mode 100644
index bdf8cb4f..00000000
--- a/node_modules/yaml/dist/nodes/Collection.js
+++ /dev/null
@@ -1,151 +0,0 @@
-'use strict';
-
-var createNode = require('../doc/createNode.js');
-var identity = require('./identity.js');
-var Node = require('./Node.js');
-
-function collectionFromPath(schema, path, value) {
- let v = value;
- for (let i = path.length - 1; i >= 0; --i) {
- const k = path[i];
- if (typeof k === 'number' && Number.isInteger(k) && k >= 0) {
- const a = [];
- a[k] = v;
- v = a;
- }
- else {
- v = new Map([[k, v]]);
- }
- }
- return createNode.createNode(v, undefined, {
- aliasDuplicateObjects: false,
- keepUndefined: false,
- onAnchor: () => {
- throw new Error('This should not happen, please report a bug.');
- },
- schema,
- sourceObjects: new Map()
- });
-}
-// Type guard is intentionally a little wrong so as to be more useful,
-// as it does not cover untypable empty non-string iterables (e.g. []).
-const isEmptyPath = (path) => path == null ||
- (typeof path === 'object' && !!path[Symbol.iterator]().next().done);
-class Collection extends Node.NodeBase {
- constructor(type, schema) {
- super(type);
- Object.defineProperty(this, 'schema', {
- value: schema,
- configurable: true,
- enumerable: false,
- writable: true
- });
- }
- /**
- * Create a copy of this collection.
- *
- * @param schema - If defined, overwrites the original's schema
- */
- clone(schema) {
- const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
- if (schema)
- copy.schema = schema;
- copy.items = copy.items.map(it => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);
- if (this.range)
- copy.range = this.range.slice();
- return copy;
- }
- /**
- * Adds a value to the collection. For `!!map` and `!!omap` the value must
- * be a Pair instance or a `{ key, value }` object, which may not have a key
- * that already exists in the map.
- */
- addIn(path, value) {
- if (isEmptyPath(path))
- this.add(value);
- else {
- const [key, ...rest] = path;
- const node = this.get(key, true);
- if (identity.isCollection(node))
- node.addIn(rest, value);
- else if (node === undefined && this.schema)
- this.set(key, collectionFromPath(this.schema, rest, value));
- else
- throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
- }
- }
- /**
- * Removes a value from the collection.
- * @returns `true` if the item was found and removed.
- */
- deleteIn(path) {
- const [key, ...rest] = path;
- if (rest.length === 0)
- return this.delete(key);
- const node = this.get(key, true);
- if (identity.isCollection(node))
- return node.deleteIn(rest);
- else
- throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
- }
- /**
- * Returns item at `key`, or `undefined` if not found. By default unwraps
- * scalar values from their surrounding node; to disable set `keepScalar` to
- * `true` (collections are always returned intact).
- */
- getIn(path, keepScalar) {
- const [key, ...rest] = path;
- const node = this.get(key, true);
- if (rest.length === 0)
- return !keepScalar && identity.isScalar(node) ? node.value : node;
- else
- return identity.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
- }
- hasAllNullValues(allowScalar) {
- return this.items.every(node => {
- if (!identity.isPair(node))
- return false;
- const n = node.value;
- return (n == null ||
- (allowScalar &&
- identity.isScalar(n) &&
- n.value == null &&
- !n.commentBefore &&
- !n.comment &&
- !n.tag));
- });
- }
- /**
- * Checks if the collection includes a value with the key `key`.
- */
- hasIn(path) {
- const [key, ...rest] = path;
- if (rest.length === 0)
- return this.has(key);
- const node = this.get(key, true);
- return identity.isCollection(node) ? node.hasIn(rest) : false;
- }
- /**
- * Sets a value in this collection. For `!!set`, `value` needs to be a
- * boolean to add/remove the item from the set.
- */
- setIn(path, value) {
- const [key, ...rest] = path;
- if (rest.length === 0) {
- this.set(key, value);
- }
- else {
- const node = this.get(key, true);
- if (identity.isCollection(node))
- node.setIn(rest, value);
- else if (node === undefined && this.schema)
- this.set(key, collectionFromPath(this.schema, rest, value));
- else
- throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
- }
- }
-}
-
-exports.Collection = Collection;
-exports.collectionFromPath = collectionFromPath;
-exports.isEmptyPath = isEmptyPath;
diff --git a/node_modules/yaml/dist/nodes/Node.d.ts b/node_modules/yaml/dist/nodes/Node.d.ts
deleted file mode 100644
index fe91ba6b..00000000
--- a/node_modules/yaml/dist/nodes/Node.d.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import type { Document } from '../doc/Document.js';
-import type { ToJSOptions } from '../options.js';
-import { Token } from '../parse/cst.js';
-import type { StringifyContext } from '../stringify/stringify.js';
-import type { Alias } from './Alias.js';
-import { NODE_TYPE } from './identity.js';
-import type { Scalar } from './Scalar.js';
-import type { YAMLMap } from './YAMLMap.js';
-import type { YAMLSeq } from './YAMLSeq.js';
-export type Node<T = unknown> = Alias | Scalar<T> | YAMLMap<unknown, T> | YAMLSeq<T>;
-/** Utility type mapper */
-export type NodeType<T> = T extends string | number | bigint | boolean | null | undefined ? Scalar<T> : T extends Date ? Scalar<string | Date> : T extends Array<any> ? YAMLSeq<NodeType<T[number]>> : T extends {
- [key: string]: any;
-} ? YAMLMap<NodeType<keyof T>, NodeType<T[keyof T]>> : T extends {
- [key: number]: any;
-} ? YAMLMap<NodeType<keyof T>, NodeType<T[keyof T]>> : Node;
-export type ParsedNode = Alias.Parsed | Scalar.Parsed | YAMLMap.Parsed | YAMLSeq.Parsed;
-export type Range = [number, number, number];
-export declare abstract class NodeBase {
- readonly [NODE_TYPE]: symbol;
- /** A comment on or immediately after this */
- comment?: string | null;
- /** A comment before this */
- commentBefore?: string | null;
- /**
- * The `[start, value-end, node-end]` character offsets for the part of the
- * source parsed into this node (undefined if not parsed). The `value-end`
- * and `node-end` positions are themselves not included in their respective
- * ranges.
- */
- range?: Range | null;
- /** A blank line before this node and its commentBefore */
- spaceBefore?: boolean;
- /** The CST token that was composed into this node. */
- srcToken?: Token;
- /** A fully qualified tag, if required */
- tag?: string;
- /** A plain JS representation of this node */
- abstract toJSON(): any;
- abstract toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
- constructor(type: symbol);
- /** Create a copy of this node. */
- clone(): NodeBase;
- /** A plain JavaScript representation of this node. */
- toJS(doc: Document<Node, boolean>, { mapAsMap, maxAliasCount, onAnchor, reviver }?: ToJSOptions): any;
-}
diff --git a/node_modules/yaml/dist/nodes/Node.js b/node_modules/yaml/dist/nodes/Node.js
deleted file mode 100644
index d384e1cd..00000000
--- a/node_modules/yaml/dist/nodes/Node.js
+++ /dev/null
@@ -1,40 +0,0 @@
-'use strict';
-
-var applyReviver = require('../doc/applyReviver.js');
-var identity = require('./identity.js');
-var toJS = require('./toJS.js');
-
-class NodeBase {
- constructor(type) {
- Object.defineProperty(this, identity.NODE_TYPE, { value: type });
- }
- /** Create a copy of this node. */
- clone() {
- const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
- if (this.range)
- copy.range = this.range.slice();
- return copy;
- }
- /** A plain JavaScript representation of this node. */
- toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
- if (!identity.isDocument(doc))
- throw new TypeError('A document argument is required');
- const ctx = {
- anchors: new Map(),
- doc,
- keep: true,
- mapAsMap: mapAsMap === true,
- mapKeyWarned: false,
- maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
- };
- const res = toJS.toJS(this, '', ctx);
- if (typeof onAnchor === 'function')
- for (const { count, res } of ctx.anchors.values())
- onAnchor(res, count);
- return typeof reviver === 'function'
- ? applyReviver.applyReviver(reviver, { '': res }, '', res)
- : res;
- }
-}
-
-exports.NodeBase = NodeBase;
diff --git a/node_modules/yaml/dist/nodes/Pair.d.ts b/node_modules/yaml/dist/nodes/Pair.d.ts
deleted file mode 100644
index 6178d3a3..00000000
--- a/node_modules/yaml/dist/nodes/Pair.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { CreateNodeContext } from '../doc/createNode.js';
-import type { CollectionItem } from '../parse/cst.js';
-import type { Schema } from '../schema/Schema.js';
-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("./Node.js").Node, import("./Alias.js").Alias | import("./Scalar.js").Scalar<unknown> | import("./YAMLMap.js").YAMLMap<unknown, unknown> | import("./YAMLSeq.js").YAMLSeq<unknown>>;
-export declare class Pair<K = unknown, V = unknown> {
- readonly [NODE_TYPE]: symbol;
- /** Always Node or null when parsed, but can be set to anything. */
- key: K;
- /** Always Node or null when parsed, but can be set to anything. */
- value: V | null;
- /** The CST token that was composed into this pair. */
- srcToken?: CollectionItem;
- constructor(key: K, value?: V | null);
- clone(schema?: Schema): Pair<K, V>;
- toJSON(_?: unknown, ctx?: ToJSContext): ReturnType<typeof addPairToJSMap>;
- toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
-}
diff --git a/node_modules/yaml/dist/nodes/Pair.js b/node_modules/yaml/dist/nodes/Pair.js
deleted file mode 100644
index ae4c7727..00000000
--- a/node_modules/yaml/dist/nodes/Pair.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-var createNode = require('../doc/createNode.js');
-var stringifyPair = require('../stringify/stringifyPair.js');
-var addPairToJSMap = require('./addPairToJSMap.js');
-var identity = require('./identity.js');
-
-function createPair(key, value, ctx) {
- const k = createNode.createNode(key, undefined, ctx);
- const v = createNode.createNode(value, undefined, ctx);
- return new Pair(k, v);
-}
-class Pair {
- constructor(key, value = null) {
- Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });
- this.key = key;
- this.value = value;
- }
- clone(schema) {
- let { key, value } = this;
- if (identity.isNode(key))
- key = key.clone(schema);
- if (identity.isNode(value))
- value = value.clone(schema);
- return new Pair(key, value);
- }
- toJSON(_, ctx) {
- const pair = ctx?.mapAsMap ? new Map() : {};
- return addPairToJSMap.addPairToJSMap(ctx, pair, this);
- }
- toString(ctx, onComment, onChompKeep) {
- return ctx?.doc
- ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep)
- : JSON.stringify(this);
- }
-}
-
-exports.Pair = Pair;
-exports.createPair = createPair;
diff --git a/node_modules/yaml/dist/nodes/Scalar.d.ts b/node_modules/yaml/dist/nodes/Scalar.d.ts
deleted file mode 100644
index dd330b2b..00000000
--- a/node_modules/yaml/dist/nodes/Scalar.d.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import type { BlockScalar, FlowScalar } from '../parse/cst.js';
-import { NodeBase, Range } from './Node.js';
-import { ToJSContext } from './toJS.js';
-export declare const isScalarValue: (value: unknown) => boolean;
-export declare namespace Scalar {
- interface Parsed extends Scalar {
- range: Range;
- source: string;
- srcToken?: FlowScalar | BlockScalar;
- }
- type BLOCK_FOLDED = 'BLOCK_FOLDED';
- type BLOCK_LITERAL = 'BLOCK_LITERAL';
- type PLAIN = 'PLAIN';
- type QUOTE_DOUBLE = 'QUOTE_DOUBLE';
- type QUOTE_SINGLE = 'QUOTE_SINGLE';
- type Type = BLOCK_FOLDED | BLOCK_LITERAL | PLAIN | QUOTE_DOUBLE | QUOTE_SINGLE;
-}
-export declare class Scalar<T = unknown> extends NodeBase {
- static readonly BLOCK_FOLDED = "BLOCK_FOLDED";
- static readonly BLOCK_LITERAL = "BLOCK_LITERAL";
- static readonly PLAIN = "PLAIN";
- static readonly QUOTE_DOUBLE = "QUOTE_DOUBLE";
- static readonly QUOTE_SINGLE = "QUOTE_SINGLE";
- value: T;
- /** An optional anchor on this node. Used by alias nodes. */
- anchor?: string;
- /**
- * By default (undefined), numbers use decimal notation.
- * The YAML 1.2 core schema only supports 'HEX' and 'OCT'.
- * The YAML 1.1 schema also supports 'BIN' and 'TIME'
- */
- format?: string;
- /** If `value` is a number, use this value when stringifying this node. */
- minFractionDigits?: number;
- /** Set during parsing to the source string value */
- source?: string;
- /** The scalar style used for the node's string representation */
- type?: Scalar.Type;
- constructor(value: T);
- toJSON(arg?: any, ctx?: ToJSContext): any;
- toString(): string;
-}
diff --git a/node_modules/yaml/dist/nodes/Scalar.js b/node_modules/yaml/dist/nodes/Scalar.js
deleted file mode 100644
index bd7d4d22..00000000
--- a/node_modules/yaml/dist/nodes/Scalar.js
+++ /dev/null
@@ -1,27 +0,0 @@
-'use strict';
-
-var identity = require('./identity.js');
-var Node = require('./Node.js');
-var toJS = require('./toJS.js');
-
-const isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');
-class Scalar extends Node.NodeBase {
- constructor(value) {
- super(identity.SCALAR);
- this.value = value;
- }
- toJSON(arg, ctx) {
- return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx);
- }
- toString() {
- return String(this.value);
- }
-}
-Scalar.BLOCK_FOLDED = 'BLOCK_FOLDED';
-Scalar.BLOCK_LITERAL = 'BLOCK_LITERAL';
-Scalar.PLAIN = 'PLAIN';
-Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
-Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
-
-exports.Scalar = Scalar;
-exports.isScalarValue = isScalarValue;
diff --git a/node_modules/yaml/dist/nodes/YAMLMap.d.ts b/node_modules/yaml/dist/nodes/YAMLMap.d.ts
deleted file mode 100644
index cef75f05..00000000
--- a/node_modules/yaml/dist/nodes/YAMLMap.d.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { BlockMap, FlowCollection } from '../parse/cst.js';
-import type { Schema } from '../schema/Schema.js';
-import type { StringifyContext } from '../stringify/stringify.js';
-import { CreateNodeContext } from '../util.js';
-import { Collection } from './Collection.js';
-import type { ParsedNode, Range } from './Node.js';
-import { Pair } from './Pair.js';
-import { Scalar } from './Scalar.js';
-import type { ToJSContext } from './toJS.js';
-export type MapLike = Map<unknown, unknown> | Set<unknown> | Record<string | number | symbol, unknown>;
-export declare function findPair<K = unknown, V = unknown>(items: Iterable<Pair<K, V>>, key: unknown): Pair<K, V> | undefined;
-export declare namespace YAMLMap {
- interface Parsed<K extends ParsedNode = ParsedNode, V extends ParsedNode | null = ParsedNode | null> extends YAMLMap<K, V> {
- items: Pair<K, V>[];
- range: Range;
- srcToken?: BlockMap | FlowCollection;
- }
-}
-export declare class YAMLMap<K = unknown, V = unknown> extends Collection {
- static get tagName(): 'tag:yaml.org,2002:map';
- items: Pair<K, V>[];
- constructor(schema?: Schema);
- /**
- * A generic collection parsing method that can be extended
- * to other node classes that inherit from YAMLMap
- */
- static from(schema: Schema, obj: unknown, ctx: CreateNodeContext): YAMLMap<unknown, unknown>;
- /**
- * Adds a value to the collection.
- *
- * @param overwrite - If not set `true`, using a key that is already in the
- * collection will throw. Otherwise, overwrites the previous value.
- */
- add(pair: Pair<K, V> | {
- key: K;
- value: V;
- }, overwrite?: boolean): void;
- delete(key: unknown): boolean;
- get(key: unknown, keepScalar: true): Scalar<V> | undefined;
- get(key: unknown, keepScalar?: false): V | undefined;
- get(key: unknown, keepScalar?: boolean): V | Scalar<V> | undefined;
- has(key: unknown): boolean;
- set(key: K, value: V): void;
- /**
- * @param ctx - Conversion context, originally set in Document#toJS()
- * @param {Class} Type - If set, forces the returned collection type
- * @returns Instance of Type, Map, or Object
- */
- toJSON<T extends MapLike = Map<unknown, unknown>>(_?: unknown, ctx?: ToJSContext, Type?: {
- new (): T;
- }): any;
- toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
-}
diff --git a/node_modules/yaml/dist/nodes/YAMLMap.js b/node_modules/yaml/dist/nodes/YAMLMap.js
deleted file mode 100644
index 210abbfc..00000000
--- a/node_modules/yaml/dist/nodes/YAMLMap.js
+++ /dev/null
@@ -1,147 +0,0 @@
-'use strict';
-
-var stringifyCollection = require('../stringify/stringifyCollection.js');
-var addPairToJSMap = require('./addPairToJSMap.js');
-var Collection = require('./Collection.js');
-var identity = require('./identity.js');
-var Pair = require('./Pair.js');
-var Scalar = require('./Scalar.js');
-
-function findPair(items, key) {
- const k = identity.isScalar(key) ? key.value : key;
- for (const it of items) {
- if (identity.isPair(it)) {
- if (it.key === key || it.key === k)
- return it;
- if (identity.isScalar(it.key) && it.key.value === k)
- return it;
- }
- }
- return undefined;
-}
-class YAMLMap extends Collection.Collection {
- static get tagName() {
- return 'tag:yaml.org,2002:map';
- }
- constructor(schema) {
- super(identity.MAP, schema);
- this.items = [];
- }
- /**
- * A generic collection parsing method that can be extended
- * to other node classes that inherit from YAMLMap
- */
- static from(schema, obj, ctx) {
- const { keepUndefined, replacer } = ctx;
- const map = new this(schema);
- const add = (key, value) => {
- if (typeof replacer === 'function')
- value = replacer.call(obj, key, value);
- else if (Array.isArray(replacer) && !replacer.includes(key))
- return;
- if (value !== undefined || keepUndefined)
- map.items.push(Pair.createPair(key, value, ctx));
- };
- if (obj instanceof Map) {
- for (const [key, value] of obj)
- add(key, value);
- }
- else if (obj && typeof obj === 'object') {
- for (const key of Object.keys(obj))
- add(key, obj[key]);
- }
- if (typeof schema.sortMapEntries === 'function') {
- map.items.sort(schema.sortMapEntries);
- }
- return map;
- }
- /**
- * Adds a value to the collection.
- *
- * @param overwrite - If not set `true`, using a key that is already in the
- * collection will throw. Otherwise, overwrites the previous value.
- */
- add(pair, overwrite) {
- let _pair;
- if (identity.isPair(pair))
- _pair = pair;
- else if (!pair || typeof pair !== 'object' || !('key' in pair)) {
- // In TypeScript, this never happens.
- _pair = new Pair.Pair(pair, pair?.value);
- }
- else
- _pair = new Pair.Pair(pair.key, pair.value);
- const prev = findPair(this.items, _pair.key);
- const sortEntries = this.schema?.sortMapEntries;
- if (prev) {
- if (!overwrite)
- throw new Error(`Key ${_pair.key} already set`);
- // For scalars, keep the old node & its comments and anchors
- if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))
- prev.value.value = _pair.value;
- else
- prev.value = _pair.value;
- }
- else if (sortEntries) {
- const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);
- if (i === -1)
- this.items.push(_pair);
- else
- this.items.splice(i, 0, _pair);
- }
- else {
- this.items.push(_pair);
- }
- }
- delete(key) {
- const it = findPair(this.items, key);
- if (!it)
- return false;
- const del = this.items.splice(this.items.indexOf(it), 1);
- return del.length > 0;
- }
- get(key, keepScalar) {
- const it = findPair(this.items, key);
- const node = it?.value;
- return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? undefined;
- }
- has(key) {
- return !!findPair(this.items, key);
- }
- set(key, value) {
- this.add(new Pair.Pair(key, value), true);
- }
- /**
- * @param ctx - Conversion context, originally set in Document#toJS()
- * @param {Class} Type - If set, forces the returned collection type
- * @returns Instance of Type, Map, or Object
- */
- toJSON(_, ctx, Type) {
- const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {};
- if (ctx?.onCreate)
- ctx.onCreate(map);
- for (const item of this.items)
- addPairToJSMap.addPairToJSMap(ctx, map, item);
- return map;
- }
- toString(ctx, onComment, onChompKeep) {
- if (!ctx)
- return JSON.stringify(this);
- for (const item of this.items) {
- if (!identity.isPair(item))
- throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
- }
- if (!ctx.allNullValues && this.hasAllNullValues(false))
- ctx = Object.assign({}, ctx, { allNullValues: true });
- return stringifyCollection.stringifyCollection(this, ctx, {
- blockItemPrefix: '',
- flowChars: { start: '{', end: '}' },
- itemIndent: ctx.indent || '',
- onChompKeep,
- onComment
- });
- }
-}
-
-exports.YAMLMap = YAMLMap;
-exports.findPair = findPair;
diff --git a/node_modules/yaml/dist/nodes/YAMLSeq.d.ts b/node_modules/yaml/dist/nodes/YAMLSeq.d.ts
deleted file mode 100644
index 47fe24d0..00000000
--- a/node_modules/yaml/dist/nodes/YAMLSeq.d.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { CreateNodeContext } from '../doc/createNode.js';
-import type { BlockSequence, FlowCollection } from '../parse/cst.js';
-import type { Schema } from '../schema/Schema.js';
-import type { StringifyContext } from '../stringify/stringify.js';
-import { Collection } from './Collection.js';
-import type { ParsedNode, Range } from './Node.js';
-import type { Pair } from './Pair.js';
-import { Scalar } from './Scalar.js';
-import { ToJSContext } from './toJS.js';
-export declare namespace YAMLSeq {
- interface Parsed<T extends ParsedNode | Pair<ParsedNode, ParsedNode | null> = ParsedNode> extends YAMLSeq<T> {
- items: T[];
- range: Range;
- srcToken?: BlockSequence | FlowCollection;
- }
-}
-export declare class YAMLSeq<T = unknown> extends Collection {
- static get tagName(): 'tag:yaml.org,2002:seq';
- items: T[];
- constructor(schema?: Schema);
- add(value: T): void;
- /**
- * Removes a value from the collection.
- *
- * `key` must contain a representation of an integer for this to succeed.
- * It may be wrapped in a `Scalar`.
- *
- * @returns `true` if the item was found and removed.
- */
- delete(key: unknown): boolean;
- /**
- * Returns item at `key`, or `undefined` if not found. By default unwraps
- * scalar values from their surrounding node; to disable set `keepScalar` to
- * `true` (collections are always returned intact).
- *
- * `key` must contain a representation of an integer for this to succeed.
- * It may be wrapped in a `Scalar`.
- */
- get(key: unknown, keepScalar: true): Scalar<T> | undefined;
- get(key: unknown, keepScalar?: false): T | undefined;
- get(key: unknown, keepScalar?: boolean): T | Scalar<T> | undefined;
- /**
- * Checks if the collection includes a value with the key `key`.
- *
- * `key` must contain a representation of an integer for this to succeed.
- * It may be wrapped in a `Scalar`.
- */
- has(key: unknown): boolean;
- /**
- * Sets a value in this collection. For `!!set`, `value` needs to be a
- * boolean to add/remove the item from the set.
- *
- * If `key` does not contain a representation of an integer, this will throw.
- * It may be wrapped in a `Scalar`.
- */
- set(key: unknown, value: T): void;
- toJSON(_?: unknown, ctx?: ToJSContext): unknown[];
- toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
- static from(schema: Schema, obj: unknown, ctx: CreateNodeContext): YAMLSeq<unknown>;
-}
diff --git a/node_modules/yaml/dist/nodes/YAMLSeq.js b/node_modules/yaml/dist/nodes/YAMLSeq.js
deleted file mode 100644
index a2af086d..00000000
--- a/node_modules/yaml/dist/nodes/YAMLSeq.js
+++ /dev/null
@@ -1,115 +0,0 @@
-'use strict';
-
-var createNode = require('../doc/createNode.js');
-var stringifyCollection = require('../stringify/stringifyCollection.js');
-var Collection = require('./Collection.js');
-var identity = require('./identity.js');
-var Scalar = require('./Scalar.js');
-var toJS = require('./toJS.js');
-
-class YAMLSeq extends Collection.Collection {
- static get tagName() {
- return 'tag:yaml.org,2002:seq';
- }
- constructor(schema) {
- super(identity.SEQ, schema);
- this.items = [];
- }
- add(value) {
- this.items.push(value);
- }
- /**
- * Removes a value from the collection.
- *
- * `key` must contain a representation of an integer for this to succeed.
- * It may be wrapped in a `Scalar`.
- *
- * @returns `true` if the item was found and removed.
- */
- delete(key) {
- const idx = asItemIndex(key);
- if (typeof idx !== 'number')
- return false;
- const del = this.items.splice(idx, 1);
- return del.length > 0;
- }
- get(key, keepScalar) {
- const idx = asItemIndex(key);
- if (typeof idx !== 'number')
- return undefined;
- const it = this.items[idx];
- return !keepScalar && identity.isScalar(it) ? it.value : it;
- }
- /**
- * Checks if the collection includes a value with the key `key`.
- *
- * `key` must contain a representation of an integer for this to succeed.
- * It may be wrapped in a `Scalar`.
- */
- has(key) {
- const idx = asItemIndex(key);
- return typeof idx === 'number' && idx < this.items.length;
- }
- /**
- * Sets a value in this collection. For `!!set`, `value` needs to be a
- * boolean to add/remove the item from the set.
- *
- * If `key` does not contain a representation of an integer, this will throw.
- * It may be wrapped in a `Scalar`.
- */
- set(key, value) {
- const idx = asItemIndex(key);
- if (typeof idx !== 'number')
- throw new Error(`Expected a valid index, not ${key}.`);
- const prev = this.items[idx];
- if (identity.isScalar(prev) && Scalar.isScalarValue(value))
- prev.value = value;
- else
- this.items[idx] = value;
- }
- toJSON(_, ctx) {
- const seq = [];
- if (ctx?.onCreate)
- ctx.onCreate(seq);
- let i = 0;
- for (const item of this.items)
- seq.push(toJS.toJS(item, String(i++), ctx));
- return seq;
- }
- toString(ctx, onComment, onChompKeep) {
- if (!ctx)
- return JSON.stringify(this);
- return stringifyCollection.stringifyCollection(this, ctx, {
- blockItemPrefix: '- ',
- flowChars: { start: '[', end: ']' },
- itemIndent: (ctx.indent || '') + ' ',
- onChompKeep,
- onComment
- });
- }
- static from(schema, obj, ctx) {
- const { replacer } = ctx;
- const seq = new this(schema);
- if (obj && Symbol.iterator in Object(obj)) {
- let i = 0;
- for (let it of obj) {
- if (typeof replacer === 'function') {
- const key = obj instanceof Set ? it : String(i++);
- it = replacer.call(obj, key, it);
- }
- seq.items.push(createNode.createNode(it, undefined, ctx));
- }
- }
- return seq;
- }
-}
-function asItemIndex(key) {
- let idx = identity.isScalar(key) ? key.value : key;
- if (idx && typeof idx === 'string')
- idx = Number(idx);
- return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0
- ? idx
- : null;
-}
-
-exports.YAMLSeq = YAMLSeq;
diff --git a/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts b/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts
deleted file mode 100644
index 70d9e626..00000000
--- a/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import type { Pair } from './Pair.js';
-import { ToJSContext } from './toJS.js';
-import type { MapLike } from './YAMLMap.js';
-export declare function addPairToJSMap(ctx: ToJSContext | undefined, map: MapLike, { key, value }: Pair): MapLike;
diff --git a/node_modules/yaml/dist/nodes/addPairToJSMap.js b/node_modules/yaml/dist/nodes/addPairToJSMap.js
deleted file mode 100644
index 30f6f954..00000000
--- a/node_modules/yaml/dist/nodes/addPairToJSMap.js
+++ /dev/null
@@ -1,106 +0,0 @@
-'use strict';
-
-var log = require('../log.js');
-var stringify = require('../stringify/stringify.js');
-var identity = require('./identity.js');
-var Scalar = require('./Scalar.js');
-var toJS = require('./toJS.js');
-
-const MERGE_KEY = '<<';
-function addPairToJSMap(ctx, map, { key, value }) {
- if (ctx?.doc.schema.merge && isMergeKey(key)) {
- value = identity.isAlias(value) ? value.resolve(ctx.doc) : value;
- if (identity.isSeq(value))
- for (const it of value.items)
- mergeToJSMap(ctx, map, it);
- else if (Array.isArray(value))
- for (const it of value)
- mergeToJSMap(ctx, map, it);
- else
- mergeToJSMap(ctx, map, value);
- }
- else {
- const jsKey = toJS.toJS(key, '', ctx);
- if (map instanceof Map) {
- map.set(jsKey, toJS.toJS(value, jsKey, ctx));
- }
- else if (map instanceof Set) {
- map.add(jsKey);
- }
- else {
- const stringKey = stringifyKey(key, jsKey, ctx);
- const jsValue = toJS.toJS(value, stringKey, ctx);
- if (stringKey in map)
- Object.defineProperty(map, stringKey, {
- value: jsValue,
- writable: true,
- enumerable: true,
- configurable: true
- });
- else
- map[stringKey] = jsValue;
- }
- }
- return map;
-}
-const isMergeKey = (key) => key === MERGE_KEY ||
- (identity.isScalar(key) &&
- key.value === MERGE_KEY &&
- (!key.type || key.type === Scalar.Scalar.PLAIN));
-// If the value associated with a merge key is a single mapping node, each of
-// its key/value pairs is inserted into the current mapping, unless the key
-// already exists in it. If the value associated with the merge key is a
-// sequence, then this sequence is expected to contain mapping nodes and each
-// of these nodes is merged in turn according to its order in the sequence.
-// Keys in mapping nodes earlier in the sequence override keys specified in
-// later mapping nodes. -- http://yaml.org/type/merge.html
-function mergeToJSMap(ctx, map, value) {
- const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
- if (!identity.isMap(source))
- throw new Error('Merge sources must be maps or map aliases');
- const srcMap = source.toJSON(null, ctx, Map);
- for (const [key, value] of srcMap) {
- if (map instanceof Map) {
- if (!map.has(key))
- map.set(key, value);
- }
- else if (map instanceof Set) {
- map.add(key);
- }
- else if (!Object.prototype.hasOwnProperty.call(map, key)) {
- Object.defineProperty(map, key, {
- value,
- writable: true,
- enumerable: true,
- configurable: true
- });
- }
- }
- return map;
-}
-function stringifyKey(key, jsKey, ctx) {
- if (jsKey === null)
- return '';
- if (typeof jsKey !== 'object')
- return String(jsKey);
- if (identity.isNode(key) && ctx?.doc) {
- const strCtx = stringify.createStringifyContext(ctx.doc, {});
- strCtx.anchors = new Set();
- for (const node of ctx.anchors.keys())
- strCtx.anchors.add(node.anchor);
- strCtx.inFlow = true;
- strCtx.inStringifyKey = true;
- const strKey = key.toString(strCtx);
- if (!ctx.mapKeyWarned) {
- let jsonStr = JSON.stringify(strKey);
- if (jsonStr.length > 40)
- jsonStr = jsonStr.substring(0, 36) + '..."';
- log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
- ctx.mapKeyWarned = true;
- }
- return strKey;
- }
- return JSON.stringify(jsKey);
-}
-
-exports.addPairToJSMap = addPairToJSMap;
diff --git a/node_modules/yaml/dist/nodes/identity.d.ts b/node_modules/yaml/dist/nodes/identity.d.ts
deleted file mode 100644
index a576b1a6..00000000
--- a/node_modules/yaml/dist/nodes/identity.d.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import type { Document } from '../doc/Document.js';
-import type { Alias } from './Alias.js';
-import type { Node } from './Node.js';
-import type { Pair } from './Pair.js';
-import type { Scalar } from './Scalar.js';
-import type { YAMLMap } from './YAMLMap.js';
-import type { YAMLSeq } from './YAMLSeq.js';
-export declare const ALIAS: unique symbol;
-export declare const DOC: unique symbol;
-export declare const MAP: unique symbol;
-export declare const PAIR: unique symbol;
-export declare const SCALAR: unique symbol;
-export declare const SEQ: unique symbol;
-export declare const NODE_TYPE: unique symbol;
-export declare const isAlias: (node: any) => node is Alias;
-export declare const isDocument: <T extends Node = Node>(node: any) => node is Document<T>;
-export declare const isMap: <K = unknown, V = unknown>(node: any) => node is YAMLMap<K, V>;
-export declare const isPair: <K = unknown, V = unknown>(node: any) => node is Pair<K, V>;
-export declare const isScalar: <T = unknown>(node: any) => node is Scalar<T>;
-export declare const isSeq: <T = unknown>(node: any) => node is YAMLSeq<T>;
-export declare function isCollection<K = unknown, V = unknown>(node: any): node is YAMLMap<K, V> | YAMLSeq<V>;
-export declare function isNode<T = unknown>(node: any): node is Node<T>;
-export declare const hasAnchor: <K = unknown, V = unknown>(node: unknown) => node is Scalar<V> | YAMLMap<K, V> | YAMLSeq<V>;
diff --git a/node_modules/yaml/dist/nodes/identity.js b/node_modules/yaml/dist/nodes/identity.js
deleted file mode 100644
index 5794aa3f..00000000
--- a/node_modules/yaml/dist/nodes/identity.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-const ALIAS = Symbol.for('yaml.alias');
-const DOC = Symbol.for('yaml.document');
-const MAP = Symbol.for('yaml.map');
-const PAIR = Symbol.for('yaml.pair');
-const SCALAR = Symbol.for('yaml.scalar');
-const SEQ = Symbol.for('yaml.seq');
-const NODE_TYPE = Symbol.for('yaml.node.type');
-const isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;
-const isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;
-const isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;
-const isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;
-const isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR;
-const isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;
-function isCollection(node) {
- if (node && typeof node === 'object')
- switch (node[NODE_TYPE]) {
- case MAP:
- case SEQ:
- return true;
- }
- return false;
-}
-function isNode(node) {
- if (node && typeof node === 'object')
- switch (node[NODE_TYPE]) {
- case ALIAS:
- case MAP:
- case SCALAR:
- case SEQ:
- return true;
- }
- return false;
-}
-const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
-
-exports.ALIAS = ALIAS;
-exports.DOC = DOC;
-exports.MAP = MAP;
-exports.NODE_TYPE = NODE_TYPE;
-exports.PAIR = PAIR;
-exports.SCALAR = SCALAR;
-exports.SEQ = SEQ;
-exports.hasAnchor = hasAnchor;
-exports.isAlias = isAlias;
-exports.isCollection = isCollection;
-exports.isDocument = isDocument;
-exports.isMap = isMap;
-exports.isNode = isNode;
-exports.isPair = isPair;
-exports.isScalar = isScalar;
-exports.isSeq = isSeq;
diff --git a/node_modules/yaml/dist/nodes/toJS.d.ts b/node_modules/yaml/dist/nodes/toJS.d.ts
deleted file mode 100644
index dcd06423..00000000
--- a/node_modules/yaml/dist/nodes/toJS.d.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import type { Document } from '../doc/Document.js';
-import type { Node } from './Node.js';
-export interface AnchorData {
- aliasCount: number;
- count: number;
- res: unknown;
-}
-export interface ToJSContext {
- anchors: Map<Node, AnchorData>;
- doc: Document<Node, boolean>;
- keep: boolean;
- mapAsMap: boolean;
- mapKeyWarned: boolean;
- maxAliasCount: number;
- onCreate?: (res: unknown) => void;
-}
-/**
- * Recursively convert any node or its contents to native JavaScript
- *
- * @param value - The input value
- * @param arg - If `value` defines a `toJSON()` method, use this
- * as its first argument
- * @param ctx - Conversion context, originally set in Document#toJS(). If
- * `{ keep: true }` is not set, output should be suitable for JSON
- * stringification.
- */
-export declare function toJS(value: any, arg: string | null, ctx?: ToJSContext): any;
diff --git a/node_modules/yaml/dist/nodes/toJS.js b/node_modules/yaml/dist/nodes/toJS.js
deleted file mode 100644
index a012823b..00000000
--- a/node_modules/yaml/dist/nodes/toJS.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-var identity = require('./identity.js');
-
-/**
- * Recursively convert any node or its contents to native JavaScript
- *
- * @param value - The input value
- * @param arg - If `value` defines a `toJSON()` method, use this
- * as its first argument
- * @param ctx - Conversion context, originally set in Document#toJS(). If
- * `{ keep: true }` is not set, output should be suitable for JSON
- * stringification.
- */
-function toJS(value, arg, ctx) {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
- if (Array.isArray(value))
- return value.map((v, i) => toJS(v, String(i), ctx));
- if (value && typeof value.toJSON === 'function') {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
- if (!ctx || !identity.hasAnchor(value))
- return value.toJSON(arg, ctx);
- const data = { aliasCount: 0, count: 1, res: undefined };
- ctx.anchors.set(value, data);
- ctx.onCreate = res => {
- data.res = res;
- delete ctx.onCreate;
- };
- const res = value.toJSON(arg, ctx);
- if (ctx.onCreate)
- ctx.onCreate(res);
- return res;
- }
- if (typeof value === 'bigint' && !ctx?.keep)
- return Number(value);
- return value;
-}
-
-exports.toJS = toJS;