node_modules: upgrade

This commit is contained in:
Dawid Dziurla
2025-06-14 23:18:18 +02:00
parent 948e4a4fb8
commit de40b1f21f
268 changed files with 2150 additions and 3858 deletions

View File

@@ -1,2 +1,2 @@
import type { ScalarTag } from '../types.js';
import type { ScalarTag } from '../types';
export declare const binary: ScalarTag;

View File

@@ -1,10 +1,11 @@
'use strict';
var node_buffer = require('buffer');
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',
/**
@@ -16,8 +17,8 @@ const binary = {
* document.querySelector('#photo').src = URL.createObjectURL(blob)
*/
resolve(src, onError) {
if (typeof Buffer === 'function') {
return Buffer.from(src, 'base64');
if (typeof node_buffer.Buffer === 'function') {
return node_buffer.Buffer.from(src, 'base64');
}
else if (typeof atob === 'function') {
// On IE 11, atob() can't handle newlines
@@ -33,13 +34,15 @@ const binary = {
}
},
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
if (!value)
return '';
const buf = value; // checked earlier by binary.identify()
let str;
if (typeof Buffer === 'function') {
if (typeof node_buffer.Buffer === 'function') {
str =
buf instanceof Buffer
buf instanceof node_buffer.Buffer
? buf.toString('base64')
: Buffer.from(buf.buffer).toString('base64');
: node_buffer.Buffer.from(buf.buffer).toString('base64');
}
else if (typeof btoa === 'function') {
let s = '';
@@ -50,8 +53,7 @@ const binary = {
else {
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
}
if (!type)
type = Scalar.Scalar.BLOCK_LITERAL;
type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
const n = Math.ceil(str.length / lineWidth);

View File

@@ -1,4 +1,4 @@
import type { ScalarTag } from '../types.js';
import type { ScalarTag } from '../types';
export declare const trueTag: ScalarTag & {
test: RegExp;
};

View File

@@ -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
};

View File

@@ -1,4 +1,4 @@
import type { ScalarTag } from '../types.js';
import type { ScalarTag } from '../types';
export declare const floatNaN: ScalarTag;
export declare const floatExp: ScalarTag;
export declare const float: ScalarTag;

View File

@@ -7,7 +7,7 @@ const floatNaN = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
resolve: (str) => str.slice(-3).toLowerCase() === 'nan'
? NaN
: str[0] === '-'

View File

@@ -1,4 +1,4 @@
import type { ScalarTag } from '../types.js';
import type { ScalarTag } from '../types';
export declare const intBin: ScalarTag;
export declare const intOct: ScalarTag;
export declare const int: ScalarTag;

9
node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type { ToJSContext } from '../../nodes/toJS';
import type { MapLike } from '../../nodes/YAMLMap';
import type { ScalarTag } from '../types';
export declare const merge: ScalarTag & {
identify(value: unknown): boolean;
test: RegExp;
};
export declare const isMergeKey: (ctx: ToJSContext | undefined, key: unknown) => boolean | undefined;
export declare function addMergeToJSMap(ctx: ToJSContext | undefined, map: MapLike, value: unknown): void;

68
node_modules/yaml/dist/schema/yaml-1.1/merge.js generated vendored Normal file
View File

@@ -0,0 +1,68 @@
'use strict';
var identity = require('../../nodes/identity.js');
var Scalar = require('../../nodes/Scalar.js');
// 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
const MERGE_KEY = '<<';
const merge = {
identify: value => value === MERGE_KEY ||
(typeof value === 'symbol' && value.description === MERGE_KEY),
default: 'key',
tag: 'tag:yaml.org,2002:merge',
test: /^<<$/,
resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
addToJSMap: addMergeToJSMap
}),
stringify: () => MERGE_KEY
};
const isMergeKey = (ctx, key) => (merge.identify(key) ||
(identity.isScalar(key) &&
(!key.type || key.type === Scalar.Scalar.PLAIN) &&
merge.identify(key.value))) &&
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
function addMergeToJSMap(ctx, map, value) {
value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
if (identity.isSeq(value))
for (const it of value.items)
mergeValue(ctx, map, it);
else if (Array.isArray(value))
for (const it of value)
mergeValue(ctx, map, it);
else
mergeValue(ctx, map, value);
}
function mergeValue(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;
}
exports.addMergeToJSMap = addMergeToJSMap;
exports.isMergeKey = isMergeKey;
exports.merge = merge;

View File

@@ -1,23 +1,17 @@
import { ToJSContext } from '../../nodes/toJS.js';
import { YAMLSeq } from '../../nodes/YAMLSeq.js';
import { CreateNodeContext } from '../../util.js';
import type { Schema } from '../Schema.js';
import { CollectionTag } from '../types.js';
import type { ToJSContext } from '../../nodes/toJS';
import { YAMLMap } from '../../nodes/YAMLMap';
import { YAMLSeq } from '../../nodes/YAMLSeq';
import type { CreateNodeContext } from '../../util';
import type { Schema } from '../Schema';
import type { CollectionTag } from '../types';
export declare class YAMLOMap extends YAMLSeq {
static tag: string;
constructor();
add: (pair: import("../../index.js").Pair<any, any> | {
key: any;
value: any;
}, overwrite?: boolean | undefined) => void;
delete: (key: unknown) => boolean;
get: {
(key: unknown, keepScalar: true): import("../../index.js").Scalar<any> | undefined;
(key: unknown, keepScalar?: false | undefined): any;
(key: unknown, keepScalar?: boolean | undefined): any;
};
has: (key: unknown) => boolean;
set: (key: any, value: any) => void;
add: typeof YAMLMap.prototype.add;
delete: typeof YAMLMap.prototype.delete;
get: typeof YAMLMap.prototype.get;
has: typeof YAMLMap.prototype.has;
set: typeof YAMLMap.prototype.set;
/**
* If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
* but TypeScript won't allow widening the signature of a child method.

View File

@@ -1,10 +1,10 @@
import type { CreateNodeContext } from '../../doc/createNode.js';
import type { ParsedNode } from '../../nodes/Node.js';
import { Pair } from '../../nodes/Pair.js';
import { YAMLMap } from '../../nodes/YAMLMap.js';
import { YAMLSeq } from '../../nodes/YAMLSeq.js';
import type { Schema } from '../../schema/Schema.js';
import type { CollectionTag } from '../types.js';
import type { CreateNodeContext } from '../../doc/createNode';
import type { ParsedNode } from '../../nodes/Node';
import { Pair } from '../../nodes/Pair';
import type { YAMLMap } from '../../nodes/YAMLMap';
import { YAMLSeq } from '../../nodes/YAMLSeq';
import type { Schema } from '../../schema/Schema';
import type { CollectionTag } from '../types';
export declare function resolvePairs(seq: YAMLSeq.Parsed<ParsedNode | Pair<ParsedNode, ParsedNode | null>> | YAMLMap.Parsed, onError: (message: string) => void): YAMLSeq.Parsed<Pair<ParsedNode, ParsedNode | null>>;
export declare function createPairs(schema: Schema, iterable: unknown, ctx: CreateNodeContext): YAMLSeq<unknown>;
export declare const pairs: CollectionTag;

View File

@@ -1 +1 @@
export declare const schema: (import("../types.js").CollectionTag | import("../types.js").ScalarTag)[];
export declare const schema: (import('../types').CollectionTag | import('../types').ScalarTag)[];

View File

@@ -8,6 +8,7 @@ var binary = require('./binary.js');
var bool = require('./bool.js');
var float = require('./float.js');
var int = require('./int.js');
var merge = require('./merge.js');
var omap = require('./omap.js');
var pairs = require('./pairs.js');
var set = require('./set.js');
@@ -28,6 +29,7 @@ const schema = [
float.floatExp,
float.float,
binary.binary,
merge.merge,
omap.omap,
pairs.pairs,
set.set,

View File

@@ -1,11 +1,11 @@
import { Pair } from '../../nodes/Pair.js';
import { Scalar } from '../../nodes/Scalar.js';
import { ToJSContext } from '../../nodes/toJS.js';
import { YAMLMap } from '../../nodes/YAMLMap.js';
import type { Schema } from '../../schema/Schema.js';
import type { StringifyContext } from '../../stringify/stringify.js';
import { CreateNodeContext } from '../../util.js';
import type { CollectionTag } from '../types.js';
import { Pair } from '../../nodes/Pair';
import type { Scalar } from '../../nodes/Scalar';
import type { ToJSContext } from '../../nodes/toJS';
import { YAMLMap } from '../../nodes/YAMLMap';
import type { Schema } from '../../schema/Schema';
import type { StringifyContext } from '../../stringify/stringify';
import type { CreateNodeContext } from '../../util';
import type { CollectionTag } from '../types';
export declare class YAMLSet<T = unknown> extends YAMLMap<T, Scalar<null> | null> {
static tag: string;
constructor(schema?: Schema);
@@ -23,6 +23,6 @@ export declare class YAMLSet<T = unknown> extends YAMLMap<T, Scalar<null> | null
set(key: T, value: null): void;
toJSON(_?: unknown, ctx?: ToJSContext): any;
toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
static from(schema: Schema, iterable: unknown, ctx: CreateNodeContext): YAMLSet<unknown>;
static from(schema: Schema, iterable: unknown, ctx: CreateNodeContext): YAMLSet;
}
export declare const set: CollectionTag;

View File

@@ -1,4 +1,4 @@
import type { ScalarTag } from '../types.js';
import type { ScalarTag } from '../types';
export declare const intTime: ScalarTag;
export declare const floatTime: ScalarTag;
export declare const timestamp: ScalarTag & {

View File

@@ -97,7 +97,7 @@ const timestamp = {
}
return new Date(date);
},
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
};
exports.floatTime = floatTime;