trusty-cms 4.1.4 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +68 -68
  4. data/README.md +1 -1
  5. data/app/assets/javascripts/admin/assets.js +1 -1
  6. data/lib/trusty_cms.rb +1 -1
  7. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/core.js +126 -0
  8. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/index.js +4 -0
  9. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/map.js +56 -0
  10. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js +43 -0
  11. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/string.js +28 -0
  12. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/index.js +36 -0
  13. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/json.js +76 -0
  14. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/options.js +23 -0
  15. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/binary.js +87 -0
  16. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/index.js +157 -0
  17. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/omap.js +142 -0
  18. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/pairs.js +81 -0
  19. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/set.js +114 -0
  20. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/timestamp.js +97 -0
  21. data/spec/spec/dummy/node_modules/yaml/dist/tags/core.js +114 -0
  22. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/index.js +17 -0
  23. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/map.js +37 -0
  24. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/seq.js +34 -0
  25. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/string.js +40 -0
  26. data/spec/spec/dummy/node_modules/yaml/dist/tags/index.js +62 -0
  27. data/spec/spec/dummy/node_modules/yaml/dist/tags/json.js +60 -0
  28. data/spec/spec/dummy/node_modules/yaml/dist/tags/options.js +35 -0
  29. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/binary.js +97 -0
  30. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/index.js +131 -0
  31. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/omap.js +105 -0
  32. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/pairs.js +80 -0
  33. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/set.js +91 -0
  34. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/timestamp.js +93 -0
  35. data/trusty_cms.gemspec +1 -1
  36. data/yarn.lock +3 -3
  37. metadata +7563 -69
