yaml-ast-parser
Version:
[](https://travis-ci.org/mulesoft-labs/yaml-ast-parser)
31 lines (22 loc) • 566 B
text/typescript
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
});
;