Files
vercel_dashboard_example/.pnpm-store/v11/files/3f/46bd63f04531ae7a6129f0d7cb0e614c2ccfb57ff849e2182210bb8233daa20ca0e72b8b0aa4ea67613b14af3a2c1aeb85c45b754d224bf9989a0b90276ea2
T
2026-05-12 14:53:15 +00:00

27 lines
787 B
Plaintext

import { Scalar } from '../../nodes/Scalar.js';
function boolStringify({ value, source }, ctx) {
const boolObj = value ? trueTag : falseTag;
if (source && boolObj.test.test(source))
return source;
return value ? ctx.options.trueStr : ctx.options.falseStr;
}
const trueTag = {
identify: value => value === true,
default: true,
tag: 'tag:yaml.org,2002:bool',
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
resolve: () => new Scalar(true),
stringify: boolStringify
};
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)$/,
resolve: () => new Scalar(false),
stringify: boolStringify
};
export { falseTag, trueTag };