@@ -0,0 +1,142 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import { YAMLSemanticError } from '../../errors';
9
+ import _toJSON from '../../toJSON';
10
+ import YAMLMap from '../../schema/Map';
11
+ import Pair from '../../schema/Pair';
12
+ import Scalar from '../../schema/Scalar';
13
+ import YAMLSeq from '../../schema/Seq';
14
+ import { createPairs, parsePairs } from './pairs';
15
+ export var YAMLOMap = /*#__PURE__*/function (_YAMLSeq) {
16
+ _inherits(YAMLOMap, _YAMLSeq);
17
+
18
+ function YAMLOMap() {
19
+ var _this;
20
+
21
+ _classCallCheck(this, YAMLOMap);
22
+
23
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(YAMLOMap).call(this));
24
+
25
+ _defineProperty(_assertThisInitialized(_this), "add", YAMLMap.prototype.add.bind(_assertThisInitialized(_this)));
26
+
27
+ _defineProperty(_assertThisInitialized(_this), "delete", YAMLMap.prototype.delete.bind(_assertThisInitialized(_this)));
28
+
29
+ _defineProperty(_assertThisInitialized(_this), "get", YAMLMap.prototype.get.bind(_assertThisInitialized(_this)));
30
+
31
+ _defineProperty(_assertThisInitialized(_this), "has", YAMLMap.prototype.has.bind(_assertThisInitialized(_this)));
32
+
33
+ _defineProperty(_assertThisInitialized(_this), "set", YAMLMap.prototype.set.bind(_assertThisInitialized(_this)));
34
+
35
+ _this.tag = YAMLOMap.tag;
36
+ return _this;
37
+ }
38
+
39
+ _createClass(YAMLOMap, [{
40
+ key: "toJSON",
41
+ value: function toJSON(_, ctx) {
42
+ var map = new Map();
43
+ if (ctx && ctx.onCreate) ctx.onCreate(map);
44
+ var _iteratorNormalCompletion = true;
45
+ var _didIteratorError = false;
46
+ var _iteratorError = undefined;
47
+
48
+ try {
49
+ for (var _iterator = this.items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
50
+ var pair = _step.value;
51
+ var key = void 0,
52
+ value = void 0;
53
+
54
+ if (pair instanceof Pair) {
55
+ key = _toJSON(pair.key, '', ctx);
56
+ value = _toJSON(pair.value, key, ctx);
57
+ } else {
58
+ key = _toJSON(pair, '', ctx);
59
+ }
60
+
61
+ if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');
62
+ map.set(key, value);
63
+ }
64
+ } catch (err) {
65
+ _didIteratorError = true;
66
+ _iteratorError = err;
67
+ } finally {
68
+ try {
69
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
70
+ _iterator.return();
71
+ }
72
+ } finally {
73
+ if (_didIteratorError) {
74
+ throw _iteratorError;
75
+ }
76
+ }
77
+ }
78
+
79
+ return map;
80
+ }
81
+ }]);
82
+
83
+ return YAMLOMap;
84
+ }(YAMLSeq);
85
+
86
+ _defineProperty(YAMLOMap, "tag", 'tag:yaml.org,2002:omap');
87
+
88
+ function parseOMap(doc, cst) {
89
+ var pairs = parsePairs(doc, cst);
90
+ var seenKeys = [];
91
+ var _iteratorNormalCompletion2 = true;
92
+ var _didIteratorError2 = false;
93
+ var _iteratorError2 = undefined;
94
+
95
+ try {
96
+ for (var _iterator2 = pairs.items[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
97
+ var key = _step2.value.key;
98
+
99
+ if (key instanceof Scalar) {
100
+ if (seenKeys.includes(key.value)) {
101
+ var msg = 'Ordered maps must not include duplicate keys';
102
+ throw new YAMLSemanticError(cst, msg);
103
+ } else {
104
+ seenKeys.push(key.value);
105
+ }
106
+ }
107
+ }
108
+ } catch (err) {
109
+ _didIteratorError2 = true;
110
+ _iteratorError2 = err;
111
+ } finally {
112
+ try {
113
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
114
+ _iterator2.return();
115
+ }
116
+ } finally {
117
+ if (_didIteratorError2) {
118
+ throw _iteratorError2;
119
+ }
120
+ }
121
+ }
122
+
123
+ return Object.assign(new YAMLOMap(), pairs);
124
+ }
125
+
126
+ function createOMap(schema, iterable, ctx) {
127
+ var pairs = createPairs(schema, iterable, ctx);
128
+ var omap = new YAMLOMap();
129
+ omap.items = pairs.items;
130
+ return omap;
131
+ }
132
+
133
+ export default {
134
+ identify: function identify(value) {
135
+ return value instanceof Map;
136
+ },
137
+ nodeClass: YAMLOMap,
138
+ default: false,
139
+ tag: 'tag:yaml.org,2002:omap',
140
+ resolve: parseOMap,
141
+ createNode: createOMap
142
+ };
@@ -0,0 +1,81 @@
1
+ import { YAMLSemanticError } from '../../errors';
2
+ import YAMLMap from '../../schema/Map';
3
+ import Pair from '../../schema/Pair';
4
+ import parseSeq from '../../schema/parseSeq';
5
+ import YAMLSeq from '../../schema/Seq';
6
+ export function parsePairs(doc, cst) {
7
+ var seq = parseSeq(doc, cst);
8
+
9
+ for (var i = 0; i < seq.items.length; ++i) {
10
+ var item = seq.items[i];
11
+ if (item instanceof Pair) continue;else if (item instanceof YAMLMap) {
12
+ if (item.items.length > 1) {
13
+ var msg = 'Each pair must have its own sequence indicator';
14
+ throw new YAMLSemanticError(cst, msg);
15
+ }
16
+
17
+ var pair = item.items[0] || new Pair();
18
+ if (item.commentBefore) pair.commentBefore = pair.commentBefore ? "".concat(item.commentBefore, "\n").concat(pair.commentBefore) : item.commentBefore;
19
+ if (item.comment) pair.comment = pair.comment ? "".concat(item.comment, "\n").concat(pair.comment) : item.comment;
20
+ item = pair;
21
+ }
22
+ seq.items[i] = item instanceof Pair ? item : new Pair(item);
23
+ }
24
+
25
+ return seq;
26
+ }
27
+ export function createPairs(schema, iterable, ctx) {
28
+ var pairs = new YAMLSeq(schema);
29
+ pairs.tag = 'tag:yaml.org,2002:pairs';
30
+ var _iteratorNormalCompletion = true;
31
+ var _didIteratorError = false;
32
+ var _iteratorError = undefined;
33
+
34
+ try {
35
+ for (var _iterator = iterable[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
36
+ var it = _step.value;
37
+ var key = void 0,
38
+ value = void 0;
39
+
40
+ if (Array.isArray(it)) {
41
+ if (it.length === 2) {
42
+ key = it[0];
43
+ value = it[1];
44
+ } else throw new TypeError("Expected [key, value] tuple: ".concat(it));
45
+ } else if (it && it instanceof Object) {
46
+ var keys = Object.keys(it);
47
+
48
+ if (keys.length === 1) {
49
+ key = keys[0];
50
+ value = it[key];
51
+ } else throw new TypeError("Expected { key: value } tuple: ".concat(it));
52
+ } else {
53
+ key = it;
54
+ }
55
+
56
+ var pair = schema.createPair(key, value, ctx);
57
+ pairs.items.push(pair);
58
+ }
59
+ } catch (err) {
60
+ _didIteratorError = true;
61
+ _iteratorError = err;
62
+ } finally {
63
+ try {
64
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
65
+ _iterator.return();
66
+ }
67
+ } finally {
68
+ if (_didIteratorError) {
69
+ throw _iteratorError;
70
+ }
71
+ }
72
+ }
73
+
74
+ return pairs;
75
+ }
76
+ export default {
77
+ default: false,
78
+ tag: 'tag:yaml.org,2002:pairs',
79
+ resolve: parsePairs,
80
+ createNode: createPairs
81
+ };
@@ -0,0 +1,114 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _get from "@babel/runtime/helpers/get";
7
+ import _inherits from "@babel/runtime/helpers/inherits";
8
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ import { YAMLSemanticError } from '../../errors';
10
+ import YAMLMap, { findPair } from '../../schema/Map';
11
+ import Pair from '../../schema/Pair';
12
+ import parseMap from '../../schema/parseMap';
13
+ import Scalar from '../../schema/Scalar';
14
+ export var YAMLSet = /*#__PURE__*/function (_YAMLMap) {
15
+ _inherits(YAMLSet, _YAMLMap);
16
+
17
+ function YAMLSet() {
18
+ var _this;
19
+
20
+ _classCallCheck(this, YAMLSet);
21
+
22
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(YAMLSet).call(this));
23
+ _this.tag = YAMLSet.tag;
24
+ return _this;
25
+ }
26
+
27
+ _createClass(YAMLSet, [{
28
+ key: "add",
29
+ value: function add(key) {
30
+ var pair = key instanceof Pair ? key : new Pair(key);
31
+ var prev = findPair(this.items, pair.key);
32
+ if (!prev) this.items.push(pair);
33
+ }
34
+ }, {
35
+ key: "get",
36
+ value: function get(key, keepPair) {
37
+ var pair = findPair(this.items, key);
38
+ return !keepPair && pair instanceof Pair ? pair.key instanceof Scalar ? pair.key.value : pair.key : pair;
39
+ }
40
+ }, {
41
+ key: "set",
42
+ value: function set(key, value) {
43
+ if (typeof value !== 'boolean') throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(_typeof(value)));
44
+ var prev = findPair(this.items, key);
45
+
46
+ if (prev && !value) {
47
+ this.items.splice(this.items.indexOf(prev), 1);
48
+ } else if (!prev && value) {
49
+ this.items.push(new Pair(key));
50
+ }
51
+ }
52
+ }, {
53
+ key: "toJSON",
54
+ value: function toJSON(_, ctx) {
55
+ return _get(_getPrototypeOf(YAMLSet.prototype), "toJSON", this).call(this, _, ctx, Set);
56
+ }
57
+ }, {
58
+ key: "toString",
59
+ value: function toString(ctx, onComment, onChompKeep) {
60
+ if (!ctx) return JSON.stringify(this);
61
+ if (this.hasAllNullValues()) return _get(_getPrototypeOf(YAMLSet.prototype), "toString", this).call(this, ctx, onComment, onChompKeep);else throw new Error('Set items must all have null values');
62
+ }
63
+ }]);
64
+
65
+ return YAMLSet;
66
+ }(YAMLMap);
67
+
68
+ _defineProperty(YAMLSet, "tag", 'tag:yaml.org,2002:set');
69
+
70
+ function parseSet(doc, cst) {
71
+ var map = parseMap(doc, cst);
72
+ if (!map.hasAllNullValues()) throw new YAMLSemanticError(cst, 'Set items must all have null values');
73
+ return Object.assign(new YAMLSet(), map);
74
+ }
75
+
76
+ function createSet(schema, iterable, ctx) {
77
+ var set = new YAMLSet();
78
+ var _iteratorNormalCompletion = true;
79
+ var _didIteratorError = false;
80
+ var _iteratorError = undefined;
81
+
82
+ try {
83
+ for (var _iterator = iterable[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
84
+ var value = _step.value;
85
+ set.items.push(schema.createPair(value, null, ctx));
86
+ }
87
+ } catch (err) {
88
+ _didIteratorError = true;
89
+ _iteratorError = err;
90
+ } finally {
91
+ try {
92
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
93
+ _iterator.return();
94
+ }
95
+ } finally {
96
+ if (_didIteratorError) {
97
+ throw _iteratorError;
98
+ }
99
+ }
100
+ }
101
+
102
+ return set;
103
+ }
104
+
105
+ export default {
106
+ identify: function identify(value) {
107
+ return value instanceof Set;
108
+ },
109
+ nodeClass: YAMLSet,
110
+ default: false,
111
+ tag: 'tag:yaml.org,2002:set',
112
+ resolve: parseSet,
113
+ createNode: createSet
114
+ };
@@ -0,0 +1,97 @@
1
+ import { stringifyNumber } from '../../stringify';
2
+
3
+ var parseSexagesimal = function parseSexagesimal(sign, parts) {
4
+ var n = parts.split(':').reduce(function (n, p) {
5
+ return n * 60 + Number(p);
6
+ }, 0);
7
+ return sign === '-' ? -n : n;
8
+ }; // hhhh:mm:ss.sss
9
+
10
+
11
+ var stringifySexagesimal = function stringifySexagesimal(_ref) {
12
+ var value = _ref.value;
13
+ if (isNaN(value) || !isFinite(value)) return stringifyNumber(value);
14
+ var sign = '';
15
+
16
+ if (value < 0) {
17
+ sign = '-';
18
+ value = Math.abs(value);
19
+ }
20
+
21
+ var parts = [value % 60]; // seconds, including ms
22
+
23
+ if (value < 60) {
24
+ parts.unshift(0); // at least one : is required
25
+ } else {
26
+ value = Math.round((value - parts[0]) / 60);
27
+ parts.unshift(value % 60); // minutes
28
+
29
+ if (value >= 60) {
30
+ value = Math.round((value - parts[0]) / 60);
31
+ parts.unshift(value); // hours
32
+ }
33
+ }
34
+
35
+ return sign + parts.map(function (n) {
36
+ return n < 10 ? '0' + String(n) : String(n);
37
+ }).join(':').replace(/000000\d*$/, '') // % 60 may introduce error
38
+ ;
39
+ };
40
+
41
+ export var intTime = {
42
+ identify: function identify(value) {
43
+ return typeof value === 'number';
44
+ },
45
+ default: true,
46
+ tag: 'tag:yaml.org,2002:int',
47
+ format: 'TIME',
48
+ test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,
49
+ resolve: function resolve(str, sign, parts) {
50
+ return parseSexagesimal(sign, parts.replace(/_/g, ''));
51
+ },
52
+ stringify: stringifySexagesimal
53
+ };
54
+ export var floatTime = {
55
+ identify: function identify(value) {
56
+ return typeof value === 'number';
57
+ },
58
+ default: true,
59
+ tag: 'tag:yaml.org,2002:float',
60
+ format: 'TIME',
61
+ test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,
62
+ resolve: function resolve(str, sign, parts) {
63
+ return parseSexagesimal(sign, parts.replace(/_/g, ''));
64
+ },
65
+ stringify: stringifySexagesimal
66
+ };
67
+ export var timestamp = {
68
+ identify: function identify(value) {
69
+ return value instanceof Date;
70
+ },
71
+ default: true,
72
+ tag: 'tag:yaml.org,2002:timestamp',
73
+ // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
74
+ // may be omitted altogether, resulting in a date format. In such a case, the time part is
75
+ // assumed to be 00:00:00Z (start of day, UTC).
76
+ test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd
77
+ '(?:(?:t|T|[ \\t]+)' + // t | T | whitespace
78
+ '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?
79
+ '(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30
80
+ ')?' + ')$'),
81
+ resolve: function resolve(str, year, month, day, hour, minute, second, millisec, tz) {
82
+ if (millisec) millisec = (millisec + '00').substr(1, 3);
83
+ var date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);
84
+
85
+ if (tz && tz !== 'Z') {
86
+ var d = parseSexagesimal(tz[0], tz.slice(1));
87
+ if (Math.abs(d) < 30) d *= 60;
88
+ date -= 60000 * d;
89
+ }
90
+
91
+ return new Date(date);
92
+ },
93
+ stringify: function stringify(_ref2) {
94
+ var value = _ref2.value;
95
+ return value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '');
96
+ }
97
+ };
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.floatObj = exports.expObj = exports.nanObj = exports.hexObj = exports.intObj = exports.octObj = exports.boolObj = exports.nullObj = void 0;
7
+
8
+ var _Scalar = _interopRequireDefault(require("../schema/Scalar"));
9
+
10
+ var _stringify = require("../stringify");
11
+
12
+ var _failsafe = _interopRequireDefault(require("./failsafe"));
13
+
14
+ var _options = require("./options");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ const nullObj = {
19
+ identify: value => value == null,
20
+ createNode: (schema, value, ctx) => ctx.wrapScalars ? new _Scalar.default(null) : null,
21
+ default: true,
22
+ tag: 'tag:yaml.org,2002:null',
23
+ test: /^(?:~|[Nn]ull|NULL)?$/,
24
+ resolve: () => null,
25
+ options: _options.nullOptions,
26
+ stringify: () => _options.nullOptions.nullStr
27
+ };
28
+ exports.nullObj = nullObj;
29
+ const boolObj = {
30
+ identify: value => typeof value === 'boolean',
31
+ default: true,
32
+ tag: 'tag:yaml.org,2002:bool',
33
+ test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
34
+ resolve: str => str[0] === 't' || str[0] === 'T',
35
+ options: _options.boolOptions,
36
+ stringify: ({
37
+ value
38
+ }) => value ? _options.boolOptions.trueStr : _options.boolOptions.falseStr
39
+ };
40
+ exports.boolObj = boolObj;
41
+ const octObj = {
42
+ identify: value => typeof value === 'number',
43
+ default: true,
44
+ tag: 'tag:yaml.org,2002:int',
45
+ format: 'OCT',
46
+ test: /^0o([0-7]+)$/,
47
+ resolve: (str, oct) => parseInt(oct, 8),
48
+ stringify: ({
49
+ value
50
+ }) => '0o' + value.toString(8)
51
+ };
52
+ exports.octObj = octObj;
53
+ const intObj = {
54
+ identify: value => typeof value === 'number',
55
+ default: true,
56
+ tag: 'tag:yaml.org,2002:int',
57
+ test: /^[-+]?[0-9]+$/,
58
+ resolve: str => parseInt(str, 10),
59
+ stringify: _stringify.stringifyNumber
60
+ };
61
+ exports.intObj = intObj;
62
+ const hexObj = {
63
+ identify: value => typeof value === 'number',
64
+ default: true,
65
+ tag: 'tag:yaml.org,2002:int',
66
+ format: 'HEX',
67
+ test: /^0x([0-9a-fA-F]+)$/,
68
+ resolve: (str, hex) => parseInt(hex, 16),
69
+ stringify: ({
70
+ value
71
+ }) => '0x' + value.toString(16)
72
+ };
73
+ exports.hexObj = hexObj;
74
+ const nanObj = {
75
+ identify: value => typeof value === 'number',
76
+ default: true,
77
+ tag: 'tag:yaml.org,2002:float',
78
+ test: /^(?:[-+]?\.inf|(\.nan))$/i,
79
+ resolve: (str, nan) => nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
80
+ stringify: _stringify.stringifyNumber
81
+ };
82
+ exports.nanObj = nanObj;
83
+ const expObj = {
84
+ identify: value => typeof value === 'number',
85
+ default: true,
86
+ tag: 'tag:yaml.org,2002:float',
87
+ format: 'EXP',
88
+ test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
89
+ resolve: str => parseFloat(str),
90
+ stringify: ({
91
+ value
92
+ }) => Number(value).toExponential()
93
+ };
94
+ exports.expObj = expObj;
95
+ const floatObj = {
96
+ identify: value => typeof value === 'number',
97
+ default: true,
98
+ tag: 'tag:yaml.org,2002:float',
99
+ test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,
100
+
101
+ resolve(str, frac1, frac2) {
102
+ const frac = frac1 || frac2;
103
+ const node = new _Scalar.default(parseFloat(str));
104
+ if (frac && frac[frac.length - 1] === '0') node.minFractionDigits = frac.length;
105
+ return node;
106
+ },
107
+
108
+ stringify: _stringify.stringifyNumber
109
+ };
110
+ exports.floatObj = floatObj;
111
+
112
+ var _default = _failsafe.default.concat([nullObj, boolObj, octObj, intObj, hexObj, nanObj, expObj, floatObj]);
113
+
114
+ exports.default = _default;