Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81154 views
1
'use strict';
2
3
var Type = require('../../type');
4
5
function resolveJavascriptUndefined() {
6
return true;
7
}
8
9
function constructJavascriptUndefined() {
10
/*eslint-disable no-undefined*/
11
return undefined;
12
}
13
14
function representJavascriptUndefined() {
15
return '';
16
}
17
18
function isUndefined(object) {
19
return 'undefined' === typeof object;
20
}
21
22
module.exports = new Type('tag:yaml.org,2002:js/undefined', {
23
kind: 'scalar',
24
resolve: resolveJavascriptUndefined,
25
construct: constructJavascriptUndefined,
26
predicate: isUndefined,
27
represent: representJavascriptUndefined
28
});
29
30