Sha256: 64e60f06eb6747f0f837a52b8bd62ae6c621fbe0b0f49d3d0d4da5bc85605033

Contents?: true

Size: 690 Bytes

Versions: 10

Compression:

Stored size: 690 Bytes

Contents

'use strict';


var NIL  = require('../common').NIL;
var Type = require('../type');


var YAML_NULL_MAP = {
  '~'    : true,
  'null' : true,
  'Null' : true,
  'NULL' : true
};


function resolveYamlNull(object /*, explicit*/) {
  return YAML_NULL_MAP[object] ? null : NIL;
}


module.exports = new Type('tag:yaml.org,2002:null', {
  loader: {
    kind: 'string',
    resolver: resolveYamlNull
  },
  dumper: {
    kind: 'null',
    defaultStyle: 'lowercase',
    representer: {
      canonical: function () { return '~';    },
      lowercase: function () { return 'null'; },
      uppercase: function () { return 'NULL'; },
      camelcase: function () { return 'Null'; },
    }
  }
});

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
entangled-0.0.15 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
entangled-0.0.14 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
entangled-0.0.13 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
entangled-0.0.12 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
entangled-0.0.11 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
entangled-0.0.10 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
trans-0.5.10 template/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
trans-0.5.9 template/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js
cssesc-source-0.1.0 vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js