| 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 }; | |
Xet Storage Details
- Size:
- 787 Bytes
- Xet hash:
- 9f8e4cd821701d9a3e16fa7ad5e02af033717516c98ff5de1e343d9f0b4090ec
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.