js-yaml.js (1665B)
1 'use strict'; 2 3 4 var loader = require('./js-yaml/loader'); 5 var dumper = require('./js-yaml/dumper'); 6 7 8 function deprecated(name) { 9 return function () { 10 throw new Error('Function ' + name + ' is deprecated and cannot be used.'); 11 }; 12 } 13 14 15 module.exports.Type = require('./js-yaml/type'); 16 module.exports.Schema = require('./js-yaml/schema'); 17 module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe'); 18 module.exports.JSON_SCHEMA = require('./js-yaml/schema/json'); 19 module.exports.CORE_SCHEMA = require('./js-yaml/schema/core'); 20 module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); 21 module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full'); 22 module.exports.load = loader.load; 23 module.exports.loadAll = loader.loadAll; 24 module.exports.safeLoad = loader.safeLoad; 25 module.exports.safeLoadAll = loader.safeLoadAll; 26 module.exports.dump = dumper.dump; 27 module.exports.safeDump = dumper.safeDump; 28 module.exports.YAMLException = require('./js-yaml/exception'); 29 30 // Deprecated schema names from JS-YAML 2.0.x 31 module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe'); 32 module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); 33 module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full'); 34 35 // Deprecated functions from JS-YAML 1.x.x 36 module.exports.scan = deprecated('scan'); 37 module.exports.parse = deprecated('parse'); 38 module.exports.compose = deprecated('compose'); 39 module.exports.addConstructor = deprecated('addConstructor');