• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3var Type = require('../../type');
4
5function resolveJavascriptUndefined() {
6  return true;
7}
8
9function constructJavascriptUndefined() {
10  /*eslint-disable no-undefined*/
11  return undefined;
12}
13
14function representJavascriptUndefined() {
15  return '';
16}
17
18function isUndefined(object) {
19  return typeof object === 'undefined';
20}
21
22module.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