ohctechv3/.svn/pristine/54/54194042708f5fbd7cb2c9cd69176cdc6fea487c.svn-base
2024-10-28 15:03:36 +05:30

16 lines
434 B
Plaintext

import { Scalar } from '../../nodes/Scalar.js';
const nullTag = {
identify: value => value == null,
createNode: () => new Scalar(null),
default: true,
tag: 'tag:yaml.org,2002:null',
test: /^(?:~|[Nn]ull|NULL)?$/,
resolve: () => new Scalar(null),
stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)
? source
: ctx.options.nullStr
};
export { nullTag };