cborg 2.0.5 → 3.0.0
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/.github/dependabot.yml +16 -0
- package/.github/workflows/test-and-release.yml +63 -0
- package/CHANGELOG.md +332 -0
- package/bench/bench.js +117 -0
- package/bench/json.js +124 -0
- package/bench/package.json +8 -0
- package/lib/bin.js +1 -1
- package/package.json +30 -47
- package/types/lib/bin.d.ts +1 -0
- package/cjs/browser-test/appendix_a.js +0 -643
- package/cjs/browser-test/common.js +0 -24
- package/cjs/browser-test/node-test-bin.js +0 -348
- package/cjs/browser-test/noop-bin-test.js +0 -4
- package/cjs/browser-test/test-0uint.js +0 -158
- package/cjs/browser-test/test-1negint.js +0 -152
- package/cjs/browser-test/test-2bytes.js +0 -254
- package/cjs/browser-test/test-3string.js +0 -144
- package/cjs/browser-test/test-4array.js +0 -200
- package/cjs/browser-test/test-5map.js +0 -667
- package/cjs/browser-test/test-6tag.js +0 -75
- package/cjs/browser-test/test-7float.js +0 -253
- package/cjs/browser-test/test-bl.js +0 -91
- package/cjs/browser-test/test-cbor-vectors.js +0 -98
- package/cjs/browser-test/test-decode-errors.js +0 -77
- package/cjs/browser-test/test-fuzz.js +0 -56
- package/cjs/browser-test/test-json.js +0 -281
- package/cjs/browser-test/test-length.js +0 -63
- package/cjs/cborg.js +0 -14
- package/cjs/lib/0uint.js +0 -163
- package/cjs/lib/1negint.js +0 -63
- package/cjs/lib/2bytes.js +0 -62
- package/cjs/lib/3string.js +0 -46
- package/cjs/lib/4array.js +0 -51
- package/cjs/lib/5map.js +0 -51
- package/cjs/lib/6tag.js +0 -36
- package/cjs/lib/7float.js +0 -188
- package/cjs/lib/bin.js +0 -139
- package/cjs/lib/bl.js +0 -77
- package/cjs/lib/byte-utils.js +0 -245
- package/cjs/lib/common.js +0 -22
- package/cjs/lib/decode.js +0 -140
- package/cjs/lib/diagnostic.js +0 -124
- package/cjs/lib/encode.js +0 -248
- package/cjs/lib/is.js +0 -87
- package/cjs/lib/json/decode.js +0 -414
- package/cjs/lib/json/encode.js +0 -161
- package/cjs/lib/json/json.js +0 -12
- package/cjs/lib/jump.js +0 -174
- package/cjs/lib/length.js +0 -36
- package/cjs/lib/token.js +0 -46
- package/cjs/node-test/appendix_a.js +0 -643
- package/cjs/node-test/common.js +0 -24
- package/cjs/node-test/node-test-bin.js +0 -348
- package/cjs/node-test/noop-bin-test.js +0 -4
- package/cjs/node-test/test-0uint.js +0 -158
- package/cjs/node-test/test-1negint.js +0 -152
- package/cjs/node-test/test-2bytes.js +0 -254
- package/cjs/node-test/test-3string.js +0 -144
- package/cjs/node-test/test-4array.js +0 -200
- package/cjs/node-test/test-5map.js +0 -667
- package/cjs/node-test/test-6tag.js +0 -75
- package/cjs/node-test/test-7float.js +0 -253
- package/cjs/node-test/test-bl.js +0 -91
- package/cjs/node-test/test-cbor-vectors.js +0 -98
- package/cjs/node-test/test-decode-errors.js +0 -77
- package/cjs/node-test/test-fuzz.js +0 -56
- package/cjs/node-test/test-json.js +0 -281
- package/cjs/node-test/test-length.js +0 -63
- package/cjs/taglib.js +0 -44
- package/cli.js +0 -7
- package/esm/browser-test/appendix_a.js +0 -640
- package/esm/browser-test/common.js +0 -19
- package/esm/browser-test/node-test-bin.js +0 -339
- package/esm/browser-test/noop-bin-test.js +0 -1
- package/esm/browser-test/test-0uint.js +0 -155
- package/esm/browser-test/test-1negint.js +0 -149
- package/esm/browser-test/test-2bytes.js +0 -252
- package/esm/browser-test/test-3string.js +0 -141
- package/esm/browser-test/test-4array.js +0 -197
- package/esm/browser-test/test-5map.js +0 -664
- package/esm/browser-test/test-6tag.js +0 -78
- package/esm/browser-test/test-7float.js +0 -250
- package/esm/browser-test/test-bl.js +0 -84
- package/esm/browser-test/test-cbor-vectors.js +0 -95
- package/esm/browser-test/test-decode-errors.js +0 -69
- package/esm/browser-test/test-fuzz.js +0 -50
- package/esm/browser-test/test-json.js +0 -279
- package/esm/browser-test/test-length.js +0 -55
- package/esm/cborg.js +0 -12
- package/esm/lib/0uint.js +0 -152
- package/esm/lib/1negint.js +0 -55
- package/esm/lib/2bytes.js +0 -59
- package/esm/lib/3string.js +0 -43
- package/esm/lib/4array.js +0 -41
- package/esm/lib/5map.js +0 -41
- package/esm/lib/6tag.js +0 -27
- package/esm/lib/7float.js +0 -179
- package/esm/lib/bin.js +0 -137
- package/esm/lib/bl.js +0 -74
- package/esm/lib/byte-utils.js +0 -228
- package/esm/lib/common.js +0 -19
- package/esm/lib/decode.js +0 -139
- package/esm/lib/diagnostic.js +0 -123
- package/esm/lib/encode.js +0 -246
- package/esm/lib/is.js +0 -81
- package/esm/lib/json/decode.js +0 -413
- package/esm/lib/json/encode.js +0 -160
- package/esm/lib/json/json.js +0 -10
- package/esm/lib/jump.js +0 -168
- package/esm/lib/length.js +0 -31
- package/esm/lib/token.js +0 -43
- package/esm/node-test/appendix_a.js +0 -640
- package/esm/node-test/common.js +0 -19
- package/esm/node-test/node-test-bin.js +0 -339
- package/esm/node-test/noop-bin-test.js +0 -1
- package/esm/node-test/test-0uint.js +0 -155
- package/esm/node-test/test-1negint.js +0 -149
- package/esm/node-test/test-2bytes.js +0 -252
- package/esm/node-test/test-3string.js +0 -141
- package/esm/node-test/test-4array.js +0 -197
- package/esm/node-test/test-5map.js +0 -664
- package/esm/node-test/test-6tag.js +0 -78
- package/esm/node-test/test-7float.js +0 -250
- package/esm/node-test/test-bl.js +0 -84
- package/esm/node-test/test-cbor-vectors.js +0 -95
- package/esm/node-test/test-decode-errors.js +0 -69
- package/esm/node-test/test-fuzz.js +0 -50
- package/esm/node-test/test-json.js +0 -279
- package/esm/node-test/test-length.js +0 -55
- package/esm/package.json +0 -4
- package/esm/taglib.js +0 -37
- package/index.js +0 -1
- package/json +0 -1
- package/length +0 -1
- package/taglib +0 -1
package/cjs/lib/encode.js
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var is = require('./is.js');
|
|
6
|
-
var token = require('./token.js');
|
|
7
|
-
var bl = require('./bl.js');
|
|
8
|
-
var common = require('./common.js');
|
|
9
|
-
var jump = require('./jump.js');
|
|
10
|
-
var byteUtils = require('./byte-utils.js');
|
|
11
|
-
var _0uint = require('./0uint.js');
|
|
12
|
-
var _1negint = require('./1negint.js');
|
|
13
|
-
var _2bytes = require('./2bytes.js');
|
|
14
|
-
var _3string = require('./3string.js');
|
|
15
|
-
var _4array = require('./4array.js');
|
|
16
|
-
var _5map = require('./5map.js');
|
|
17
|
-
var _6tag = require('./6tag.js');
|
|
18
|
-
var _7float = require('./7float.js');
|
|
19
|
-
|
|
20
|
-
const defaultEncodeOptions = {
|
|
21
|
-
float64: false,
|
|
22
|
-
mapSorter,
|
|
23
|
-
quickEncodeToken: jump.quickEncodeToken
|
|
24
|
-
};
|
|
25
|
-
function makeCborEncoders() {
|
|
26
|
-
const encoders = [];
|
|
27
|
-
encoders[token.Type.uint.major] = _0uint.encodeUint;
|
|
28
|
-
encoders[token.Type.negint.major] = _1negint.encodeNegint;
|
|
29
|
-
encoders[token.Type.bytes.major] = _2bytes.encodeBytes;
|
|
30
|
-
encoders[token.Type.string.major] = _3string.encodeString;
|
|
31
|
-
encoders[token.Type.array.major] = _4array.encodeArray;
|
|
32
|
-
encoders[token.Type.map.major] = _5map.encodeMap;
|
|
33
|
-
encoders[token.Type.tag.major] = _6tag.encodeTag;
|
|
34
|
-
encoders[token.Type.float.major] = _7float.encodeFloat;
|
|
35
|
-
return encoders;
|
|
36
|
-
}
|
|
37
|
-
const cborEncoders = makeCborEncoders();
|
|
38
|
-
const buf = new bl.Bl();
|
|
39
|
-
class Ref {
|
|
40
|
-
constructor(obj, parent) {
|
|
41
|
-
this.obj = obj;
|
|
42
|
-
this.parent = parent;
|
|
43
|
-
}
|
|
44
|
-
includes(obj) {
|
|
45
|
-
let p = this;
|
|
46
|
-
do {
|
|
47
|
-
if (p.obj === obj) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
} while (p = p.parent);
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
static createCheck(stack, obj) {
|
|
54
|
-
if (stack && stack.includes(obj)) {
|
|
55
|
-
throw new Error(`${ common.encodeErrPrefix } object contains circular references`);
|
|
56
|
-
}
|
|
57
|
-
return new Ref(obj, stack);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const simpleTokens = {
|
|
61
|
-
null: new token.Token(token.Type.null, null),
|
|
62
|
-
undefined: new token.Token(token.Type.undefined, undefined),
|
|
63
|
-
true: new token.Token(token.Type.true, true),
|
|
64
|
-
false: new token.Token(token.Type.false, false),
|
|
65
|
-
emptyArray: new token.Token(token.Type.array, 0),
|
|
66
|
-
emptyMap: new token.Token(token.Type.map, 0)
|
|
67
|
-
};
|
|
68
|
-
const typeEncoders = {
|
|
69
|
-
number(obj, _typ, _options, _refStack) {
|
|
70
|
-
if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) {
|
|
71
|
-
return new token.Token(token.Type.float, obj);
|
|
72
|
-
} else if (obj >= 0) {
|
|
73
|
-
return new token.Token(token.Type.uint, obj);
|
|
74
|
-
} else {
|
|
75
|
-
return new token.Token(token.Type.negint, obj);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
bigint(obj, _typ, _options, _refStack) {
|
|
79
|
-
if (obj >= BigInt(0)) {
|
|
80
|
-
return new token.Token(token.Type.uint, obj);
|
|
81
|
-
} else {
|
|
82
|
-
return new token.Token(token.Type.negint, obj);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
Uint8Array(obj, _typ, _options, _refStack) {
|
|
86
|
-
return new token.Token(token.Type.bytes, obj);
|
|
87
|
-
},
|
|
88
|
-
string(obj, _typ, _options, _refStack) {
|
|
89
|
-
return new token.Token(token.Type.string, obj);
|
|
90
|
-
},
|
|
91
|
-
boolean(obj, _typ, _options, _refStack) {
|
|
92
|
-
return obj ? simpleTokens.true : simpleTokens.false;
|
|
93
|
-
},
|
|
94
|
-
null(_obj, _typ, _options, _refStack) {
|
|
95
|
-
return simpleTokens.null;
|
|
96
|
-
},
|
|
97
|
-
undefined(_obj, _typ, _options, _refStack) {
|
|
98
|
-
return simpleTokens.undefined;
|
|
99
|
-
},
|
|
100
|
-
ArrayBuffer(obj, _typ, _options, _refStack) {
|
|
101
|
-
return new token.Token(token.Type.bytes, new Uint8Array(obj));
|
|
102
|
-
},
|
|
103
|
-
DataView(obj, _typ, _options, _refStack) {
|
|
104
|
-
return new token.Token(token.Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));
|
|
105
|
-
},
|
|
106
|
-
Array(obj, _typ, options, refStack) {
|
|
107
|
-
if (!obj.length) {
|
|
108
|
-
if (options.addBreakTokens === true) {
|
|
109
|
-
return [
|
|
110
|
-
simpleTokens.emptyArray,
|
|
111
|
-
new token.Token(token.Type.break)
|
|
112
|
-
];
|
|
113
|
-
}
|
|
114
|
-
return simpleTokens.emptyArray;
|
|
115
|
-
}
|
|
116
|
-
refStack = Ref.createCheck(refStack, obj);
|
|
117
|
-
const entries = [];
|
|
118
|
-
let i = 0;
|
|
119
|
-
for (const e of obj) {
|
|
120
|
-
entries[i++] = objectToTokens(e, options, refStack);
|
|
121
|
-
}
|
|
122
|
-
if (options.addBreakTokens) {
|
|
123
|
-
return [
|
|
124
|
-
new token.Token(token.Type.array, obj.length),
|
|
125
|
-
entries,
|
|
126
|
-
new token.Token(token.Type.break)
|
|
127
|
-
];
|
|
128
|
-
}
|
|
129
|
-
return [
|
|
130
|
-
new token.Token(token.Type.array, obj.length),
|
|
131
|
-
entries
|
|
132
|
-
];
|
|
133
|
-
},
|
|
134
|
-
Object(obj, typ, options, refStack) {
|
|
135
|
-
const isMap = typ !== 'Object';
|
|
136
|
-
const keys = isMap ? obj.keys() : Object.keys(obj);
|
|
137
|
-
const length = isMap ? obj.size : keys.length;
|
|
138
|
-
if (!length) {
|
|
139
|
-
if (options.addBreakTokens === true) {
|
|
140
|
-
return [
|
|
141
|
-
simpleTokens.emptyMap,
|
|
142
|
-
new token.Token(token.Type.break)
|
|
143
|
-
];
|
|
144
|
-
}
|
|
145
|
-
return simpleTokens.emptyMap;
|
|
146
|
-
}
|
|
147
|
-
refStack = Ref.createCheck(refStack, obj);
|
|
148
|
-
const entries = [];
|
|
149
|
-
let i = 0;
|
|
150
|
-
for (const key of keys) {
|
|
151
|
-
entries[i++] = [
|
|
152
|
-
objectToTokens(key, options, refStack),
|
|
153
|
-
objectToTokens(isMap ? obj.get(key) : obj[key], options, refStack)
|
|
154
|
-
];
|
|
155
|
-
}
|
|
156
|
-
sortMapEntries(entries, options);
|
|
157
|
-
if (options.addBreakTokens) {
|
|
158
|
-
return [
|
|
159
|
-
new token.Token(token.Type.map, length),
|
|
160
|
-
entries,
|
|
161
|
-
new token.Token(token.Type.break)
|
|
162
|
-
];
|
|
163
|
-
}
|
|
164
|
-
return [
|
|
165
|
-
new token.Token(token.Type.map, length),
|
|
166
|
-
entries
|
|
167
|
-
];
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
typeEncoders.Map = typeEncoders.Object;
|
|
171
|
-
typeEncoders.Buffer = typeEncoders.Uint8Array;
|
|
172
|
-
for (const typ of 'Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64'.split(' ')) {
|
|
173
|
-
typeEncoders[`${ typ }Array`] = typeEncoders.DataView;
|
|
174
|
-
}
|
|
175
|
-
function objectToTokens(obj, options = {}, refStack) {
|
|
176
|
-
const typ = is.is(obj);
|
|
177
|
-
const customTypeEncoder = options && options.typeEncoders && options.typeEncoders[typ] || typeEncoders[typ];
|
|
178
|
-
if (typeof customTypeEncoder === 'function') {
|
|
179
|
-
const tokens = customTypeEncoder(obj, typ, options, refStack);
|
|
180
|
-
if (tokens != null) {
|
|
181
|
-
return tokens;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
const typeEncoder = typeEncoders[typ];
|
|
185
|
-
if (!typeEncoder) {
|
|
186
|
-
throw new Error(`${ common.encodeErrPrefix } unsupported type: ${ typ }`);
|
|
187
|
-
}
|
|
188
|
-
return typeEncoder(obj, typ, options, refStack);
|
|
189
|
-
}
|
|
190
|
-
function sortMapEntries(entries, options) {
|
|
191
|
-
if (options.mapSorter) {
|
|
192
|
-
entries.sort(options.mapSorter);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
function mapSorter(e1, e2) {
|
|
196
|
-
const keyToken1 = Array.isArray(e1[0]) ? e1[0][0] : e1[0];
|
|
197
|
-
const keyToken2 = Array.isArray(e2[0]) ? e2[0][0] : e2[0];
|
|
198
|
-
if (keyToken1.type !== keyToken2.type) {
|
|
199
|
-
return keyToken1.type.compare(keyToken2.type);
|
|
200
|
-
}
|
|
201
|
-
const major = keyToken1.type.major;
|
|
202
|
-
const tcmp = cborEncoders[major].compareTokens(keyToken1, keyToken2);
|
|
203
|
-
if (tcmp === 0) {
|
|
204
|
-
console.warn('WARNING: complex key types used, CBOR key sorting guarantees are gone');
|
|
205
|
-
}
|
|
206
|
-
return tcmp;
|
|
207
|
-
}
|
|
208
|
-
function tokensToEncoded(buf, tokens, encoders, options) {
|
|
209
|
-
if (Array.isArray(tokens)) {
|
|
210
|
-
for (const token of tokens) {
|
|
211
|
-
tokensToEncoded(buf, token, encoders, options);
|
|
212
|
-
}
|
|
213
|
-
} else {
|
|
214
|
-
encoders[tokens.type.major](buf, tokens, options);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function encodeCustom(data, encoders, options) {
|
|
218
|
-
const tokens = objectToTokens(data, options);
|
|
219
|
-
if (!Array.isArray(tokens) && options.quickEncodeToken) {
|
|
220
|
-
const quickBytes = options.quickEncodeToken(tokens);
|
|
221
|
-
if (quickBytes) {
|
|
222
|
-
return quickBytes;
|
|
223
|
-
}
|
|
224
|
-
const encoder = encoders[tokens.type.major];
|
|
225
|
-
if (encoder.encodedSize) {
|
|
226
|
-
const size = encoder.encodedSize(tokens, options);
|
|
227
|
-
const buf = new bl.Bl(size);
|
|
228
|
-
encoder(buf, tokens, options);
|
|
229
|
-
if (buf.chunks.length !== 1) {
|
|
230
|
-
throw new Error(`Unexpected error: pre-calculated length for ${ tokens } was wrong`);
|
|
231
|
-
}
|
|
232
|
-
return byteUtils.asU8A(buf.chunks[0]);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
buf.reset();
|
|
236
|
-
tokensToEncoded(buf, tokens, encoders, options);
|
|
237
|
-
return buf.toBytes(true);
|
|
238
|
-
}
|
|
239
|
-
function encode(data, options) {
|
|
240
|
-
options = Object.assign({}, defaultEncodeOptions, options);
|
|
241
|
-
return encodeCustom(data, cborEncoders, options);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
exports.Ref = Ref;
|
|
245
|
-
exports.encode = encode;
|
|
246
|
-
exports.encodeCustom = encodeCustom;
|
|
247
|
-
exports.makeCborEncoders = makeCborEncoders;
|
|
248
|
-
exports.objectToTokens = objectToTokens;
|
package/cjs/lib/is.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const typeofs = [
|
|
6
|
-
'string',
|
|
7
|
-
'number',
|
|
8
|
-
'bigint',
|
|
9
|
-
'symbol'
|
|
10
|
-
];
|
|
11
|
-
const objectTypeNames = [
|
|
12
|
-
'Function',
|
|
13
|
-
'Generator',
|
|
14
|
-
'AsyncGenerator',
|
|
15
|
-
'GeneratorFunction',
|
|
16
|
-
'AsyncGeneratorFunction',
|
|
17
|
-
'AsyncFunction',
|
|
18
|
-
'Observable',
|
|
19
|
-
'Array',
|
|
20
|
-
'Buffer',
|
|
21
|
-
'Object',
|
|
22
|
-
'RegExp',
|
|
23
|
-
'Date',
|
|
24
|
-
'Error',
|
|
25
|
-
'Map',
|
|
26
|
-
'Set',
|
|
27
|
-
'WeakMap',
|
|
28
|
-
'WeakSet',
|
|
29
|
-
'ArrayBuffer',
|
|
30
|
-
'SharedArrayBuffer',
|
|
31
|
-
'DataView',
|
|
32
|
-
'Promise',
|
|
33
|
-
'URL',
|
|
34
|
-
'HTMLElement',
|
|
35
|
-
'Int8Array',
|
|
36
|
-
'Uint8Array',
|
|
37
|
-
'Uint8ClampedArray',
|
|
38
|
-
'Int16Array',
|
|
39
|
-
'Uint16Array',
|
|
40
|
-
'Int32Array',
|
|
41
|
-
'Uint32Array',
|
|
42
|
-
'Float32Array',
|
|
43
|
-
'Float64Array',
|
|
44
|
-
'BigInt64Array',
|
|
45
|
-
'BigUint64Array'
|
|
46
|
-
];
|
|
47
|
-
function is(value) {
|
|
48
|
-
if (value === null) {
|
|
49
|
-
return 'null';
|
|
50
|
-
}
|
|
51
|
-
if (value === undefined) {
|
|
52
|
-
return 'undefined';
|
|
53
|
-
}
|
|
54
|
-
if (value === true || value === false) {
|
|
55
|
-
return 'boolean';
|
|
56
|
-
}
|
|
57
|
-
const typeOf = typeof value;
|
|
58
|
-
if (typeofs.includes(typeOf)) {
|
|
59
|
-
return typeOf;
|
|
60
|
-
}
|
|
61
|
-
if (typeOf === 'function') {
|
|
62
|
-
return 'Function';
|
|
63
|
-
}
|
|
64
|
-
if (Array.isArray(value)) {
|
|
65
|
-
return 'Array';
|
|
66
|
-
}
|
|
67
|
-
if (isBuffer(value)) {
|
|
68
|
-
return 'Buffer';
|
|
69
|
-
}
|
|
70
|
-
const objectType = getObjectType(value);
|
|
71
|
-
if (objectType) {
|
|
72
|
-
return objectType;
|
|
73
|
-
}
|
|
74
|
-
return 'Object';
|
|
75
|
-
}
|
|
76
|
-
function isBuffer(value) {
|
|
77
|
-
return value && value.constructor && value.constructor.isBuffer && value.constructor.isBuffer.call(null, value);
|
|
78
|
-
}
|
|
79
|
-
function getObjectType(value) {
|
|
80
|
-
const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
|
|
81
|
-
if (objectTypeNames.includes(objectTypeName)) {
|
|
82
|
-
return objectTypeName;
|
|
83
|
-
}
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
exports.is = is;
|