trusty-cms 4.1.3 → 4.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +127 -120
- data/README.md +1 -1
- data/app/assets/javascripts/admin/assets.js +1 -1
- data/app/assets/javascripts/rad_social/rad_ajax_form.js +3 -0
- data/app/assets/javascripts/rad_social/rad_email.js +0 -1
- data/app/assets/javascripts/rad_social/rad_email_form.js +2 -7
- data/app/assets/stylesheets/rad_social/rad_screen.scss +0 -4
- data/app/controllers/social_mailer_controller.rb +0 -7
- data/app/views/admin/assets/edit.html.haml +3 -0
- data/app/views/rad_social_mailer/social_mail_form.html.haml +1 -3
- data/app/views/widget/_email_form.html.haml +0 -5
- data/config/locales/en.yml +1 -0
- data/lib/trusty_cms.rb +1 -1
- data/lib/trusty_cms/engine.rb +0 -1
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/core.js +126 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/index.js +4 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/map.js +56 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js +43 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/string.js +28 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/index.js +36 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/json.js +76 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/options.js +23 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/binary.js +87 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/index.js +157 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/omap.js +142 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/pairs.js +81 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/set.js +114 -0
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/timestamp.js +97 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/core.js +114 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/index.js +17 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/map.js +37 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/seq.js +34 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/string.js +40 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/index.js +62 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/json.js +60 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/options.js +35 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/binary.js +97 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/index.js +131 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/omap.js +105 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/pairs.js +80 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/set.js +91 -0
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/timestamp.js +93 -0
- data/trusty_cms.gemspec +4 -4
- data/yarn.lock +6 -6
- metadata +7574 -75
- data/app/assets/javascripts/rad_social/captcha.js +0 -42
@@ -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;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _map = _interopRequireDefault(require("./map"));
|
9
|
+
|
10
|
+
var _seq = _interopRequireDefault(require("./seq"));
|
11
|
+
|
12
|
+
var _string = _interopRequireDefault(require("./string"));
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
+
|
16
|
+
var _default = [_map.default, _seq.default, _string.default];
|
17
|
+
exports.default = _default;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _Map = _interopRequireDefault(require("../../schema/Map"));
|
9
|
+
|
10
|
+
var _parseMap = _interopRequireDefault(require("../../schema/parseMap"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
function createMap(schema, obj, ctx) {
|
15
|
+
const map = new _Map.default(schema);
|
16
|
+
|
17
|
+
if (obj instanceof Map) {
|
18
|
+
for (const [key, value] of obj) map.items.push(schema.createPair(key, value, ctx));
|
19
|
+
} else if (obj && typeof obj === 'object') {
|
20
|
+
for (const key of Object.keys(obj)) map.items.push(schema.createPair(key, obj[key], ctx));
|
21
|
+
}
|
22
|
+
|
23
|
+
if (typeof schema.sortMapEntries === 'function') {
|
24
|
+
map.items.sort(schema.sortMapEntries);
|
25
|
+
}
|
26
|
+
|
27
|
+
return map;
|
28
|
+
}
|
29
|
+
|
30
|
+
var _default = {
|
31
|
+
createNode: createMap,
|
32
|
+
default: true,
|
33
|
+
nodeClass: _Map.default,
|
34
|
+
tag: 'tag:yaml.org,2002:map',
|
35
|
+
resolve: _parseMap.default
|
36
|
+
};
|
37
|
+
exports.default = _default;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _parseSeq = _interopRequireDefault(require("../../schema/parseSeq"));
|
9
|
+
|
10
|
+
var _Seq = _interopRequireDefault(require("../../schema/Seq"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
function createSeq(schema, obj, ctx) {
|
15
|
+
const seq = new _Seq.default(schema);
|
16
|
+
|
17
|
+
if (obj && obj[Symbol.iterator]) {
|
18
|
+
for (const it of obj) {
|
19
|
+
const v = schema.createNode(it, ctx.wrapScalars, null, ctx);
|
20
|
+
seq.items.push(v);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
return seq;
|
25
|
+
}
|
26
|
+
|
27
|
+
var _default = {
|
28
|
+
createNode: createSeq,
|
29
|
+
default: true,
|
30
|
+
nodeClass: _Seq.default,
|
31
|
+
tag: 'tag:yaml.org,2002:seq',
|
32
|
+
resolve: _parseSeq.default
|
33
|
+
};
|
34
|
+
exports.default = _default;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = exports.resolveString = void 0;
|
7
|
+
|
8
|
+
var _stringify = require("../../stringify");
|
9
|
+
|
10
|
+
var _options = require("../options");
|
11
|
+
|
12
|
+
const resolveString = (doc, node) => {
|
13
|
+
// on error, will return { str: string, errors: Error[] }
|
14
|
+
const res = node.strValue;
|
15
|
+
if (!res) return '';
|
16
|
+
if (typeof res === 'string') return res;
|
17
|
+
res.errors.forEach(error => {
|
18
|
+
if (!error.source) error.source = node;
|
19
|
+
doc.errors.push(error);
|
20
|
+
});
|
21
|
+
return res.str;
|
22
|
+
};
|
23
|
+
|
24
|
+
exports.resolveString = resolveString;
|
25
|
+
var _default = {
|
26
|
+
identify: value => typeof value === 'string',
|
27
|
+
default: true,
|
28
|
+
tag: 'tag:yaml.org,2002:str',
|
29
|
+
resolve: resolveString,
|
30
|
+
|
31
|
+
stringify(item, ctx, onComment, onChompKeep) {
|
32
|
+
ctx = Object.assign({
|
33
|
+
actualString: true
|
34
|
+
}, ctx);
|
35
|
+
return (0, _stringify.stringifyString)(item, ctx, onComment, onChompKeep);
|
36
|
+
},
|
37
|
+
|
38
|
+
options: _options.strOptions
|
39
|
+
};
|
40
|
+
exports.default = _default;
|