1 | 'use strict';
|
---|
2 |
|
---|
3 |
|
---|
4 | var loader = require('./lib/loader');
|
---|
5 | var dumper = require('./lib/dumper');
|
---|
6 |
|
---|
7 |
|
---|
8 | function renamed(from, to) {
|
---|
9 | return function () {
|
---|
10 | throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
|
---|
11 | 'Use yaml.' + to + ' instead, which is now safe by default.');
|
---|
12 | };
|
---|
13 | }
|
---|
14 |
|
---|
15 |
|
---|
16 | module.exports.Type = require('./lib/type');
|
---|
17 | module.exports.Schema = require('./lib/schema');
|
---|
18 | module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');
|
---|
19 | module.exports.JSON_SCHEMA = require('./lib/schema/json');
|
---|
20 | module.exports.CORE_SCHEMA = require('./lib/schema/core');
|
---|
21 | module.exports.DEFAULT_SCHEMA = require('./lib/schema/default');
|
---|
22 | module.exports.load = loader.load;
|
---|
23 | module.exports.loadAll = loader.loadAll;
|
---|
24 | module.exports.dump = dumper.dump;
|
---|
25 | module.exports.YAMLException = require('./lib/exception');
|
---|
26 |
|
---|
27 | // Re-export all types in case user wants to create custom schema
|
---|
28 | module.exports.types = {
|
---|
29 | binary: require('./lib/type/binary'),
|
---|
30 | float: require('./lib/type/float'),
|
---|
31 | map: require('./lib/type/map'),
|
---|
32 | null: require('./lib/type/null'),
|
---|
33 | pairs: require('./lib/type/pairs'),
|
---|
34 | set: require('./lib/type/set'),
|
---|
35 | timestamp: require('./lib/type/timestamp'),
|
---|
36 | bool: require('./lib/type/bool'),
|
---|
37 | int: require('./lib/type/int'),
|
---|
38 | merge: require('./lib/type/merge'),
|
---|
39 | omap: require('./lib/type/omap'),
|
---|
40 | seq: require('./lib/type/seq'),
|
---|
41 | str: require('./lib/type/str')
|
---|
42 | };
|
---|
43 |
|
---|
44 | // Removed functions from JS-YAML 3.0.x
|
---|
45 | module.exports.safeLoad = renamed('safeLoad', 'load');
|
---|
46 | module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');
|
---|
47 | module.exports.safeDump = renamed('safeDump', 'dump');
|
---|