cdk8s-operator 0.1.407 → 0.1.408
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.
- package/.jsii +3 -3
- package/lib/operator.js +1 -1
- package/lib/server.js +1 -1
- package/node_modules/yaml/browser/dist/PlainValue-183afbad.js +751 -0
- package/node_modules/yaml/browser/dist/Schema-9530c078.js +467 -0
- package/node_modules/yaml/browser/dist/index.js +436 -746
- package/node_modules/yaml/browser/dist/legacy-exports.js +3 -3
- package/node_modules/yaml/browser/dist/parse-cst.js +1290 -1689
- package/node_modules/yaml/browser/dist/resolveSeq-67caf78a.js +1835 -0
- package/node_modules/yaml/browser/dist/types.js +4 -4
- package/node_modules/yaml/browser/dist/util.js +2 -2
- package/node_modules/yaml/browser/dist/warnings-5e4358fe.js +348 -0
- package/node_modules/yaml/dist/{Document-9b4560a1.js → Document-a8d0fbf9.js} +11 -131
- package/node_modules/yaml/dist/{PlainValue-ec8e588e.js → PlainValue-516d5bc2.js} +35 -146
- package/node_modules/yaml/dist/{Schema-88e323a7.js → Schema-bcc6c2d7.js} +10 -66
- package/node_modules/yaml/dist/index.js +5 -17
- package/node_modules/yaml/dist/legacy-exports.js +3 -3
- package/node_modules/yaml/dist/parse-cst.js +45 -291
- package/node_modules/yaml/dist/{resolveSeq-d03cb037.js → resolveSeq-95613e94.js} +44 -346
- package/node_modules/yaml/dist/test-events.js +28 -44
- package/node_modules/yaml/dist/types.js +4 -4
- package/node_modules/yaml/dist/util.js +2 -2
- package/node_modules/yaml/dist/{warnings-1000a372.js → warnings-793925ce.js} +16 -73
- package/node_modules/yaml/package.json +2 -3
- package/package.json +2 -2
- package/node_modules/yaml/browser/dist/PlainValue-b8036b75.js +0 -1275
- package/node_modules/yaml/browser/dist/Schema-e94716c8.js +0 -682
- package/node_modules/yaml/browser/dist/resolveSeq-492ab440.js +0 -2419
- package/node_modules/yaml/browser/dist/warnings-df54cb69.js +0 -499
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var parseCst = require('./parse-cst.js');
|
|
4
|
-
var Document = require('./Document-
|
|
5
|
-
require('./PlainValue-
|
|
6
|
-
require('./resolveSeq-
|
|
7
|
-
require('./Schema-
|
|
8
|
-
require('./warnings-
|
|
4
|
+
var Document = require('./Document-a8d0fbf9.js');
|
|
5
|
+
require('./PlainValue-516d5bc2.js');
|
|
6
|
+
require('./resolveSeq-95613e94.js');
|
|
7
|
+
require('./Schema-bcc6c2d7.js');
|
|
8
|
+
require('./warnings-793925ce.js');
|
|
9
9
|
|
|
10
|
+
// test harness for yaml-test-suite event tests
|
|
10
11
|
function testEvents(src, options) {
|
|
11
12
|
const opt = Object.assign({
|
|
12
13
|
keepCstNodes: true,
|
|
@@ -17,7 +18,6 @@ function testEvents(src, options) {
|
|
|
17
18
|
const errDoc = docs.find(doc => doc.errors.length > 0);
|
|
18
19
|
const error = errDoc ? errDoc.errors[0].message : null;
|
|
19
20
|
const events = ['+STR'];
|
|
20
|
-
|
|
21
21
|
try {
|
|
22
22
|
for (let i = 0; i < docs.length; ++i) {
|
|
23
23
|
const doc = docs[i];
|
|
@@ -35,12 +35,10 @@ function testEvents(src, options) {
|
|
|
35
35
|
addEvents(events, doc, e, root);
|
|
36
36
|
if (doc.contents && doc.contents.length > 1) throw new Error();
|
|
37
37
|
let docEnd = '-DOC';
|
|
38
|
-
|
|
39
38
|
if (rootEnd) {
|
|
40
39
|
const post = src.slice(rootEnd);
|
|
41
40
|
if (/^\.\.\./.test(post)) docEnd += ' ...';
|
|
42
41
|
}
|
|
43
|
-
|
|
44
42
|
events.push(docEnd);
|
|
45
43
|
}
|
|
46
44
|
} catch (e) {
|
|
@@ -49,33 +47,27 @@ function testEvents(src, options) {
|
|
|
49
47
|
error: error || e
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
|
-
|
|
53
50
|
events.push('-STR');
|
|
54
51
|
return {
|
|
55
52
|
events,
|
|
56
53
|
error
|
|
57
54
|
};
|
|
58
55
|
}
|
|
59
|
-
|
|
60
56
|
function addEvents(events, doc, e, node) {
|
|
61
57
|
if (!node) {
|
|
62
58
|
events.push('=VAL :');
|
|
63
59
|
return;
|
|
64
60
|
}
|
|
65
|
-
|
|
66
61
|
if (e && node.cstNode === e) throw new Error();
|
|
67
62
|
let props = '';
|
|
68
63
|
let anchor = doc.anchors.getName(node);
|
|
69
|
-
|
|
70
64
|
if (anchor) {
|
|
71
65
|
if (/\d$/.test(anchor)) {
|
|
72
66
|
const alt = anchor.replace(/\d$/, '');
|
|
73
67
|
if (doc.anchors.getNode(alt)) anchor = alt;
|
|
74
68
|
}
|
|
75
|
-
|
|
76
69
|
props = ` &${anchor}`;
|
|
77
70
|
}
|
|
78
|
-
|
|
79
71
|
if (node.cstNode && node.cstNode.tag) {
|
|
80
72
|
const {
|
|
81
73
|
handle,
|
|
@@ -83,76 +75,68 @@ function addEvents(events, doc, e, node) {
|
|
|
83
75
|
} = node.cstNode.tag;
|
|
84
76
|
props += handle === '!' && !suffix ? ' <!>' : ` <${node.tag}>`;
|
|
85
77
|
}
|
|
86
|
-
|
|
87
78
|
let scalar = null;
|
|
88
|
-
|
|
89
79
|
switch (node.type) {
|
|
90
80
|
case 'ALIAS':
|
|
91
81
|
{
|
|
92
82
|
let alias = doc.anchors.getName(node.source);
|
|
93
|
-
|
|
94
83
|
if (/\d$/.test(alias)) {
|
|
95
84
|
const alt = alias.replace(/\d$/, '');
|
|
96
85
|
if (doc.anchors.getNode(alt)) alias = alt;
|
|
97
86
|
}
|
|
98
|
-
|
|
99
87
|
events.push(`=ALI${props} *${alias}`);
|
|
100
88
|
}
|
|
101
89
|
break;
|
|
102
|
-
|
|
103
90
|
case 'BLOCK_FOLDED':
|
|
104
91
|
scalar = '>';
|
|
105
92
|
break;
|
|
106
|
-
|
|
107
93
|
case 'BLOCK_LITERAL':
|
|
108
94
|
scalar = '|';
|
|
109
95
|
break;
|
|
110
|
-
|
|
111
96
|
case 'PLAIN':
|
|
112
97
|
scalar = ':';
|
|
113
98
|
break;
|
|
114
|
-
|
|
115
99
|
case 'QUOTE_DOUBLE':
|
|
116
100
|
scalar = '"';
|
|
117
101
|
break;
|
|
118
|
-
|
|
119
102
|
case 'QUOTE_SINGLE':
|
|
120
103
|
scalar = "'";
|
|
121
104
|
break;
|
|
122
|
-
|
|
123
105
|
case 'PAIR':
|
|
124
106
|
events.push(`+MAP${props}`);
|
|
125
107
|
addEvents(events, doc, e, node.key);
|
|
126
108
|
addEvents(events, doc, e, node.value);
|
|
127
109
|
events.push('-MAP');
|
|
128
110
|
break;
|
|
129
|
-
|
|
130
111
|
case 'FLOW_SEQ':
|
|
131
112
|
case 'SEQ':
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
113
|
+
{
|
|
114
|
+
const ev = node.type === 'FLOW_SEQ' ? '+SEQ []' : '+SEQ';
|
|
115
|
+
events.push(`${ev}${props}`);
|
|
116
|
+
node.items.forEach(item => {
|
|
117
|
+
addEvents(events, doc, e, item);
|
|
118
|
+
});
|
|
119
|
+
events.push('-SEQ');
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
139
122
|
case 'FLOW_MAP':
|
|
140
123
|
case 'MAP':
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
124
|
+
{
|
|
125
|
+
const ev = node.type === 'FLOW_SEQ' ? '+MAP {}' : '+MAP';
|
|
126
|
+
events.push(`${ev}${props}`);
|
|
127
|
+
node.items.forEach(({
|
|
128
|
+
key,
|
|
129
|
+
value
|
|
130
|
+
}) => {
|
|
131
|
+
addEvents(events, doc, e, key);
|
|
132
|
+
addEvents(events, doc, e, value);
|
|
133
|
+
});
|
|
134
|
+
events.push('-MAP');
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
152
137
|
default:
|
|
153
138
|
throw new Error(`Unexpected node type ${node.type}`);
|
|
154
139
|
}
|
|
155
|
-
|
|
156
140
|
if (scalar) {
|
|
157
141
|
const value = node.cstNode.strValue.replace(/\\/g, '\\\\').replace(/\0/g, '\\0').replace(/\x07/g, '\\a').replace(/\x08/g, '\\b').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\v/g, '\\v').replace(/\f/g, '\\f').replace(/\r/g, '\\r').replace(/\x1b/g, '\\e');
|
|
158
142
|
events.push(`=VAL${props} ${scalar}${value}`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var resolveSeq = require('./resolveSeq-
|
|
4
|
-
var Schema = require('./Schema-
|
|
5
|
-
require('./PlainValue-
|
|
6
|
-
require('./warnings-
|
|
3
|
+
var resolveSeq = require('./resolveSeq-95613e94.js');
|
|
4
|
+
var Schema = require('./Schema-bcc6c2d7.js');
|
|
5
|
+
require('./PlainValue-516d5bc2.js');
|
|
6
|
+
require('./warnings-793925ce.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var PlainValue = require('./PlainValue-
|
|
4
|
-
var resolveSeq = require('./resolveSeq-
|
|
3
|
+
var PlainValue = require('./PlainValue-516d5bc2.js');
|
|
4
|
+
var resolveSeq = require('./resolveSeq-95613e94.js');
|
|
5
5
|
|
|
6
6
|
/* global atob, btoa, Buffer */
|
|
7
7
|
const binary = {
|
|
@@ -9,7 +9,6 @@ const binary = {
|
|
|
9
9
|
// Buffer inherits from Uint8Array
|
|
10
10
|
default: false,
|
|
11
11
|
tag: 'tag:yaml.org,2002:binary',
|
|
12
|
-
|
|
13
12
|
/**
|
|
14
13
|
* Returns a Buffer in node and an Uint8Array in browsers
|
|
15
14
|
*
|
|
@@ -20,16 +19,13 @@ const binary = {
|
|
|
20
19
|
*/
|
|
21
20
|
resolve: (doc, node) => {
|
|
22
21
|
const src = resolveSeq.resolveString(doc, node);
|
|
23
|
-
|
|
24
22
|
if (typeof Buffer === 'function') {
|
|
25
23
|
return Buffer.from(src, 'base64');
|
|
26
24
|
} else if (typeof atob === 'function') {
|
|
27
25
|
// On IE 11, atob() can't handle newlines
|
|
28
26
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
29
27
|
const buffer = new Uint8Array(str.length);
|
|
30
|
-
|
|
31
28
|
for (let i = 0; i < str.length; ++i) buffer[i] = str.charCodeAt(i);
|
|
32
|
-
|
|
33
29
|
return buffer;
|
|
34
30
|
} else {
|
|
35
31
|
const msg = 'This environment does not support reading binary tags; either Buffer or atob is required';
|
|
@@ -44,21 +40,16 @@ const binary = {
|
|
|
44
40
|
value
|
|
45
41
|
}, ctx, onComment, onChompKeep) => {
|
|
46
42
|
let src;
|
|
47
|
-
|
|
48
43
|
if (typeof Buffer === 'function') {
|
|
49
44
|
src = value instanceof Buffer ? value.toString('base64') : Buffer.from(value.buffer).toString('base64');
|
|
50
45
|
} else if (typeof btoa === 'function') {
|
|
51
46
|
let s = '';
|
|
52
|
-
|
|
53
47
|
for (let i = 0; i < value.length; ++i) s += String.fromCharCode(value[i]);
|
|
54
|
-
|
|
55
48
|
src = btoa(s);
|
|
56
49
|
} else {
|
|
57
50
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
58
51
|
}
|
|
59
|
-
|
|
60
52
|
if (!type) type = resolveSeq.binaryOptions.defaultType;
|
|
61
|
-
|
|
62
53
|
if (type === PlainValue.Type.QUOTE_DOUBLE) {
|
|
63
54
|
value = src;
|
|
64
55
|
} else {
|
|
@@ -67,14 +58,11 @@ const binary = {
|
|
|
67
58
|
} = resolveSeq.binaryOptions;
|
|
68
59
|
const n = Math.ceil(src.length / lineWidth);
|
|
69
60
|
const lines = new Array(n);
|
|
70
|
-
|
|
71
61
|
for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
|
|
72
62
|
lines[i] = src.substr(o, lineWidth);
|
|
73
63
|
}
|
|
74
|
-
|
|
75
64
|
value = lines.join(type === PlainValue.Type.BLOCK_LITERAL ? '\n' : ' ');
|
|
76
65
|
}
|
|
77
|
-
|
|
78
66
|
return resolveSeq.stringifyString({
|
|
79
67
|
comment,
|
|
80
68
|
type,
|
|
@@ -85,7 +73,6 @@ const binary = {
|
|
|
85
73
|
|
|
86
74
|
function parsePairs(doc, cst) {
|
|
87
75
|
const seq = resolveSeq.resolveSeq(doc, cst);
|
|
88
|
-
|
|
89
76
|
for (let i = 0; i < seq.items.length; ++i) {
|
|
90
77
|
let item = seq.items[i];
|
|
91
78
|
if (item instanceof resolveSeq.Pair) continue;else if (item instanceof resolveSeq.YAMLMap) {
|
|
@@ -93,7 +80,6 @@ function parsePairs(doc, cst) {
|
|
|
93
80
|
const msg = 'Each pair must have its own sequence indicator';
|
|
94
81
|
throw new PlainValue.YAMLSemanticError(cst, msg);
|
|
95
82
|
}
|
|
96
|
-
|
|
97
83
|
const pair = item.items[0] || new resolveSeq.Pair();
|
|
98
84
|
if (item.commentBefore) pair.commentBefore = pair.commentBefore ? `${item.commentBefore}\n${pair.commentBefore}` : item.commentBefore;
|
|
99
85
|
if (item.comment) pair.comment = pair.comment ? `${item.comment}\n${pair.comment}` : item.comment;
|
|
@@ -101,16 +87,13 @@ function parsePairs(doc, cst) {
|
|
|
101
87
|
}
|
|
102
88
|
seq.items[i] = item instanceof resolveSeq.Pair ? item : new resolveSeq.Pair(item);
|
|
103
89
|
}
|
|
104
|
-
|
|
105
90
|
return seq;
|
|
106
91
|
}
|
|
107
92
|
function createPairs(schema, iterable, ctx) {
|
|
108
93
|
const pairs = new resolveSeq.YAMLSeq(schema);
|
|
109
94
|
pairs.tag = 'tag:yaml.org,2002:pairs';
|
|
110
|
-
|
|
111
95
|
for (const it of iterable) {
|
|
112
96
|
let key, value;
|
|
113
|
-
|
|
114
97
|
if (Array.isArray(it)) {
|
|
115
98
|
if (it.length === 2) {
|
|
116
99
|
key = it[0];
|
|
@@ -118,7 +101,6 @@ function createPairs(schema, iterable, ctx) {
|
|
|
118
101
|
} else throw new TypeError(`Expected [key, value] tuple: ${it}`);
|
|
119
102
|
} else if (it && it instanceof Object) {
|
|
120
103
|
const keys = Object.keys(it);
|
|
121
|
-
|
|
122
104
|
if (keys.length === 1) {
|
|
123
105
|
key = keys[0];
|
|
124
106
|
value = it[key];
|
|
@@ -126,11 +108,9 @@ function createPairs(schema, iterable, ctx) {
|
|
|
126
108
|
} else {
|
|
127
109
|
key = it;
|
|
128
110
|
}
|
|
129
|
-
|
|
130
111
|
const pair = schema.createPair(key, value, ctx);
|
|
131
112
|
pairs.items.push(pair);
|
|
132
113
|
}
|
|
133
|
-
|
|
134
114
|
return pairs;
|
|
135
115
|
}
|
|
136
116
|
const pairs = {
|
|
@@ -143,49 +123,34 @@ const pairs = {
|
|
|
143
123
|
class YAMLOMap extends resolveSeq.YAMLSeq {
|
|
144
124
|
constructor() {
|
|
145
125
|
super();
|
|
146
|
-
|
|
147
126
|
PlainValue._defineProperty(this, "add", resolveSeq.YAMLMap.prototype.add.bind(this));
|
|
148
|
-
|
|
149
127
|
PlainValue._defineProperty(this, "delete", resolveSeq.YAMLMap.prototype.delete.bind(this));
|
|
150
|
-
|
|
151
128
|
PlainValue._defineProperty(this, "get", resolveSeq.YAMLMap.prototype.get.bind(this));
|
|
152
|
-
|
|
153
129
|
PlainValue._defineProperty(this, "has", resolveSeq.YAMLMap.prototype.has.bind(this));
|
|
154
|
-
|
|
155
130
|
PlainValue._defineProperty(this, "set", resolveSeq.YAMLMap.prototype.set.bind(this));
|
|
156
|
-
|
|
157
131
|
this.tag = YAMLOMap.tag;
|
|
158
132
|
}
|
|
159
|
-
|
|
160
133
|
toJSON(_, ctx) {
|
|
161
134
|
const map = new Map();
|
|
162
135
|
if (ctx && ctx.onCreate) ctx.onCreate(map);
|
|
163
|
-
|
|
164
136
|
for (const pair of this.items) {
|
|
165
137
|
let key, value;
|
|
166
|
-
|
|
167
138
|
if (pair instanceof resolveSeq.Pair) {
|
|
168
139
|
key = resolveSeq.toJSON(pair.key, '', ctx);
|
|
169
140
|
value = resolveSeq.toJSON(pair.value, key, ctx);
|
|
170
141
|
} else {
|
|
171
142
|
key = resolveSeq.toJSON(pair, '', ctx);
|
|
172
143
|
}
|
|
173
|
-
|
|
174
144
|
if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');
|
|
175
145
|
map.set(key, value);
|
|
176
146
|
}
|
|
177
|
-
|
|
178
147
|
return map;
|
|
179
148
|
}
|
|
180
|
-
|
|
181
149
|
}
|
|
182
|
-
|
|
183
150
|
PlainValue._defineProperty(YAMLOMap, "tag", 'tag:yaml.org,2002:omap');
|
|
184
|
-
|
|
185
151
|
function parseOMap(doc, cst) {
|
|
186
152
|
const pairs = parsePairs(doc, cst);
|
|
187
153
|
const seenKeys = [];
|
|
188
|
-
|
|
189
154
|
for (const {
|
|
190
155
|
key
|
|
191
156
|
} of pairs.items) {
|
|
@@ -198,17 +163,14 @@ function parseOMap(doc, cst) {
|
|
|
198
163
|
}
|
|
199
164
|
}
|
|
200
165
|
}
|
|
201
|
-
|
|
202
166
|
return Object.assign(new YAMLOMap(), pairs);
|
|
203
167
|
}
|
|
204
|
-
|
|
205
168
|
function createOMap(schema, iterable, ctx) {
|
|
206
169
|
const pairs = createPairs(schema, iterable, ctx);
|
|
207
170
|
const omap = new YAMLOMap();
|
|
208
171
|
omap.items = pairs.items;
|
|
209
172
|
return omap;
|
|
210
173
|
}
|
|
211
|
-
|
|
212
174
|
const omap = {
|
|
213
175
|
identify: value => value instanceof Map,
|
|
214
176
|
nodeClass: YAMLOMap,
|
|
@@ -223,56 +185,43 @@ class YAMLSet extends resolveSeq.YAMLMap {
|
|
|
223
185
|
super();
|
|
224
186
|
this.tag = YAMLSet.tag;
|
|
225
187
|
}
|
|
226
|
-
|
|
227
188
|
add(key) {
|
|
228
189
|
const pair = key instanceof resolveSeq.Pair ? key : new resolveSeq.Pair(key);
|
|
229
190
|
const prev = resolveSeq.findPair(this.items, pair.key);
|
|
230
191
|
if (!prev) this.items.push(pair);
|
|
231
192
|
}
|
|
232
|
-
|
|
233
193
|
get(key, keepPair) {
|
|
234
194
|
const pair = resolveSeq.findPair(this.items, key);
|
|
235
195
|
return !keepPair && pair instanceof resolveSeq.Pair ? pair.key instanceof resolveSeq.Scalar ? pair.key.value : pair.key : pair;
|
|
236
196
|
}
|
|
237
|
-
|
|
238
197
|
set(key, value) {
|
|
239
198
|
if (typeof value !== 'boolean') throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
|
|
240
199
|
const prev = resolveSeq.findPair(this.items, key);
|
|
241
|
-
|
|
242
200
|
if (prev && !value) {
|
|
243
201
|
this.items.splice(this.items.indexOf(prev), 1);
|
|
244
202
|
} else if (!prev && value) {
|
|
245
203
|
this.items.push(new resolveSeq.Pair(key));
|
|
246
204
|
}
|
|
247
205
|
}
|
|
248
|
-
|
|
249
206
|
toJSON(_, ctx) {
|
|
250
207
|
return super.toJSON(_, ctx, Set);
|
|
251
208
|
}
|
|
252
|
-
|
|
253
209
|
toString(ctx, onComment, onChompKeep) {
|
|
254
210
|
if (!ctx) return JSON.stringify(this);
|
|
255
211
|
if (this.hasAllNullValues()) return super.toString(ctx, onComment, onChompKeep);else throw new Error('Set items must all have null values');
|
|
256
212
|
}
|
|
257
|
-
|
|
258
213
|
}
|
|
259
|
-
|
|
260
214
|
PlainValue._defineProperty(YAMLSet, "tag", 'tag:yaml.org,2002:set');
|
|
261
|
-
|
|
262
215
|
function parseSet(doc, cst) {
|
|
263
216
|
const map = resolveSeq.resolveMap(doc, cst);
|
|
264
217
|
if (!map.hasAllNullValues()) throw new PlainValue.YAMLSemanticError(cst, 'Set items must all have null values');
|
|
265
218
|
return Object.assign(new YAMLSet(), map);
|
|
266
219
|
}
|
|
267
|
-
|
|
268
220
|
function createSet(schema, iterable, ctx) {
|
|
269
221
|
const set = new YAMLSet();
|
|
270
|
-
|
|
271
222
|
for (const value of iterable) set.items.push(schema.createPair(value, null, ctx));
|
|
272
|
-
|
|
273
223
|
return set;
|
|
274
224
|
}
|
|
275
|
-
|
|
276
225
|
const set = {
|
|
277
226
|
identify: value => value instanceof Set,
|
|
278
227
|
nodeClass: YAMLSet,
|
|
@@ -285,38 +234,32 @@ const set = {
|
|
|
285
234
|
const parseSexagesimal = (sign, parts) => {
|
|
286
235
|
const n = parts.split(':').reduce((n, p) => n * 60 + Number(p), 0);
|
|
287
236
|
return sign === '-' ? -n : n;
|
|
288
|
-
};
|
|
289
|
-
|
|
237
|
+
};
|
|
290
238
|
|
|
239
|
+
// hhhh:mm:ss.sss
|
|
291
240
|
const stringifySexagesimal = ({
|
|
292
241
|
value
|
|
293
242
|
}) => {
|
|
294
243
|
if (isNaN(value) || !isFinite(value)) return resolveSeq.stringifyNumber(value);
|
|
295
244
|
let sign = '';
|
|
296
|
-
|
|
297
245
|
if (value < 0) {
|
|
298
246
|
sign = '-';
|
|
299
247
|
value = Math.abs(value);
|
|
300
248
|
}
|
|
301
|
-
|
|
302
249
|
const parts = [value % 60]; // seconds, including ms
|
|
303
|
-
|
|
304
250
|
if (value < 60) {
|
|
305
251
|
parts.unshift(0); // at least one : is required
|
|
306
252
|
} else {
|
|
307
253
|
value = Math.round((value - parts[0]) / 60);
|
|
308
254
|
parts.unshift(value % 60); // minutes
|
|
309
|
-
|
|
310
255
|
if (value >= 60) {
|
|
311
256
|
value = Math.round((value - parts[0]) / 60);
|
|
312
257
|
parts.unshift(value); // hours
|
|
313
258
|
}
|
|
314
259
|
}
|
|
315
|
-
|
|
316
260
|
return sign + parts.map(n => n < 10 ? '0' + String(n) : String(n)).join(':').replace(/000000\d*$/, '') // % 60 may introduce error
|
|
317
|
-
|
|
261
|
+
;
|
|
318
262
|
};
|
|
319
|
-
|
|
320
263
|
const intTime = {
|
|
321
264
|
identify: value => typeof value === 'number',
|
|
322
265
|
default: true,
|
|
@@ -342,21 +285,23 @@ const timestamp = {
|
|
|
342
285
|
// If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
|
|
343
286
|
// may be omitted altogether, resulting in a date format. In such a case, the time part is
|
|
344
287
|
// assumed to be 00:00:00Z (start of day, UTC).
|
|
345
|
-
test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' +
|
|
346
|
-
|
|
347
|
-
'(
|
|
348
|
-
|
|
288
|
+
test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' +
|
|
289
|
+
// YYYY-Mm-Dd
|
|
290
|
+
'(?:(?:t|T|[ \\t]+)' +
|
|
291
|
+
// t | T | whitespace
|
|
292
|
+
'([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' +
|
|
293
|
+
// Hh:Mm:Ss(.ss)?
|
|
294
|
+
'(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' +
|
|
295
|
+
// Z | +5 | -03:30
|
|
349
296
|
')?' + ')$'),
|
|
350
297
|
resolve: (str, year, month, day, hour, minute, second, millisec, tz) => {
|
|
351
298
|
if (millisec) millisec = (millisec + '00').substr(1, 3);
|
|
352
299
|
let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);
|
|
353
|
-
|
|
354
300
|
if (tz && tz !== 'Z') {
|
|
355
301
|
let d = parseSexagesimal(tz[0], tz.slice(1));
|
|
356
302
|
if (Math.abs(d) < 30) d *= 60;
|
|
357
303
|
date -= 60000 * d;
|
|
358
304
|
}
|
|
359
|
-
|
|
360
305
|
return new Date(date);
|
|
361
306
|
},
|
|
362
307
|
stringify: ({
|
|
@@ -365,23 +310,21 @@ const timestamp = {
|
|
|
365
310
|
};
|
|
366
311
|
|
|
367
312
|
/* global console, process, YAML_SILENCE_DEPRECATION_WARNINGS, YAML_SILENCE_WARNINGS */
|
|
313
|
+
|
|
368
314
|
function shouldWarn(deprecation) {
|
|
369
315
|
const env = typeof process !== 'undefined' && process.env || {};
|
|
370
|
-
|
|
371
316
|
if (deprecation) {
|
|
372
317
|
if (typeof YAML_SILENCE_DEPRECATION_WARNINGS !== 'undefined') return !YAML_SILENCE_DEPRECATION_WARNINGS;
|
|
373
318
|
return !env.YAML_SILENCE_DEPRECATION_WARNINGS;
|
|
374
319
|
}
|
|
375
|
-
|
|
376
320
|
if (typeof YAML_SILENCE_WARNINGS !== 'undefined') return !YAML_SILENCE_WARNINGS;
|
|
377
321
|
return !env.YAML_SILENCE_WARNINGS;
|
|
378
322
|
}
|
|
379
|
-
|
|
380
323
|
function warn(warning, type) {
|
|
381
324
|
if (shouldWarn(false)) {
|
|
382
|
-
const emit = typeof process !== 'undefined' && process.emitWarning;
|
|
325
|
+
const emit = typeof process !== 'undefined' && process.emitWarning;
|
|
326
|
+
// This will throw in Jest if `warning` is an Error instance due to
|
|
383
327
|
// https://github.com/facebook/jest/issues/2549
|
|
384
|
-
|
|
385
328
|
if (emit) emit(warning, type);else {
|
|
386
329
|
// eslint-disable-next-line no-console
|
|
387
330
|
console.warn(type ? `${type}: ${warning}` : warning);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaml",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Eemeli Aro <eemeli@gmail.com>",
|
|
6
6
|
"repository": "github:eemeli/yaml",
|
|
@@ -72,8 +72,7 @@
|
|
|
72
72
|
"docs:install": "cd docs-slate && bundle install",
|
|
73
73
|
"docs:deploy": "cd docs-slate && ./deploy.sh",
|
|
74
74
|
"docs": "cd docs-slate && bundle exec middleman server",
|
|
75
|
-
"preversion": "npm test && npm run build"
|
|
76
|
-
"prepublishOnly": "npm run clean && npm test && npm run build"
|
|
75
|
+
"preversion": "npm test && npm run build"
|
|
77
76
|
},
|
|
78
77
|
"browserslist": "> 0.5%, not dead",
|
|
79
78
|
"prettier": {
|
package/package.json
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"constructs": "^10"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"yaml": "^1.10.
|
|
76
|
+
"yaml": "^1.10.3"
|
|
77
77
|
},
|
|
78
78
|
"bundledDependencies": [
|
|
79
79
|
"yaml"
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"access": "public"
|
|
97
97
|
},
|
|
98
|
-
"version": "0.1.
|
|
98
|
+
"version": "0.1.408",
|
|
99
99
|
"jest": {
|
|
100
100
|
"coverageProvider": "v8",
|
|
101
101
|
"testMatch": [
|