mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-12-09 22:30:41 -07:00
node_modules: upgrade
This commit is contained in:
24
node_modules/yaml/browser/dist/compose/compose-scalar.js
generated
vendored
24
node_modules/yaml/browser/dist/compose/compose-scalar.js
generated
vendored
@@ -1,20 +1,25 @@
|
||||
import { SCALAR, isScalar } from '../nodes/identity.js';
|
||||
import { isScalar, SCALAR } from '../nodes/identity.js';
|
||||
import { Scalar } from '../nodes/Scalar.js';
|
||||
import { resolveBlockScalar } from './resolve-block-scalar.js';
|
||||
import { resolveFlowScalar } from './resolve-flow-scalar.js';
|
||||
|
||||
function composeScalar(ctx, token, tagToken, onError) {
|
||||
const { value, type, comment, range } = token.type === 'block-scalar'
|
||||
? resolveBlockScalar(token, ctx.options.strict, onError)
|
||||
? resolveBlockScalar(ctx, token, onError)
|
||||
: resolveFlowScalar(token, ctx.options.strict, onError);
|
||||
const tagName = tagToken
|
||||
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
||||
: null;
|
||||
const tag = tagToken && tagName
|
||||
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
||||
: token.type === 'scalar'
|
||||
? findScalarTagByTest(ctx, value, token, onError)
|
||||
: ctx.schema[SCALAR];
|
||||
let tag;
|
||||
if (ctx.options.stringKeys && ctx.atKey) {
|
||||
tag = ctx.schema[SCALAR];
|
||||
}
|
||||
else if (tagName)
|
||||
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
||||
else if (token.type === 'scalar')
|
||||
tag = findScalarTagByTest(ctx, value, token, onError);
|
||||
else
|
||||
tag = ctx.schema[SCALAR];
|
||||
let scalar;
|
||||
try {
|
||||
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
||||
@@ -62,8 +67,9 @@ function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
||||
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
||||
return schema[SCALAR];
|
||||
}
|
||||
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
||||
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR];
|
||||
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
||||
const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
|
||||
tag.test?.test(value)) || schema[SCALAR];
|
||||
if (schema.compat) {
|
||||
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
||||
schema[SCALAR];
|
||||
|
||||
Reference in New Issue
Block a user