main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
469 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var Scalar = require('../../nodes/Scalar.js');
|
---|
4 |
|
---|
5 | const nullTag = {
|
---|
6 | identify: value => value == null,
|
---|
7 | createNode: () => new Scalar.Scalar(null),
|
---|
8 | default: true,
|
---|
9 | tag: 'tag:yaml.org,2002:null',
|
---|
10 | test: /^(?:~|[Nn]ull|NULL)?$/,
|
---|
11 | resolve: () => new Scalar.Scalar(null),
|
---|
12 | stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)
|
---|
13 | ? source
|
---|
14 | : ctx.options.nullStr
|
---|
15 | };
|
---|
16 |
|
---|
17 | exports.nullTag = nullTag;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.