cborg 1.5.3 → 1.6.2
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/README.md +1 -0
- package/cjs/browser-test/node-test-bin.js +58 -0
- package/cjs/browser-test/test-7float.js +16 -0
- package/cjs/browser-test/test-cbor-vectors.js +15 -4
- package/cjs/lib/7float.js +2 -0
- package/cjs/lib/diagnostic.js +6 -7
- package/cjs/node-test/node-test-bin.js +58 -0
- package/cjs/node-test/test-7float.js +16 -0
- package/cjs/node-test/test-cbor-vectors.js +15 -4
- package/esm/browser-test/node-test-bin.js +58 -0
- package/esm/browser-test/test-7float.js +16 -0
- package/esm/browser-test/test-cbor-vectors.js +13 -2
- package/esm/lib/7float.js +2 -0
- package/esm/lib/diagnostic.js +6 -7
- package/esm/node-test/node-test-bin.js +58 -0
- package/esm/node-test/test-7float.js +16 -0
- package/esm/node-test/test-cbor-vectors.js +13 -2
- package/interface.ts +1 -0
- package/lib/7float.js +2 -0
- package/lib/diagnostic.js +6 -7
- package/package.json +15 -11
- package/test/node-test-bin.js +61 -0
- package/test/test-7float.js +9 -0
- package/test/test-cbor-vectors.js +13 -1
- package/types/interface.d.ts +1 -0
- package/types/interface.d.ts.map +1 -1
- package/types/lib/7float.d.ts.map +1 -1
- package/types/lib/diagnostic.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,7 @@ Decode valid CBOR bytes from a `Uint8Array` (or `Buffer`) and return a JavaScrip
|
|
|
143
143
|
|
|
144
144
|
* `allowIndefinite` (boolean, default `true`): when the indefinite length additional information (`31`) is encountered for any type (arrays, maps, strings, bytes) _or_ a "break" is encountered, an error will be thrown.
|
|
145
145
|
* `allowUndefined` (boolean, default `true`): when major 7, minor 23 (`undefined`) is encountered, an error will be thrown. To disallow `undefined` on encode, a custom [type encoder](#type-encoders) for `'undefined'` will need to be supplied.
|
|
146
|
+
* `coerceUndefinedToNull` (boolean, default `false`): when both `allowUndefined` and `coerceUndefinedToNull` are set to `true`, all `undefined` tokens (major `7` minor `23`: `0xf7`) will be coerced to `null` tokens, such that `undefined` is an allowed token but will not appear in decoded values.
|
|
146
147
|
* `allowInfinity` (boolean, default `true`): when an IEEE 754 `Infinity` or `-Infinity` value is encountered when decoding a major 7, an error will be thrown. To disallow `Infinity` and `-Infinity` on encode, a custom [type encoder](#type-encoders) for `'number'` will need to be supplied.
|
|
147
148
|
* `allowNaN` (boolean, default `true`): when an IEEE 754 `NaN` value is encountered when decoding a major 7, an error will be thrown. To disallow `NaN` on encode, a custom [type encoder](#type-encoders) for `'number'` will need to be supplied.
|
|
148
149
|
* `allowBigInt` (boolean, default `true`): when an integer outside of the safe integer range is encountered, an error will be thrown. To disallow `BigInt`s on encode, a custom [type encoder](#type-encoders) for `'bigint'` will need to be supplied.
|
|
@@ -219,4 +219,62 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
219
219
|
assert.strictEqual(stderr, '');
|
|
220
220
|
assert.strictEqual(stdout, 'a3616101616282020365736d696c6564f09f9880\n');
|
|
221
221
|
});
|
|
222
|
+
it('diag indenting', async () => {
|
|
223
|
+
const {stdout, stderr} = await execBin('json2diag', '{"a":[],"b":{},"c":{"a":1,"b":{"a":{"a":{}}}},"d":{"a":{"a":{"a":1},"b":2,"c":[]}},"e":[[[[{"a":{}}]]]],"f":1}');
|
|
224
|
+
assert.strictEqual(stderr, '');
|
|
225
|
+
assert.strictEqual(stdout, `a6 # map(6)
|
|
226
|
+
61 # string(1)
|
|
227
|
+
61 # "a"
|
|
228
|
+
80 # array(0)
|
|
229
|
+
61 # string(1)
|
|
230
|
+
62 # "b"
|
|
231
|
+
a0 # map(0)
|
|
232
|
+
61 # string(1)
|
|
233
|
+
63 # "c"
|
|
234
|
+
a2 # map(2)
|
|
235
|
+
61 # string(1)
|
|
236
|
+
61 # "a"
|
|
237
|
+
01 # uint(1)
|
|
238
|
+
61 # string(1)
|
|
239
|
+
62 # "b"
|
|
240
|
+
a1 # map(1)
|
|
241
|
+
61 # string(1)
|
|
242
|
+
61 # "a"
|
|
243
|
+
a1 # map(1)
|
|
244
|
+
61 # string(1)
|
|
245
|
+
61 # "a"
|
|
246
|
+
a0 # map(0)
|
|
247
|
+
61 # string(1)
|
|
248
|
+
64 # "d"
|
|
249
|
+
a1 # map(1)
|
|
250
|
+
61 # string(1)
|
|
251
|
+
61 # "a"
|
|
252
|
+
a3 # map(3)
|
|
253
|
+
61 # string(1)
|
|
254
|
+
61 # "a"
|
|
255
|
+
a1 # map(1)
|
|
256
|
+
61 # string(1)
|
|
257
|
+
61 # "a"
|
|
258
|
+
01 # uint(1)
|
|
259
|
+
61 # string(1)
|
|
260
|
+
62 # "b"
|
|
261
|
+
02 # uint(2)
|
|
262
|
+
61 # string(1)
|
|
263
|
+
63 # "c"
|
|
264
|
+
80 # array(0)
|
|
265
|
+
61 # string(1)
|
|
266
|
+
65 # "e"
|
|
267
|
+
81 # array(1)
|
|
268
|
+
81 # array(1)
|
|
269
|
+
81 # array(1)
|
|
270
|
+
81 # array(1)
|
|
271
|
+
a1 # map(1)
|
|
272
|
+
61 # string(1)
|
|
273
|
+
61 # "a"
|
|
274
|
+
a0 # map(0)
|
|
275
|
+
61 # string(1)
|
|
276
|
+
66 # "f"
|
|
277
|
+
01 # uint(1)
|
|
278
|
+
`);
|
|
279
|
+
});
|
|
222
280
|
});
|
|
@@ -198,6 +198,8 @@ describe('float', () => {
|
|
|
198
198
|
]), { allowIndefinite: false }), /indefinite/);
|
|
199
199
|
});
|
|
200
200
|
it('can switch off undefined support', () => {
|
|
201
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('f7')), undefined);
|
|
202
|
+
assert.throws(() => decode.decode(byteUtils.fromHex('f7'), { allowUndefined: false }), /undefined/);
|
|
201
203
|
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f7')), [
|
|
202
204
|
1,
|
|
203
205
|
2,
|
|
@@ -205,6 +207,20 @@ describe('float', () => {
|
|
|
205
207
|
]);
|
|
206
208
|
assert.throws(() => decode.decode(byteUtils.fromHex('830102f7'), { allowUndefined: false }), /undefined/);
|
|
207
209
|
});
|
|
210
|
+
it('can coerce undefined to null', () => {
|
|
211
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('f7'), { coerceUndefinedToNull: false }), undefined);
|
|
212
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('f7'), { coerceUndefinedToNull: true }), null);
|
|
213
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f7'), { coerceUndefinedToNull: false }), [
|
|
214
|
+
1,
|
|
215
|
+
2,
|
|
216
|
+
undefined
|
|
217
|
+
]);
|
|
218
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f7'), { coerceUndefinedToNull: true }), [
|
|
219
|
+
1,
|
|
220
|
+
2,
|
|
221
|
+
null
|
|
222
|
+
]);
|
|
223
|
+
});
|
|
208
224
|
it('can switch off Infinity support', () => {
|
|
209
225
|
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f97c00')), [
|
|
210
226
|
1,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chai = require('chai');
|
|
4
|
-
var util = require('util');
|
|
5
4
|
require('../cborg.js');
|
|
6
5
|
var taglib = require('../taglib.js');
|
|
7
6
|
var byteUtils = require('../lib/byte-utils.js');
|
|
@@ -56,7 +55,7 @@ describe('cbor/test-vectors', () => {
|
|
|
56
55
|
if (typeof expected === 'string' && expected.startsWith('h\'')) {
|
|
57
56
|
expected = byteUtils.fromHex(expected.replace(/(^h)'|('$)/g, ''));
|
|
58
57
|
}
|
|
59
|
-
it(`test vector #${ i }: ${
|
|
58
|
+
it(`test vector #${ i }: ${ inspect(expected).replace(/\n\s*/g, '') }`, () => {
|
|
60
59
|
if (fixture.error) {
|
|
61
60
|
assert.throws(() => decode.decode(u8a, { tags }), fixture.error);
|
|
62
61
|
} else {
|
|
@@ -65,10 +64,10 @@ describe('cbor/test-vectors', () => {
|
|
|
65
64
|
}
|
|
66
65
|
let actual = decode.decode(u8a, { tags });
|
|
67
66
|
if (typeof actual === 'bigint') {
|
|
68
|
-
actual =
|
|
67
|
+
actual = inspect(actual);
|
|
69
68
|
}
|
|
70
69
|
if (typeof expected === 'bigint') {
|
|
71
|
-
expected =
|
|
70
|
+
expected = inspect(expected);
|
|
72
71
|
}
|
|
73
72
|
assert.deepEqual(actual, expected);
|
|
74
73
|
if (fixture.roundtrip) {
|
|
@@ -85,3 +84,15 @@ describe('cbor/test-vectors', () => {
|
|
|
85
84
|
it.skip('encode w/ tags', () => {
|
|
86
85
|
});
|
|
87
86
|
});
|
|
87
|
+
function inspect(o) {
|
|
88
|
+
if (typeof o === 'string') {
|
|
89
|
+
return `'${ o }'`;
|
|
90
|
+
}
|
|
91
|
+
if (o instanceof Uint8Array) {
|
|
92
|
+
return `Uint8Array<${ o.join(',') }>`;
|
|
93
|
+
}
|
|
94
|
+
if (o == null || typeof o !== 'object') {
|
|
95
|
+
return String(o);
|
|
96
|
+
}
|
|
97
|
+
return JSON.stringify(o);
|
|
98
|
+
}
|
package/cjs/lib/7float.js
CHANGED
|
@@ -13,6 +13,8 @@ const MINOR_UNDEFINED = 23;
|
|
|
13
13
|
function decodeUndefined(_data, _pos, _minor, options) {
|
|
14
14
|
if (options.allowUndefined === false) {
|
|
15
15
|
throw new Error(`${ common.decodeErrPrefix } undefined values are not supported`);
|
|
16
|
+
} else if (options.coerceUndefinedToNull === true) {
|
|
17
|
+
return new token.Token(token.Type.null, null, 1);
|
|
16
18
|
}
|
|
17
19
|
return new token.Token(token.Type.undefined, undefined, 1);
|
|
18
20
|
}
|
package/cjs/lib/diagnostic.js
CHANGED
|
@@ -49,6 +49,9 @@ function* tokensToDiagnostic(inp, width = 100) {
|
|
|
49
49
|
yield `${ margin }${ byteUtils.toHex(piece) }`.padEnd(width / 2, ' ') + `# ${ margin }"${ st }"`;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
if (indent.length) {
|
|
53
|
+
indent[indent.length - 1]--;
|
|
54
|
+
}
|
|
52
55
|
if (!token.type.terminal) {
|
|
53
56
|
switch (token.type.name) {
|
|
54
57
|
case 'map':
|
|
@@ -63,13 +66,9 @@ function* tokensToDiagnostic(inp, width = 100) {
|
|
|
63
66
|
default:
|
|
64
67
|
throw new Error(`Unknown token type '${ token.type.name }'`);
|
|
65
68
|
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (indent[indent.length - 1] === 0) {
|
|
70
|
-
indent.pop();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
69
|
+
}
|
|
70
|
+
while (indent.length && indent[indent.length - 1] <= 0) {
|
|
71
|
+
indent.pop();
|
|
73
72
|
}
|
|
74
73
|
pos += token.encodedLength;
|
|
75
74
|
}
|
|
@@ -219,4 +219,62 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
219
219
|
assert.strictEqual(stderr, '');
|
|
220
220
|
assert.strictEqual(stdout, 'a3616101616282020365736d696c6564f09f9880\n');
|
|
221
221
|
});
|
|
222
|
+
it('diag indenting', async () => {
|
|
223
|
+
const {stdout, stderr} = await execBin('json2diag', '{"a":[],"b":{},"c":{"a":1,"b":{"a":{"a":{}}}},"d":{"a":{"a":{"a":1},"b":2,"c":[]}},"e":[[[[{"a":{}}]]]],"f":1}');
|
|
224
|
+
assert.strictEqual(stderr, '');
|
|
225
|
+
assert.strictEqual(stdout, `a6 # map(6)
|
|
226
|
+
61 # string(1)
|
|
227
|
+
61 # "a"
|
|
228
|
+
80 # array(0)
|
|
229
|
+
61 # string(1)
|
|
230
|
+
62 # "b"
|
|
231
|
+
a0 # map(0)
|
|
232
|
+
61 # string(1)
|
|
233
|
+
63 # "c"
|
|
234
|
+
a2 # map(2)
|
|
235
|
+
61 # string(1)
|
|
236
|
+
61 # "a"
|
|
237
|
+
01 # uint(1)
|
|
238
|
+
61 # string(1)
|
|
239
|
+
62 # "b"
|
|
240
|
+
a1 # map(1)
|
|
241
|
+
61 # string(1)
|
|
242
|
+
61 # "a"
|
|
243
|
+
a1 # map(1)
|
|
244
|
+
61 # string(1)
|
|
245
|
+
61 # "a"
|
|
246
|
+
a0 # map(0)
|
|
247
|
+
61 # string(1)
|
|
248
|
+
64 # "d"
|
|
249
|
+
a1 # map(1)
|
|
250
|
+
61 # string(1)
|
|
251
|
+
61 # "a"
|
|
252
|
+
a3 # map(3)
|
|
253
|
+
61 # string(1)
|
|
254
|
+
61 # "a"
|
|
255
|
+
a1 # map(1)
|
|
256
|
+
61 # string(1)
|
|
257
|
+
61 # "a"
|
|
258
|
+
01 # uint(1)
|
|
259
|
+
61 # string(1)
|
|
260
|
+
62 # "b"
|
|
261
|
+
02 # uint(2)
|
|
262
|
+
61 # string(1)
|
|
263
|
+
63 # "c"
|
|
264
|
+
80 # array(0)
|
|
265
|
+
61 # string(1)
|
|
266
|
+
65 # "e"
|
|
267
|
+
81 # array(1)
|
|
268
|
+
81 # array(1)
|
|
269
|
+
81 # array(1)
|
|
270
|
+
81 # array(1)
|
|
271
|
+
a1 # map(1)
|
|
272
|
+
61 # string(1)
|
|
273
|
+
61 # "a"
|
|
274
|
+
a0 # map(0)
|
|
275
|
+
61 # string(1)
|
|
276
|
+
66 # "f"
|
|
277
|
+
01 # uint(1)
|
|
278
|
+
`);
|
|
279
|
+
});
|
|
222
280
|
});
|
|
@@ -198,6 +198,8 @@ describe('float', () => {
|
|
|
198
198
|
]), { allowIndefinite: false }), /indefinite/);
|
|
199
199
|
});
|
|
200
200
|
it('can switch off undefined support', () => {
|
|
201
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('f7')), undefined);
|
|
202
|
+
assert.throws(() => decode.decode(byteUtils.fromHex('f7'), { allowUndefined: false }), /undefined/);
|
|
201
203
|
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f7')), [
|
|
202
204
|
1,
|
|
203
205
|
2,
|
|
@@ -205,6 +207,20 @@ describe('float', () => {
|
|
|
205
207
|
]);
|
|
206
208
|
assert.throws(() => decode.decode(byteUtils.fromHex('830102f7'), { allowUndefined: false }), /undefined/);
|
|
207
209
|
});
|
|
210
|
+
it('can coerce undefined to null', () => {
|
|
211
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('f7'), { coerceUndefinedToNull: false }), undefined);
|
|
212
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('f7'), { coerceUndefinedToNull: true }), null);
|
|
213
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f7'), { coerceUndefinedToNull: false }), [
|
|
214
|
+
1,
|
|
215
|
+
2,
|
|
216
|
+
undefined
|
|
217
|
+
]);
|
|
218
|
+
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f7'), { coerceUndefinedToNull: true }), [
|
|
219
|
+
1,
|
|
220
|
+
2,
|
|
221
|
+
null
|
|
222
|
+
]);
|
|
223
|
+
});
|
|
208
224
|
it('can switch off Infinity support', () => {
|
|
209
225
|
assert.deepStrictEqual(decode.decode(byteUtils.fromHex('830102f97c00')), [
|
|
210
226
|
1,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chai = require('chai');
|
|
4
|
-
var util = require('util');
|
|
5
4
|
require('../cborg.js');
|
|
6
5
|
var taglib = require('../taglib.js');
|
|
7
6
|
var byteUtils = require('../lib/byte-utils.js');
|
|
@@ -56,7 +55,7 @@ describe('cbor/test-vectors', () => {
|
|
|
56
55
|
if (typeof expected === 'string' && expected.startsWith('h\'')) {
|
|
57
56
|
expected = byteUtils.fromHex(expected.replace(/(^h)'|('$)/g, ''));
|
|
58
57
|
}
|
|
59
|
-
it(`test vector #${ i }: ${
|
|
58
|
+
it(`test vector #${ i }: ${ inspect(expected).replace(/\n\s*/g, '') }`, () => {
|
|
60
59
|
if (fixture.error) {
|
|
61
60
|
assert.throws(() => decode.decode(u8a, { tags }), fixture.error);
|
|
62
61
|
} else {
|
|
@@ -65,10 +64,10 @@ describe('cbor/test-vectors', () => {
|
|
|
65
64
|
}
|
|
66
65
|
let actual = decode.decode(u8a, { tags });
|
|
67
66
|
if (typeof actual === 'bigint') {
|
|
68
|
-
actual =
|
|
67
|
+
actual = inspect(actual);
|
|
69
68
|
}
|
|
70
69
|
if (typeof expected === 'bigint') {
|
|
71
|
-
expected =
|
|
70
|
+
expected = inspect(expected);
|
|
72
71
|
}
|
|
73
72
|
assert.deepEqual(actual, expected);
|
|
74
73
|
if (fixture.roundtrip) {
|
|
@@ -85,3 +84,15 @@ describe('cbor/test-vectors', () => {
|
|
|
85
84
|
it.skip('encode w/ tags', () => {
|
|
86
85
|
});
|
|
87
86
|
});
|
|
87
|
+
function inspect(o) {
|
|
88
|
+
if (typeof o === 'string') {
|
|
89
|
+
return `'${ o }'`;
|
|
90
|
+
}
|
|
91
|
+
if (o instanceof Uint8Array) {
|
|
92
|
+
return `Uint8Array<${ o.join(',') }>`;
|
|
93
|
+
}
|
|
94
|
+
if (o == null || typeof o !== 'object') {
|
|
95
|
+
return String(o);
|
|
96
|
+
}
|
|
97
|
+
return JSON.stringify(o);
|
|
98
|
+
}
|
|
@@ -210,4 +210,62 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
210
210
|
assert.strictEqual(stderr, '');
|
|
211
211
|
assert.strictEqual(stdout, 'a3616101616282020365736d696c6564f09f9880\n');
|
|
212
212
|
});
|
|
213
|
+
it('diag indenting', async () => {
|
|
214
|
+
const {stdout, stderr} = await execBin('json2diag', '{"a":[],"b":{},"c":{"a":1,"b":{"a":{"a":{}}}},"d":{"a":{"a":{"a":1},"b":2,"c":[]}},"e":[[[[{"a":{}}]]]],"f":1}');
|
|
215
|
+
assert.strictEqual(stderr, '');
|
|
216
|
+
assert.strictEqual(stdout, `a6 # map(6)
|
|
217
|
+
61 # string(1)
|
|
218
|
+
61 # "a"
|
|
219
|
+
80 # array(0)
|
|
220
|
+
61 # string(1)
|
|
221
|
+
62 # "b"
|
|
222
|
+
a0 # map(0)
|
|
223
|
+
61 # string(1)
|
|
224
|
+
63 # "c"
|
|
225
|
+
a2 # map(2)
|
|
226
|
+
61 # string(1)
|
|
227
|
+
61 # "a"
|
|
228
|
+
01 # uint(1)
|
|
229
|
+
61 # string(1)
|
|
230
|
+
62 # "b"
|
|
231
|
+
a1 # map(1)
|
|
232
|
+
61 # string(1)
|
|
233
|
+
61 # "a"
|
|
234
|
+
a1 # map(1)
|
|
235
|
+
61 # string(1)
|
|
236
|
+
61 # "a"
|
|
237
|
+
a0 # map(0)
|
|
238
|
+
61 # string(1)
|
|
239
|
+
64 # "d"
|
|
240
|
+
a1 # map(1)
|
|
241
|
+
61 # string(1)
|
|
242
|
+
61 # "a"
|
|
243
|
+
a3 # map(3)
|
|
244
|
+
61 # string(1)
|
|
245
|
+
61 # "a"
|
|
246
|
+
a1 # map(1)
|
|
247
|
+
61 # string(1)
|
|
248
|
+
61 # "a"
|
|
249
|
+
01 # uint(1)
|
|
250
|
+
61 # string(1)
|
|
251
|
+
62 # "b"
|
|
252
|
+
02 # uint(2)
|
|
253
|
+
61 # string(1)
|
|
254
|
+
63 # "c"
|
|
255
|
+
80 # array(0)
|
|
256
|
+
61 # string(1)
|
|
257
|
+
65 # "e"
|
|
258
|
+
81 # array(1)
|
|
259
|
+
81 # array(1)
|
|
260
|
+
81 # array(1)
|
|
261
|
+
81 # array(1)
|
|
262
|
+
a1 # map(1)
|
|
263
|
+
61 # string(1)
|
|
264
|
+
61 # "a"
|
|
265
|
+
a0 # map(0)
|
|
266
|
+
61 # string(1)
|
|
267
|
+
66 # "f"
|
|
268
|
+
01 # uint(1)
|
|
269
|
+
`);
|
|
270
|
+
});
|
|
213
271
|
});
|
|
@@ -195,6 +195,8 @@ describe('float', () => {
|
|
|
195
195
|
]), { allowIndefinite: false }), /indefinite/);
|
|
196
196
|
});
|
|
197
197
|
it('can switch off undefined support', () => {
|
|
198
|
+
assert.deepStrictEqual(decode(fromHex('f7')), undefined);
|
|
199
|
+
assert.throws(() => decode(fromHex('f7'), { allowUndefined: false }), /undefined/);
|
|
198
200
|
assert.deepStrictEqual(decode(fromHex('830102f7')), [
|
|
199
201
|
1,
|
|
200
202
|
2,
|
|
@@ -202,6 +204,20 @@ describe('float', () => {
|
|
|
202
204
|
]);
|
|
203
205
|
assert.throws(() => decode(fromHex('830102f7'), { allowUndefined: false }), /undefined/);
|
|
204
206
|
});
|
|
207
|
+
it('can coerce undefined to null', () => {
|
|
208
|
+
assert.deepStrictEqual(decode(fromHex('f7'), { coerceUndefinedToNull: false }), undefined);
|
|
209
|
+
assert.deepStrictEqual(decode(fromHex('f7'), { coerceUndefinedToNull: true }), null);
|
|
210
|
+
assert.deepStrictEqual(decode(fromHex('830102f7'), { coerceUndefinedToNull: false }), [
|
|
211
|
+
1,
|
|
212
|
+
2,
|
|
213
|
+
undefined
|
|
214
|
+
]);
|
|
215
|
+
assert.deepStrictEqual(decode(fromHex('830102f7'), { coerceUndefinedToNull: true }), [
|
|
216
|
+
1,
|
|
217
|
+
2,
|
|
218
|
+
null
|
|
219
|
+
]);
|
|
220
|
+
});
|
|
205
221
|
it('can switch off Infinity support', () => {
|
|
206
222
|
assert.deepStrictEqual(decode(fromHex('830102f97c00')), [
|
|
207
223
|
1,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import chai from 'chai';
|
|
2
|
-
import { inspect } from 'util';
|
|
3
2
|
import {
|
|
4
3
|
decode,
|
|
5
4
|
encode
|
|
@@ -81,4 +80,16 @@ describe('cbor/test-vectors', () => {
|
|
|
81
80
|
}
|
|
82
81
|
it.skip('encode w/ tags', () => {
|
|
83
82
|
});
|
|
84
|
-
});
|
|
83
|
+
});
|
|
84
|
+
function inspect(o) {
|
|
85
|
+
if (typeof o === 'string') {
|
|
86
|
+
return `'${ o }'`;
|
|
87
|
+
}
|
|
88
|
+
if (o instanceof Uint8Array) {
|
|
89
|
+
return `Uint8Array<${ o.join(',') }>`;
|
|
90
|
+
}
|
|
91
|
+
if (o == null || typeof o !== 'object') {
|
|
92
|
+
return String(o);
|
|
93
|
+
}
|
|
94
|
+
return JSON.stringify(o);
|
|
95
|
+
}
|
package/esm/lib/7float.js
CHANGED
|
@@ -11,6 +11,8 @@ const MINOR_UNDEFINED = 23;
|
|
|
11
11
|
export function decodeUndefined(_data, _pos, _minor, options) {
|
|
12
12
|
if (options.allowUndefined === false) {
|
|
13
13
|
throw new Error(`${ decodeErrPrefix } undefined values are not supported`);
|
|
14
|
+
} else if (options.coerceUndefinedToNull === true) {
|
|
15
|
+
return new Token(Type.null, null, 1);
|
|
14
16
|
}
|
|
15
17
|
return new Token(Type.undefined, undefined, 1);
|
|
16
18
|
}
|
package/esm/lib/diagnostic.js
CHANGED
|
@@ -44,6 +44,9 @@ function* tokensToDiagnostic(inp, width = 100) {
|
|
|
44
44
|
yield `${ margin }${ toHex(piece) }`.padEnd(width / 2, ' ') + `# ${ margin }"${ st }"`;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
if (indent.length) {
|
|
48
|
+
indent[indent.length - 1]--;
|
|
49
|
+
}
|
|
47
50
|
if (!token.type.terminal) {
|
|
48
51
|
switch (token.type.name) {
|
|
49
52
|
case 'map':
|
|
@@ -58,13 +61,9 @@ function* tokensToDiagnostic(inp, width = 100) {
|
|
|
58
61
|
default:
|
|
59
62
|
throw new Error(`Unknown token type '${ token.type.name }'`);
|
|
60
63
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (indent[indent.length - 1] === 0) {
|
|
65
|
-
indent.pop();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
64
|
+
}
|
|
65
|
+
while (indent.length && indent[indent.length - 1] <= 0) {
|
|
66
|
+
indent.pop();
|
|
68
67
|
}
|
|
69
68
|
pos += token.encodedLength;
|
|
70
69
|
}
|
|
@@ -210,4 +210,62 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
210
210
|
assert.strictEqual(stderr, '');
|
|
211
211
|
assert.strictEqual(stdout, 'a3616101616282020365736d696c6564f09f9880\n');
|
|
212
212
|
});
|
|
213
|
+
it('diag indenting', async () => {
|
|
214
|
+
const {stdout, stderr} = await execBin('json2diag', '{"a":[],"b":{},"c":{"a":1,"b":{"a":{"a":{}}}},"d":{"a":{"a":{"a":1},"b":2,"c":[]}},"e":[[[[{"a":{}}]]]],"f":1}');
|
|
215
|
+
assert.strictEqual(stderr, '');
|
|
216
|
+
assert.strictEqual(stdout, `a6 # map(6)
|
|
217
|
+
61 # string(1)
|
|
218
|
+
61 # "a"
|
|
219
|
+
80 # array(0)
|
|
220
|
+
61 # string(1)
|
|
221
|
+
62 # "b"
|
|
222
|
+
a0 # map(0)
|
|
223
|
+
61 # string(1)
|
|
224
|
+
63 # "c"
|
|
225
|
+
a2 # map(2)
|
|
226
|
+
61 # string(1)
|
|
227
|
+
61 # "a"
|
|
228
|
+
01 # uint(1)
|
|
229
|
+
61 # string(1)
|
|
230
|
+
62 # "b"
|
|
231
|
+
a1 # map(1)
|
|
232
|
+
61 # string(1)
|
|
233
|
+
61 # "a"
|
|
234
|
+
a1 # map(1)
|
|
235
|
+
61 # string(1)
|
|
236
|
+
61 # "a"
|
|
237
|
+
a0 # map(0)
|
|
238
|
+
61 # string(1)
|
|
239
|
+
64 # "d"
|
|
240
|
+
a1 # map(1)
|
|
241
|
+
61 # string(1)
|
|
242
|
+
61 # "a"
|
|
243
|
+
a3 # map(3)
|
|
244
|
+
61 # string(1)
|
|
245
|
+
61 # "a"
|
|
246
|
+
a1 # map(1)
|
|
247
|
+
61 # string(1)
|
|
248
|
+
61 # "a"
|
|
249
|
+
01 # uint(1)
|
|
250
|
+
61 # string(1)
|
|
251
|
+
62 # "b"
|
|
252
|
+
02 # uint(2)
|
|
253
|
+
61 # string(1)
|
|
254
|
+
63 # "c"
|
|
255
|
+
80 # array(0)
|
|
256
|
+
61 # string(1)
|
|
257
|
+
65 # "e"
|
|
258
|
+
81 # array(1)
|
|
259
|
+
81 # array(1)
|
|
260
|
+
81 # array(1)
|
|
261
|
+
81 # array(1)
|
|
262
|
+
a1 # map(1)
|
|
263
|
+
61 # string(1)
|
|
264
|
+
61 # "a"
|
|
265
|
+
a0 # map(0)
|
|
266
|
+
61 # string(1)
|
|
267
|
+
66 # "f"
|
|
268
|
+
01 # uint(1)
|
|
269
|
+
`);
|
|
270
|
+
});
|
|
213
271
|
});
|
|
@@ -195,6 +195,8 @@ describe('float', () => {
|
|
|
195
195
|
]), { allowIndefinite: false }), /indefinite/);
|
|
196
196
|
});
|
|
197
197
|
it('can switch off undefined support', () => {
|
|
198
|
+
assert.deepStrictEqual(decode(fromHex('f7')), undefined);
|
|
199
|
+
assert.throws(() => decode(fromHex('f7'), { allowUndefined: false }), /undefined/);
|
|
198
200
|
assert.deepStrictEqual(decode(fromHex('830102f7')), [
|
|
199
201
|
1,
|
|
200
202
|
2,
|
|
@@ -202,6 +204,20 @@ describe('float', () => {
|
|
|
202
204
|
]);
|
|
203
205
|
assert.throws(() => decode(fromHex('830102f7'), { allowUndefined: false }), /undefined/);
|
|
204
206
|
});
|
|
207
|
+
it('can coerce undefined to null', () => {
|
|
208
|
+
assert.deepStrictEqual(decode(fromHex('f7'), { coerceUndefinedToNull: false }), undefined);
|
|
209
|
+
assert.deepStrictEqual(decode(fromHex('f7'), { coerceUndefinedToNull: true }), null);
|
|
210
|
+
assert.deepStrictEqual(decode(fromHex('830102f7'), { coerceUndefinedToNull: false }), [
|
|
211
|
+
1,
|
|
212
|
+
2,
|
|
213
|
+
undefined
|
|
214
|
+
]);
|
|
215
|
+
assert.deepStrictEqual(decode(fromHex('830102f7'), { coerceUndefinedToNull: true }), [
|
|
216
|
+
1,
|
|
217
|
+
2,
|
|
218
|
+
null
|
|
219
|
+
]);
|
|
220
|
+
});
|
|
205
221
|
it('can switch off Infinity support', () => {
|
|
206
222
|
assert.deepStrictEqual(decode(fromHex('830102f97c00')), [
|
|
207
223
|
1,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import chai from 'chai';
|
|
2
|
-
import { inspect } from 'util';
|
|
3
2
|
import {
|
|
4
3
|
decode,
|
|
5
4
|
encode
|
|
@@ -81,4 +80,16 @@ describe('cbor/test-vectors', () => {
|
|
|
81
80
|
}
|
|
82
81
|
it.skip('encode w/ tags', () => {
|
|
83
82
|
});
|
|
84
|
-
});
|
|
83
|
+
});
|
|
84
|
+
function inspect(o) {
|
|
85
|
+
if (typeof o === 'string') {
|
|
86
|
+
return `'${ o }'`;
|
|
87
|
+
}
|
|
88
|
+
if (o instanceof Uint8Array) {
|
|
89
|
+
return `Uint8Array<${ o.join(',') }>`;
|
|
90
|
+
}
|
|
91
|
+
if (o == null || typeof o !== 'object') {
|
|
92
|
+
return String(o);
|
|
93
|
+
}
|
|
94
|
+
return JSON.stringify(o);
|
|
95
|
+
}
|
package/interface.ts
CHANGED
package/lib/7float.js
CHANGED
|
@@ -26,6 +26,8 @@ const MINOR_UNDEFINED = 23
|
|
|
26
26
|
export function decodeUndefined (_data, _pos, _minor, options) {
|
|
27
27
|
if (options.allowUndefined === false) {
|
|
28
28
|
throw new Error(`${decodeErrPrefix} undefined values are not supported`)
|
|
29
|
+
} else if (options.coerceUndefinedToNull === true) {
|
|
30
|
+
return new Token(Type.null, null, 1)
|
|
29
31
|
}
|
|
30
32
|
return new Token(Type.undefined, undefined, 1)
|
|
31
33
|
}
|
package/lib/diagnostic.js
CHANGED
|
@@ -67,6 +67,9 @@ function * tokensToDiagnostic (inp, width = 100) {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
if (indent.length) {
|
|
71
|
+
indent[indent.length - 1]--
|
|
72
|
+
}
|
|
70
73
|
if (!token.type.terminal) {
|
|
71
74
|
switch (token.type.name) {
|
|
72
75
|
case 'map':
|
|
@@ -83,13 +86,9 @@ function * tokensToDiagnostic (inp, width = 100) {
|
|
|
83
86
|
default:
|
|
84
87
|
throw new Error(`Unknown token type '${token.type.name}'`)
|
|
85
88
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (indent[indent.length - 1] === 0) {
|
|
90
|
-
indent.pop()
|
|
91
|
-
}
|
|
92
|
-
}
|
|
89
|
+
}
|
|
90
|
+
while (indent.length && indent[indent.length - 1] <= 0) {
|
|
91
|
+
indent.pop()
|
|
93
92
|
}
|
|
94
93
|
// @ts-ignore it should be set on a decode operation
|
|
95
94
|
pos += token.encodedLength
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cborg",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Fast CBOR with a focus on strictness",
|
|
5
5
|
"main": "./cjs/cborg.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
"build:copy": "mkdir -p dist/test && cp test/*.js dist/test/ && cp -a tsconfig.json *.js *.ts lib dist/",
|
|
14
14
|
"build:types": "npm run build:copy && cd dist && tsc --build",
|
|
15
15
|
"test:cjs": "npm run build && mocha dist/cjs/node-test/test-*.js dist/cjs/node-test/node-test-*.js",
|
|
16
|
+
"test:esm": "npm run build && mocha dist/esm/node-test/test-*.js dist/esm/node-test/node-test-*.js",
|
|
16
17
|
"test:node": "c8 --check-coverage --branches 100 --functions 100 --lines 100 mocha test/test-*.js test/node-test-*.js",
|
|
17
|
-
"test:browser": "polendina --page --worker --serviceworker --cleanup dist/cjs/
|
|
18
|
-
"test": "
|
|
18
|
+
"test:browser:cjs": "polendina --page --worker --serviceworker --cleanup dist/cjs/browser-test/test-*.js",
|
|
19
|
+
"test:browser:esm": "polendina --page --worker --serviceworker --cleanup dist/esm/browser-test/test-*.js",
|
|
20
|
+
"test:browser": "npm run test:browser:cjs && npm run test:browser:cjs",
|
|
21
|
+
"test": "npm run lint && npm run test:node && npm run test:esm && npm run test:browser:esm",
|
|
22
|
+
"test:ci": "npm run lint && npm run test:node && npm run test:cjs && npm run test:esm && npm run test:browser",
|
|
19
23
|
"coverage": "c8 --reporter=html mocha test/test-*.js && npx st -d coverage -p 8080"
|
|
20
24
|
},
|
|
21
25
|
"repository": {
|
|
@@ -28,14 +32,14 @@
|
|
|
28
32
|
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
29
33
|
"license": "Apache-2.0",
|
|
30
34
|
"devDependencies": {
|
|
31
|
-
"c8": "^7.
|
|
32
|
-
"chai": "^4.3.
|
|
33
|
-
"ipjs": "^5.
|
|
34
|
-
"ipld-garbage": "^4.0.
|
|
35
|
-
"mocha": "^9.
|
|
36
|
-
"polendina": "
|
|
37
|
-
"standard": "^16.0.
|
|
38
|
-
"typescript": "
|
|
35
|
+
"c8": "^7.10.0",
|
|
36
|
+
"chai": "^4.3.4",
|
|
37
|
+
"ipjs": "^5.2.0",
|
|
38
|
+
"ipld-garbage": "^4.0.10",
|
|
39
|
+
"mocha": "^9.1.3",
|
|
40
|
+
"polendina": "~2.0.1",
|
|
41
|
+
"standard": "^16.0.4",
|
|
42
|
+
"typescript": "~4.5.3"
|
|
39
43
|
},
|
|
40
44
|
"exports": {
|
|
41
45
|
".": {
|
package/test/node-test-bin.js
CHANGED
|
@@ -250,4 +250,65 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
250
250
|
assert.strictEqual(stderr, '')
|
|
251
251
|
assert.strictEqual(stdout, 'a3616101616282020365736d696c6564f09f9880\n')
|
|
252
252
|
})
|
|
253
|
+
|
|
254
|
+
// complicated nesting to test indenting algorithm
|
|
255
|
+
it('diag indenting', async () => {
|
|
256
|
+
const { stdout, stderr } = await execBin('json2diag', '{"a":[],"b":{},"c":{"a":1,"b":{"a":{"a":{}}}},"d":{"a":{"a":{"a":1},"b":2,"c":[]}},"e":[[[[{"a":{}}]]]],"f":1}')
|
|
257
|
+
assert.strictEqual(stderr, '')
|
|
258
|
+
assert.strictEqual(stdout,
|
|
259
|
+
`a6 # map(6)
|
|
260
|
+
61 # string(1)
|
|
261
|
+
61 # "a"
|
|
262
|
+
80 # array(0)
|
|
263
|
+
61 # string(1)
|
|
264
|
+
62 # "b"
|
|
265
|
+
a0 # map(0)
|
|
266
|
+
61 # string(1)
|
|
267
|
+
63 # "c"
|
|
268
|
+
a2 # map(2)
|
|
269
|
+
61 # string(1)
|
|
270
|
+
61 # "a"
|
|
271
|
+
01 # uint(1)
|
|
272
|
+
61 # string(1)
|
|
273
|
+
62 # "b"
|
|
274
|
+
a1 # map(1)
|
|
275
|
+
61 # string(1)
|
|
276
|
+
61 # "a"
|
|
277
|
+
a1 # map(1)
|
|
278
|
+
61 # string(1)
|
|
279
|
+
61 # "a"
|
|
280
|
+
a0 # map(0)
|
|
281
|
+
61 # string(1)
|
|
282
|
+
64 # "d"
|
|
283
|
+
a1 # map(1)
|
|
284
|
+
61 # string(1)
|
|
285
|
+
61 # "a"
|
|
286
|
+
a3 # map(3)
|
|
287
|
+
61 # string(1)
|
|
288
|
+
61 # "a"
|
|
289
|
+
a1 # map(1)
|
|
290
|
+
61 # string(1)
|
|
291
|
+
61 # "a"
|
|
292
|
+
01 # uint(1)
|
|
293
|
+
61 # string(1)
|
|
294
|
+
62 # "b"
|
|
295
|
+
02 # uint(2)
|
|
296
|
+
61 # string(1)
|
|
297
|
+
63 # "c"
|
|
298
|
+
80 # array(0)
|
|
299
|
+
61 # string(1)
|
|
300
|
+
65 # "e"
|
|
301
|
+
81 # array(1)
|
|
302
|
+
81 # array(1)
|
|
303
|
+
81 # array(1)
|
|
304
|
+
81 # array(1)
|
|
305
|
+
a1 # map(1)
|
|
306
|
+
61 # string(1)
|
|
307
|
+
61 # "a"
|
|
308
|
+
a0 # map(0)
|
|
309
|
+
61 # string(1)
|
|
310
|
+
66 # "f"
|
|
311
|
+
01 # uint(1)
|
|
312
|
+
`)
|
|
313
|
+
})
|
|
253
314
|
})
|
package/test/test-7float.js
CHANGED
|
@@ -97,10 +97,19 @@ describe('float', () => {
|
|
|
97
97
|
})
|
|
98
98
|
|
|
99
99
|
it('can switch off undefined support', () => {
|
|
100
|
+
assert.deepStrictEqual(decode(fromHex('f7')), undefined)
|
|
101
|
+
assert.throws(() => decode(fromHex('f7'), { allowUndefined: false }), /undefined/)
|
|
100
102
|
assert.deepStrictEqual(decode(fromHex('830102f7')), [1, 2, undefined])
|
|
101
103
|
assert.throws(() => decode(fromHex('830102f7'), { allowUndefined: false }), /undefined/)
|
|
102
104
|
})
|
|
103
105
|
|
|
106
|
+
it('can coerce undefined to null', () => {
|
|
107
|
+
assert.deepStrictEqual(decode(fromHex('f7'), { coerceUndefinedToNull: false }), undefined)
|
|
108
|
+
assert.deepStrictEqual(decode(fromHex('f7'), { coerceUndefinedToNull: true }), null)
|
|
109
|
+
assert.deepStrictEqual(decode(fromHex('830102f7'), { coerceUndefinedToNull: false }), [1, 2, undefined])
|
|
110
|
+
assert.deepStrictEqual(decode(fromHex('830102f7'), { coerceUndefinedToNull: true }), [1, 2, null])
|
|
111
|
+
})
|
|
112
|
+
|
|
104
113
|
it('can switch off Infinity support', () => {
|
|
105
114
|
assert.deepStrictEqual(decode(fromHex('830102f97c00')), [1, 2, Infinity])
|
|
106
115
|
assert.deepStrictEqual(decode(fromHex('830102f9fc00')), [1, 2, -Infinity])
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-env mocha,es2020 */
|
|
2
2
|
|
|
3
3
|
import chai from 'chai'
|
|
4
|
-
import { inspect } from 'util'
|
|
5
4
|
|
|
6
5
|
import { decode, encode } from '../cborg.js'
|
|
7
6
|
import * as taglib from 'cborg/taglib'
|
|
@@ -93,3 +92,16 @@ describe('cbor/test-vectors', () => {
|
|
|
93
92
|
it.skip('encode w/ tags', () => {
|
|
94
93
|
})
|
|
95
94
|
})
|
|
95
|
+
|
|
96
|
+
function inspect (o) {
|
|
97
|
+
if (typeof o === 'string') {
|
|
98
|
+
return `'${o}'`
|
|
99
|
+
}
|
|
100
|
+
if (o instanceof Uint8Array) {
|
|
101
|
+
return `Uint8Array<${o.join(',')}>`
|
|
102
|
+
}
|
|
103
|
+
if (o == null || typeof o !== 'object') {
|
|
104
|
+
return String(o)
|
|
105
|
+
}
|
|
106
|
+
return JSON.stringify(o)
|
|
107
|
+
}
|
package/types/interface.d.ts
CHANGED
package/types/interface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAE7B,oBAAY,mBAAmB,GAAG,KAAK,GAAG,KAAK,EAAE,GAAG,mBAAmB,EAAE,CAAA;AAEzE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAA;IAC7B,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,CAAA;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAA;CACvC;AAED,oBAAY,mBAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,SAAS,KAAK,mBAAmB,GAAG,IAAI,CAAA;AAEtI,oBAAY,iBAAiB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,SAAS,KAAK,mBAAmB,CAAA;AAE7H,oBAAY,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5C,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;CAC7D,CAAA;AAED,oBAAY,SAAS,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,MAAM,CAAA;AAEpF,oBAAY,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,UAAU,GAAG,SAAS,CAAA;AAEvE,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,OAAO,CAAC;IAChB,IAAI,IAAI,KAAK,CAAA;CACd;AAED,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;AAE5C,MAAM,WAAW,aAAa;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;KAAE,CAAA;CAC3D"}
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAE7B,oBAAY,mBAAmB,GAAG,KAAK,GAAG,KAAK,EAAE,GAAG,mBAAmB,EAAE,CAAA;AAEzE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAA;IAC7B,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,CAAA;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAA;CACvC;AAED,oBAAY,mBAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,SAAS,KAAK,mBAAmB,GAAG,IAAI,CAAA;AAEtI,oBAAY,iBAAiB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,SAAS,KAAK,mBAAmB,CAAA;AAE7H,oBAAY,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5C,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;CAC7D,CAAA;AAED,oBAAY,SAAS,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,MAAM,CAAA;AAEpF,oBAAY,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,UAAU,GAAG,SAAS,CAAA;AAEvE,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,OAAO,CAAC;IAChB,IAAI,IAAI,KAAK,CAAA;CACd;AAED,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;AAE5C,MAAM,WAAW,aAAa;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;KAAE,CAAA;CAC3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7float.d.ts","sourceRoot":"","sources":["../../lib/7float.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,uCANW,UAAU,QACV,MAAM,UACN,MAAM,WACN,aAAa,GACX,KAAK,
|
|
1
|
+
{"version":3,"file":"7float.d.ts","sourceRoot":"","sources":["../../lib/7float.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,uCANW,UAAU,QACV,MAAM,UACN,MAAM,WACN,aAAa,GACX,KAAK,CASjB;AAED;;;;;;GAMG;AACH,mCANW,UAAU,QACV,MAAM,UACN,MAAM,WACN,aAAa,GACX,KAAK,CAOjB;AAoBD;;;;;;GAMG;AACH,oCANW,UAAU,OACV,MAAM,UACN,MAAM,WACN,aAAa,GACX,KAAK,CAIjB;AAED;;;;;;GAMG;AACH,oCANW,UAAU,OACV,MAAM,UACN,MAAM,WACN,aAAa,GACX,KAAK,CAIjB;AAED;;;;;;GAMG;AACH,oCANW,UAAU,OACV,MAAM,UACN,MAAM,WACN,aAAa,GACX,KAAK,CAIjB;AAED;;;;GAIG;AACH,iCAJW,EAAE,SACF,KAAK,WACL,aAAa,QAwCvB;;IAED;;;;OAIG;IACH,0FAqBC;;;iBAlKY,OAAO,SAAS,EAAE,EAAE;4BACpB,OAAO,cAAc,EAAE,aAAa;4BACpC,OAAO,cAAc,EAAE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic.d.ts","sourceRoot":"","sources":["../../lib/diagnostic.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wCAHW,UAAU,
|
|
1
|
+
{"version":3,"file":"diagnostic.d.ts","sourceRoot":"","sources":["../../lib/diagnostic.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wCAHW,UAAU,gEA2FpB"}
|