You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
573 B
28 lines
573 B
'use strict';
|
|
|
|
var Type = require('../../type');
|
|
|
|
function resolveJavascriptUndefined() {
|
|
return true;
|
|
}
|
|
|
|
function constructJavascriptUndefined() {
|
|
/*eslint-disable no-undefined*/
|
|
return undefined;
|
|
}
|
|
|
|
function representJavascriptUndefined() {
|
|
return '';
|
|
}
|
|
|
|
function isUndefined(object) {
|
|
return typeof object === 'undefined';
|
|
}
|
|
|
|
module.exports = new Type('tag:yaml.org,2002:js/undefined', {
|
|
kind: 'scalar',
|
|
resolve: resolveJavascriptUndefined,
|
|
construct: constructJavascriptUndefined,
|
|
predicate: isUndefined,
|
|
represent: representJavascriptUndefined
|
|
});
|
|
|