31 lines
566 B
Plaintext
31 lines
566 B
Plaintext
|
|
|
|
'use strict';
|
|
|
|
import {Type} from '../../type';
|
|
|
|
function resolveJavascriptUndefined() {
|
|
return true;
|
|
}
|
|
|
|
function constructJavascriptUndefined() {
|
|
/*eslint-disable no-undefined*/
|
|
return undefined;
|
|
}
|
|
|
|
function representJavascriptUndefined() {
|
|
return '';
|
|
}
|
|
|
|
function isUndefined(object) {
|
|
return 'undefined' === typeof object;
|
|
}
|
|
|
|
export = new Type('tag:yaml.org,2002:js/undefined', {
|
|
kind: 'scalar',
|
|
resolve: resolveJavascriptUndefined,
|
|
construct: constructJavascriptUndefined,
|
|
predicate: isUndefined,
|
|
represent: representJavascriptUndefined
|
|
});
|