@flickfyi/flkr 0.0.153 → 0.0.156
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/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +5 -5
- package/node_modules/@flickfyi/attestation/dist/index.js +2 -2
- package/node_modules/@flickfyi/attestation/src/verify-attestation.ts +5 -3
- package/node_modules/@flickfyi/attestation/tests/verify-attestation.test.ts +67 -1
- package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +4 -4
- package/node_modules/@flickfyi/core/.turbo/turbo-build.log +86 -85
- package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +6 -6
- package/node_modules/@flickfyi/http-message-sig/dist/index.js +683 -3
- package/node_modules/@flickfyi/http-message-sig/package.json +3 -2
- package/node_modules/@flickfyi/http-message-sig/src/build.ts +3 -1
- package/node_modules/@flickfyi/http-message-sig/tests/build.spec.ts +6 -0
- package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +7 -6
- package/node_modules/@flickfyi/identity/README.md +36 -0
- package/node_modules/@flickfyi/identity/dist/index.d.ts +9 -6
- package/node_modules/@flickfyi/identity/dist/index.js +1 -1
- package/node_modules/@flickfyi/identity/src/types.ts +8 -3
- package/node_modules/@flickfyi/identity/src/verify-attestation.ts +10 -6
- package/node_modules/@flickfyi/identity/tests/fixtures/expired-attestation.json +9 -0
- package/node_modules/@flickfyi/identity/tests/supplied-attestation.test.ts +104 -0
- package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +4 -4
- package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +9 -3
- package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +4 -4
- package/package.json +1 -1
|
@@ -20,11 +20,11 @@ function isType(value, typeConstructor, typeStringified) {
|
|
|
20
20
|
if (value.constructor === typeConstructor) return true;
|
|
21
21
|
return objectToString.call(value) === typeStringified;
|
|
22
22
|
}
|
|
23
|
-
function isUint8Array(value) {
|
|
23
|
+
function isUint8Array$1(value) {
|
|
24
24
|
return isType(value, Uint8Array, uint8ArrayStringified);
|
|
25
25
|
}
|
|
26
26
|
function assertUint8Array(value) {
|
|
27
|
-
if (!isUint8Array(value)) throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof value}\``);
|
|
27
|
+
if (!isUint8Array$1(value)) throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof value}\``);
|
|
28
28
|
}
|
|
29
29
|
new globalThis.TextDecoder("utf8");
|
|
30
30
|
function assertString(value) {
|
|
@@ -74,6 +74,686 @@ function decode(b) {
|
|
|
74
74
|
return base64ToUint8Array(b);
|
|
75
75
|
}
|
|
76
76
|
//#endregion
|
|
77
|
+
//#region ../../node_modules/.bun/@sindresorhus+is@8.1.0/node_modules/@sindresorhus/is/distribution/utilities.js
|
|
78
|
+
function keysOf(value) {
|
|
79
|
+
return Object.keys(value);
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region ../../node_modules/.bun/@sindresorhus+is@8.1.0/node_modules/@sindresorhus/is/distribution/index.js
|
|
83
|
+
var typedArrayTypeNames = [
|
|
84
|
+
"Int8Array",
|
|
85
|
+
"Uint8Array",
|
|
86
|
+
"Uint8ClampedArray",
|
|
87
|
+
"Int16Array",
|
|
88
|
+
"Uint16Array",
|
|
89
|
+
"Int32Array",
|
|
90
|
+
"Uint32Array",
|
|
91
|
+
"Float32Array",
|
|
92
|
+
"Float64Array",
|
|
93
|
+
"BigInt64Array",
|
|
94
|
+
"BigUint64Array"
|
|
95
|
+
];
|
|
96
|
+
function isTypedArrayName(name) {
|
|
97
|
+
return typedArrayTypeNames.includes(name);
|
|
98
|
+
}
|
|
99
|
+
var objectTypeNames = [
|
|
100
|
+
"Function",
|
|
101
|
+
"Generator",
|
|
102
|
+
"AsyncGenerator",
|
|
103
|
+
"GeneratorFunction",
|
|
104
|
+
"AsyncGeneratorFunction",
|
|
105
|
+
"AsyncFunction",
|
|
106
|
+
"Observable",
|
|
107
|
+
"Array",
|
|
108
|
+
"Buffer",
|
|
109
|
+
"Blob",
|
|
110
|
+
"Object",
|
|
111
|
+
"RegExp",
|
|
112
|
+
"Date",
|
|
113
|
+
"Error",
|
|
114
|
+
"Map",
|
|
115
|
+
"Set",
|
|
116
|
+
"WeakMap",
|
|
117
|
+
"WeakSet",
|
|
118
|
+
"WeakRef",
|
|
119
|
+
"ArrayBuffer",
|
|
120
|
+
"SharedArrayBuffer",
|
|
121
|
+
"DataView",
|
|
122
|
+
"Promise",
|
|
123
|
+
"URL",
|
|
124
|
+
"FormData",
|
|
125
|
+
"URLSearchParams",
|
|
126
|
+
"HTMLElement",
|
|
127
|
+
"NaN",
|
|
128
|
+
...typedArrayTypeNames
|
|
129
|
+
];
|
|
130
|
+
function isObjectTypeName(name) {
|
|
131
|
+
return objectTypeNames.includes(name);
|
|
132
|
+
}
|
|
133
|
+
var primitiveTypeNames = [
|
|
134
|
+
"null",
|
|
135
|
+
"undefined",
|
|
136
|
+
"string",
|
|
137
|
+
"number",
|
|
138
|
+
"bigint",
|
|
139
|
+
"boolean",
|
|
140
|
+
"symbol"
|
|
141
|
+
];
|
|
142
|
+
function isPrimitiveTypeName(name) {
|
|
143
|
+
return primitiveTypeNames.includes(name);
|
|
144
|
+
}
|
|
145
|
+
[...objectTypeNames, ...primitiveTypeNames];
|
|
146
|
+
var getObjectType = (value) => {
|
|
147
|
+
const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
|
|
148
|
+
if (/HTML\w+Element/v.test(objectTypeName) && isHtmlElement(value)) return "HTMLElement";
|
|
149
|
+
if (isObjectTypeName(objectTypeName)) return objectTypeName;
|
|
150
|
+
};
|
|
151
|
+
function detect(value) {
|
|
152
|
+
if (value === null) return "null";
|
|
153
|
+
switch (typeof value) {
|
|
154
|
+
case "undefined": return "undefined";
|
|
155
|
+
case "string": return "string";
|
|
156
|
+
case "number": return Number.isNaN(value) ? "NaN" : "number";
|
|
157
|
+
case "boolean": return "boolean";
|
|
158
|
+
case "function": return "Function";
|
|
159
|
+
case "bigint": return "bigint";
|
|
160
|
+
case "symbol": return "symbol";
|
|
161
|
+
}
|
|
162
|
+
if (isObservable(value)) return "Observable";
|
|
163
|
+
if (isArray(value)) return "Array";
|
|
164
|
+
if (isBuffer(value)) return "Buffer";
|
|
165
|
+
const tagType = getObjectType(value);
|
|
166
|
+
if (tagType !== void 0 && tagType !== "Object") return tagType;
|
|
167
|
+
if (hasPromiseApi(value)) return "Promise";
|
|
168
|
+
if (isBoxedPrimitiveObject(value)) throw new TypeError("Please don't use object wrappers for primitive types");
|
|
169
|
+
return "Object";
|
|
170
|
+
}
|
|
171
|
+
function hasPromiseApi(value) {
|
|
172
|
+
return isFunction(value?.then) && isFunction(value?.catch);
|
|
173
|
+
}
|
|
174
|
+
function hasBoxedPrimitiveBrand(value, valueOf) {
|
|
175
|
+
try {
|
|
176
|
+
Reflect.apply(valueOf, value, []);
|
|
177
|
+
return true;
|
|
178
|
+
} catch {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function isBoxedPrimitiveObject(value) {
|
|
183
|
+
return hasBoxedPrimitiveBrand(value, String.prototype.valueOf) || hasBoxedPrimitiveBrand(value, Boolean.prototype.valueOf) || hasBoxedPrimitiveBrand(value, Number.prototype.valueOf);
|
|
184
|
+
}
|
|
185
|
+
Object.assign(detect, {
|
|
186
|
+
all: isAll,
|
|
187
|
+
any: isAny,
|
|
188
|
+
array: isArray,
|
|
189
|
+
arrayBuffer: isArrayBuffer,
|
|
190
|
+
arrayLike: isArrayLike,
|
|
191
|
+
arrayOf: isArrayOf,
|
|
192
|
+
asyncFunction: isAsyncFunction,
|
|
193
|
+
asyncGenerator: isAsyncGenerator,
|
|
194
|
+
asyncGeneratorFunction: isAsyncGeneratorFunction,
|
|
195
|
+
asyncIterable: isAsyncIterable,
|
|
196
|
+
bigint: isBigint,
|
|
197
|
+
bigInt64Array: isBigInt64Array,
|
|
198
|
+
bigUint64Array: isBigUint64Array,
|
|
199
|
+
blob: isBlob,
|
|
200
|
+
boolean: isBoolean,
|
|
201
|
+
boundFunction: isBoundFunction,
|
|
202
|
+
buffer: isBuffer,
|
|
203
|
+
class: isClass,
|
|
204
|
+
dataView: isDataView,
|
|
205
|
+
date: isDate,
|
|
206
|
+
detect,
|
|
207
|
+
directInstanceOf: isDirectInstanceOf,
|
|
208
|
+
emptyArray: isEmptyArray,
|
|
209
|
+
emptyMap: isEmptyMap,
|
|
210
|
+
emptyObject: isEmptyObject,
|
|
211
|
+
emptySet: isEmptySet,
|
|
212
|
+
emptyString: isEmptyString,
|
|
213
|
+
emptyStringOrWhitespace: isEmptyStringOrWhitespace,
|
|
214
|
+
enumCase: isEnumCase,
|
|
215
|
+
error: isError,
|
|
216
|
+
evenInteger: isEvenInteger,
|
|
217
|
+
falsy: isFalsy,
|
|
218
|
+
finiteNumber: isFiniteNumber,
|
|
219
|
+
float32Array: isFloat32Array,
|
|
220
|
+
float64Array: isFloat64Array,
|
|
221
|
+
formData: isFormData,
|
|
222
|
+
function: isFunction,
|
|
223
|
+
generator: isGenerator,
|
|
224
|
+
generatorFunction: isGeneratorFunction,
|
|
225
|
+
htmlElement: isHtmlElement,
|
|
226
|
+
infinite: isInfinite,
|
|
227
|
+
inRange: isInRange,
|
|
228
|
+
int16Array: isInt16Array,
|
|
229
|
+
int32Array: isInt32Array,
|
|
230
|
+
int8Array: isInt8Array,
|
|
231
|
+
integer: isInteger,
|
|
232
|
+
iterable: isIterable,
|
|
233
|
+
map: isMap,
|
|
234
|
+
nan: isNan,
|
|
235
|
+
nativePromise: isNativePromise,
|
|
236
|
+
negativeInteger: isNegativeInteger,
|
|
237
|
+
negativeNumber: isNegativeNumber,
|
|
238
|
+
nodeStream: isNodeStream,
|
|
239
|
+
nonEmptyArray: isNonEmptyArray,
|
|
240
|
+
nonEmptyMap: isNonEmptyMap,
|
|
241
|
+
nonEmptyObject: isNonEmptyObject,
|
|
242
|
+
nonEmptySet: isNonEmptySet,
|
|
243
|
+
nonEmptyString: isNonEmptyString,
|
|
244
|
+
nonEmptyStringAndNotWhitespace: isNonEmptyStringAndNotWhitespace,
|
|
245
|
+
nonNegativeInteger: isNonNegativeInteger,
|
|
246
|
+
nonNegativeNumber: isNonNegativeNumber,
|
|
247
|
+
null: isNull,
|
|
248
|
+
nullOrUndefined: isNullOrUndefined,
|
|
249
|
+
number: isNumber,
|
|
250
|
+
numericString: isNumericString,
|
|
251
|
+
object: isObject,
|
|
252
|
+
observable: isObservable,
|
|
253
|
+
oddInteger: isOddInteger,
|
|
254
|
+
oneOf: isOneOf,
|
|
255
|
+
plainObject: isPlainObject,
|
|
256
|
+
positiveInteger: isPositiveInteger,
|
|
257
|
+
positiveNumber: isPositiveNumber,
|
|
258
|
+
primitive: isPrimitive,
|
|
259
|
+
promise: isPromise,
|
|
260
|
+
propertyKey: isPropertyKey,
|
|
261
|
+
regExp: isRegExp,
|
|
262
|
+
safeInteger: isSafeInteger,
|
|
263
|
+
set: isSet,
|
|
264
|
+
sharedArrayBuffer: isSharedArrayBuffer,
|
|
265
|
+
string: isString,
|
|
266
|
+
symbol: isSymbol,
|
|
267
|
+
truthy: isTruthy,
|
|
268
|
+
tupleLike: isTupleLike,
|
|
269
|
+
typedArray: isTypedArray,
|
|
270
|
+
uint16Array: isUint16Array,
|
|
271
|
+
uint32Array: isUint32Array,
|
|
272
|
+
uint8Array: isUint8Array,
|
|
273
|
+
uint8ClampedArray: isUint8ClampedArray,
|
|
274
|
+
undefined: isUndefined,
|
|
275
|
+
urlInstance: isUrlInstance,
|
|
276
|
+
urlSearchParams: isUrlSearchParams,
|
|
277
|
+
urlString: isUrlString,
|
|
278
|
+
optional: isOptional,
|
|
279
|
+
validDate: isValidDate,
|
|
280
|
+
validLength: isValidLength,
|
|
281
|
+
weakMap: isWeakMap,
|
|
282
|
+
weakRef: isWeakRef,
|
|
283
|
+
weakSet: isWeakSet,
|
|
284
|
+
whitespaceString: isWhitespaceString
|
|
285
|
+
});
|
|
286
|
+
function isAbsoluteModule2(remainder) {
|
|
287
|
+
return (value) => isInteger(value) && Math.abs(value % 2) === remainder;
|
|
288
|
+
}
|
|
289
|
+
function validatePredicateArray(predicateArray, allowEmpty) {
|
|
290
|
+
if (predicateArray.length === 0) {
|
|
291
|
+
if (allowEmpty) {} else throw new TypeError("Invalid predicate array");
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
for (const predicate of predicateArray) validatePredicate(predicate);
|
|
295
|
+
}
|
|
296
|
+
function validatePredicate(predicate) {
|
|
297
|
+
if (!isFunction(predicate)) throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
|
|
298
|
+
}
|
|
299
|
+
function isAll(predicate, ...values) {
|
|
300
|
+
if (Array.isArray(predicate)) {
|
|
301
|
+
const predicateArray = predicate;
|
|
302
|
+
validatePredicateArray(predicateArray, values.length === 0);
|
|
303
|
+
const combinedPredicate = (value) => predicateArray.every((singlePredicate) => singlePredicate(value));
|
|
304
|
+
if (values.length === 0) return combinedPredicate;
|
|
305
|
+
return predicateOnArray(Array.prototype.every, combinedPredicate, values);
|
|
306
|
+
}
|
|
307
|
+
return predicateOnArray(Array.prototype.every, predicate, values);
|
|
308
|
+
}
|
|
309
|
+
function isAny(predicate, ...values) {
|
|
310
|
+
if (Array.isArray(predicate)) {
|
|
311
|
+
const predicateArray = predicate;
|
|
312
|
+
validatePredicateArray(predicateArray, values.length === 0);
|
|
313
|
+
const combinedPredicate = (value) => predicateArray.some((singlePredicate) => singlePredicate(value));
|
|
314
|
+
if (values.length === 0) return combinedPredicate;
|
|
315
|
+
return predicateOnArray(Array.prototype.some, combinedPredicate, values);
|
|
316
|
+
}
|
|
317
|
+
return predicateOnArray(Array.prototype.some, predicate, values);
|
|
318
|
+
}
|
|
319
|
+
function isOptional(value, predicate) {
|
|
320
|
+
return isUndefined(value) || predicate(value);
|
|
321
|
+
}
|
|
322
|
+
function isArray(value, assertion) {
|
|
323
|
+
if (!Array.isArray(value)) return false;
|
|
324
|
+
if (!isFunction(assertion)) return true;
|
|
325
|
+
return value.every((element) => assertion(element));
|
|
326
|
+
}
|
|
327
|
+
function isArrayBuffer(value) {
|
|
328
|
+
return getObjectType(value) === "ArrayBuffer";
|
|
329
|
+
}
|
|
330
|
+
function isArrayLike(value) {
|
|
331
|
+
return !isNullOrUndefined(value) && !isFunction(value) && isValidLength(value.length);
|
|
332
|
+
}
|
|
333
|
+
function isArrayOf(predicate) {
|
|
334
|
+
return (value) => isArray(value) && value.every((element) => predicate(element));
|
|
335
|
+
}
|
|
336
|
+
function isAsyncFunction(value) {
|
|
337
|
+
return getObjectType(value) === "AsyncFunction";
|
|
338
|
+
}
|
|
339
|
+
function isAsyncGenerator(value) {
|
|
340
|
+
return isAsyncIterable(value) && isFunction(value.next) && isFunction(value.throw);
|
|
341
|
+
}
|
|
342
|
+
function isAsyncGeneratorFunction(value) {
|
|
343
|
+
return getObjectType(value) === "AsyncGeneratorFunction";
|
|
344
|
+
}
|
|
345
|
+
function isAsyncIterable(value) {
|
|
346
|
+
return isFunction(value?.[Symbol.asyncIterator]);
|
|
347
|
+
}
|
|
348
|
+
function isBigint(value) {
|
|
349
|
+
return typeof value === "bigint";
|
|
350
|
+
}
|
|
351
|
+
function isBigInt64Array(value) {
|
|
352
|
+
return getObjectType(value) === "BigInt64Array";
|
|
353
|
+
}
|
|
354
|
+
function isBigUint64Array(value) {
|
|
355
|
+
return getObjectType(value) === "BigUint64Array";
|
|
356
|
+
}
|
|
357
|
+
function isBlob(value) {
|
|
358
|
+
return getObjectType(value) === "Blob";
|
|
359
|
+
}
|
|
360
|
+
function isBoolean(value) {
|
|
361
|
+
return value === true || value === false;
|
|
362
|
+
}
|
|
363
|
+
function isBoundFunction(value) {
|
|
364
|
+
return isFunction(value) && !Object.hasOwn(value, "prototype");
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
Note: [Prefer using `Uint8Array` instead of `Buffer`.](https://sindresorhus.com/blog/goodbye-nodejs-buffer)
|
|
368
|
+
*/
|
|
369
|
+
function isBuffer(value) {
|
|
370
|
+
return value?.constructor?.isBuffer?.(value) ?? false;
|
|
371
|
+
}
|
|
372
|
+
function isClass(value) {
|
|
373
|
+
return isFunction(value) && /^class(?:\s+|\{)/v.test(value.toString());
|
|
374
|
+
}
|
|
375
|
+
function isDataView(value) {
|
|
376
|
+
return getObjectType(value) === "DataView";
|
|
377
|
+
}
|
|
378
|
+
function isDate(value) {
|
|
379
|
+
return getObjectType(value) === "Date";
|
|
380
|
+
}
|
|
381
|
+
function isDirectInstanceOf(instance, class_) {
|
|
382
|
+
if (instance === void 0 || instance === null) return false;
|
|
383
|
+
return Object.getPrototypeOf(instance) === class_.prototype;
|
|
384
|
+
}
|
|
385
|
+
function isEmptyArray(value) {
|
|
386
|
+
return isArray(value) && value.length === 0;
|
|
387
|
+
}
|
|
388
|
+
function isEmptyMap(value) {
|
|
389
|
+
return isMap(value) && value.size === 0;
|
|
390
|
+
}
|
|
391
|
+
function isEmptyObject(value) {
|
|
392
|
+
return isObject(value) && !isFunction(value) && !isArray(value) && !isMap(value) && !isSet(value) && Object.keys(value).length === 0;
|
|
393
|
+
}
|
|
394
|
+
function isEmptySet(value) {
|
|
395
|
+
return isSet(value) && value.size === 0;
|
|
396
|
+
}
|
|
397
|
+
function isEmptyString(value) {
|
|
398
|
+
return isString(value) && value.length === 0;
|
|
399
|
+
}
|
|
400
|
+
function isEmptyStringOrWhitespace(value) {
|
|
401
|
+
return isEmptyString(value) || isWhitespaceString(value);
|
|
402
|
+
}
|
|
403
|
+
function isEnumCase(value, targetEnum) {
|
|
404
|
+
const enumObject = targetEnum;
|
|
405
|
+
return Object.entries(enumObject).some(([key, enumValue]) => {
|
|
406
|
+
if (!isString(enumValue)) return enumValue === value;
|
|
407
|
+
const numericKey = Number(key);
|
|
408
|
+
if (Number.isNaN(numericKey) || String(numericKey) !== key) return enumValue === value;
|
|
409
|
+
return enumValue === value && !(Object.hasOwn(enumObject, enumValue) && enumObject[enumValue] === numericKey);
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
function isError(value) {
|
|
413
|
+
return getObjectType(value) === "Error";
|
|
414
|
+
}
|
|
415
|
+
function isEvenInteger(value) {
|
|
416
|
+
return isAbsoluteModule2(0)(value);
|
|
417
|
+
}
|
|
418
|
+
function isFalsy(value) {
|
|
419
|
+
return !value;
|
|
420
|
+
}
|
|
421
|
+
function isFiniteNumber(value) {
|
|
422
|
+
return Number.isFinite(value);
|
|
423
|
+
}
|
|
424
|
+
function isFloat32Array(value) {
|
|
425
|
+
return getObjectType(value) === "Float32Array";
|
|
426
|
+
}
|
|
427
|
+
function isFloat64Array(value) {
|
|
428
|
+
return getObjectType(value) === "Float64Array";
|
|
429
|
+
}
|
|
430
|
+
function isFormData(value) {
|
|
431
|
+
return getObjectType(value) === "FormData";
|
|
432
|
+
}
|
|
433
|
+
function isFunction(value) {
|
|
434
|
+
return typeof value === "function";
|
|
435
|
+
}
|
|
436
|
+
function isGenerator(value) {
|
|
437
|
+
return isIterable(value) && isFunction(value?.next) && isFunction(value?.throw);
|
|
438
|
+
}
|
|
439
|
+
function isGeneratorFunction(value) {
|
|
440
|
+
return getObjectType(value) === "GeneratorFunction";
|
|
441
|
+
}
|
|
442
|
+
var NODE_TYPE_ELEMENT = 1;
|
|
443
|
+
var DOM_PROPERTIES_TO_CHECK = [
|
|
444
|
+
"innerHTML",
|
|
445
|
+
"ownerDocument",
|
|
446
|
+
"style",
|
|
447
|
+
"attributes",
|
|
448
|
+
"nodeValue"
|
|
449
|
+
];
|
|
450
|
+
function isHtmlElement(value) {
|
|
451
|
+
return isObject(value) && value.nodeType === NODE_TYPE_ELEMENT && isString(value.nodeName) && !isPlainObject(value) && DOM_PROPERTIES_TO_CHECK.every((property) => property in value);
|
|
452
|
+
}
|
|
453
|
+
function isInfinite(value) {
|
|
454
|
+
return value === Number.POSITIVE_INFINITY || value === Number.NEGATIVE_INFINITY;
|
|
455
|
+
}
|
|
456
|
+
function isInRange(value, range) {
|
|
457
|
+
if (isNumber(range)) return value >= Math.min(0, range) && value <= Math.max(range, 0);
|
|
458
|
+
if (isArray(range) && range.length === 2) {
|
|
459
|
+
if (Number.isNaN(range[0]) || Number.isNaN(range[1])) throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
|
|
460
|
+
return value >= Math.min(...range) && value <= Math.max(...range);
|
|
461
|
+
}
|
|
462
|
+
throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
|
|
463
|
+
}
|
|
464
|
+
function isInt16Array(value) {
|
|
465
|
+
return getObjectType(value) === "Int16Array";
|
|
466
|
+
}
|
|
467
|
+
function isInt32Array(value) {
|
|
468
|
+
return getObjectType(value) === "Int32Array";
|
|
469
|
+
}
|
|
470
|
+
function isInt8Array(value) {
|
|
471
|
+
return getObjectType(value) === "Int8Array";
|
|
472
|
+
}
|
|
473
|
+
function isInteger(value) {
|
|
474
|
+
return Number.isInteger(value);
|
|
475
|
+
}
|
|
476
|
+
function isIterable(value) {
|
|
477
|
+
return isFunction(value?.[Symbol.iterator]);
|
|
478
|
+
}
|
|
479
|
+
function isMap(value) {
|
|
480
|
+
return getObjectType(value) === "Map";
|
|
481
|
+
}
|
|
482
|
+
function isNan(value) {
|
|
483
|
+
return Number.isNaN(value);
|
|
484
|
+
}
|
|
485
|
+
function isNativePromise(value) {
|
|
486
|
+
return getObjectType(value) === "Promise";
|
|
487
|
+
}
|
|
488
|
+
function isNegativeInteger(value) {
|
|
489
|
+
return isInteger(value) && value < 0;
|
|
490
|
+
}
|
|
491
|
+
function isNegativeNumber(value) {
|
|
492
|
+
return isNumber(value) && value < 0;
|
|
493
|
+
}
|
|
494
|
+
function isNodeStream(value) {
|
|
495
|
+
return isObject(value) && isFunction(value.pipe) && !isObservable(value);
|
|
496
|
+
}
|
|
497
|
+
function isNonEmptyArray(value) {
|
|
498
|
+
return isArray(value) && value.length > 0;
|
|
499
|
+
}
|
|
500
|
+
function isNonEmptyMap(value) {
|
|
501
|
+
return isMap(value) && value.size > 0;
|
|
502
|
+
}
|
|
503
|
+
function isNonEmptyObject(value) {
|
|
504
|
+
return isObject(value) && !isFunction(value) && !isArray(value) && !isMap(value) && !isSet(value) && Object.keys(value).length > 0;
|
|
505
|
+
}
|
|
506
|
+
function isNonEmptySet(value) {
|
|
507
|
+
return isSet(value) && value.size > 0;
|
|
508
|
+
}
|
|
509
|
+
function isNonEmptyString(value) {
|
|
510
|
+
return isString(value) && value.length > 0;
|
|
511
|
+
}
|
|
512
|
+
function isNonEmptyStringAndNotWhitespace(value) {
|
|
513
|
+
return isString(value) && !isEmptyStringOrWhitespace(value);
|
|
514
|
+
}
|
|
515
|
+
function isNonNegativeInteger(value) {
|
|
516
|
+
return isInteger(value) && value >= 0;
|
|
517
|
+
}
|
|
518
|
+
function isNonNegativeNumber(value) {
|
|
519
|
+
return isNumber(value) && value >= 0;
|
|
520
|
+
}
|
|
521
|
+
function isNull(value) {
|
|
522
|
+
return value === null;
|
|
523
|
+
}
|
|
524
|
+
function isNullOrUndefined(value) {
|
|
525
|
+
return isNull(value) || isUndefined(value);
|
|
526
|
+
}
|
|
527
|
+
function isNumber(value) {
|
|
528
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
529
|
+
}
|
|
530
|
+
function isNumericString(value) {
|
|
531
|
+
return isString(value) && !isEmptyStringOrWhitespace(value) && value === value.trim() && !Number.isNaN(Number(value));
|
|
532
|
+
}
|
|
533
|
+
function isObject(value) {
|
|
534
|
+
return !isNull(value) && (typeof value === "object" || isFunction(value));
|
|
535
|
+
}
|
|
536
|
+
function isObservable(value) {
|
|
537
|
+
if (!value) return false;
|
|
538
|
+
if (Symbol.observable !== void 0 && value === value[Symbol.observable]?.()) return true;
|
|
539
|
+
if (value === value["@@observable"]?.()) return true;
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
function isOddInteger(value) {
|
|
543
|
+
return isAbsoluteModule2(1)(value);
|
|
544
|
+
}
|
|
545
|
+
function isOneOf(values) {
|
|
546
|
+
return (value) => values.includes(value);
|
|
547
|
+
}
|
|
548
|
+
function isPlainObject(value) {
|
|
549
|
+
if (typeof value !== "object" || value === null) return false;
|
|
550
|
+
const prototype = Object.getPrototypeOf(value);
|
|
551
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
552
|
+
}
|
|
553
|
+
function isPositiveInteger(value) {
|
|
554
|
+
return isInteger(value) && value > 0;
|
|
555
|
+
}
|
|
556
|
+
function isPositiveNumber(value) {
|
|
557
|
+
return isNumber(value) && value > 0;
|
|
558
|
+
}
|
|
559
|
+
function isPrimitive(value) {
|
|
560
|
+
return isNull(value) || isPrimitiveTypeName(typeof value);
|
|
561
|
+
}
|
|
562
|
+
function isPromise(value) {
|
|
563
|
+
return isNativePromise(value) || hasPromiseApi(value);
|
|
564
|
+
}
|
|
565
|
+
function isPropertyKey(value) {
|
|
566
|
+
return isAny([
|
|
567
|
+
isString,
|
|
568
|
+
isNumber,
|
|
569
|
+
isSymbol
|
|
570
|
+
], value);
|
|
571
|
+
}
|
|
572
|
+
function isRegExp(value) {
|
|
573
|
+
return getObjectType(value) === "RegExp";
|
|
574
|
+
}
|
|
575
|
+
function isSafeInteger(value) {
|
|
576
|
+
return Number.isSafeInteger(value);
|
|
577
|
+
}
|
|
578
|
+
function isSet(value) {
|
|
579
|
+
return getObjectType(value) === "Set";
|
|
580
|
+
}
|
|
581
|
+
function isSharedArrayBuffer(value) {
|
|
582
|
+
return getObjectType(value) === "SharedArrayBuffer";
|
|
583
|
+
}
|
|
584
|
+
function isString(value) {
|
|
585
|
+
return typeof value === "string";
|
|
586
|
+
}
|
|
587
|
+
function isSymbol(value) {
|
|
588
|
+
return typeof value === "symbol";
|
|
589
|
+
}
|
|
590
|
+
function isTruthy(value) {
|
|
591
|
+
return Boolean(value);
|
|
592
|
+
}
|
|
593
|
+
function isTupleLike(value, guards) {
|
|
594
|
+
if (isArray(guards) && isArray(value) && guards.length === value.length) return guards.every((guard, index) => guard(value[index]));
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
function isTypedArray(value) {
|
|
598
|
+
return isTypedArrayName(getObjectType(value));
|
|
599
|
+
}
|
|
600
|
+
function isUint16Array(value) {
|
|
601
|
+
return getObjectType(value) === "Uint16Array";
|
|
602
|
+
}
|
|
603
|
+
function isUint32Array(value) {
|
|
604
|
+
return getObjectType(value) === "Uint32Array";
|
|
605
|
+
}
|
|
606
|
+
function isUint8Array(value) {
|
|
607
|
+
return getObjectType(value) === "Uint8Array";
|
|
608
|
+
}
|
|
609
|
+
function isUint8ClampedArray(value) {
|
|
610
|
+
return getObjectType(value) === "Uint8ClampedArray";
|
|
611
|
+
}
|
|
612
|
+
function isUndefined(value) {
|
|
613
|
+
return value === void 0;
|
|
614
|
+
}
|
|
615
|
+
function isUrlInstance(value) {
|
|
616
|
+
return getObjectType(value) === "URL";
|
|
617
|
+
}
|
|
618
|
+
function isUrlSearchParams(value) {
|
|
619
|
+
return getObjectType(value) === "URLSearchParams";
|
|
620
|
+
}
|
|
621
|
+
function isUrlString(value) {
|
|
622
|
+
if (!isString(value)) return false;
|
|
623
|
+
try {
|
|
624
|
+
new URL(value);
|
|
625
|
+
return true;
|
|
626
|
+
} catch {
|
|
627
|
+
return false;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
function isValidDate(value) {
|
|
631
|
+
return isDate(value) && !isNan(Number(value));
|
|
632
|
+
}
|
|
633
|
+
function isValidLength(value) {
|
|
634
|
+
return isSafeInteger(value) && value >= 0;
|
|
635
|
+
}
|
|
636
|
+
function isWeakMap(value) {
|
|
637
|
+
return getObjectType(value) === "WeakMap";
|
|
638
|
+
}
|
|
639
|
+
function isWeakRef(value) {
|
|
640
|
+
return getObjectType(value) === "WeakRef";
|
|
641
|
+
}
|
|
642
|
+
function isWeakSet(value) {
|
|
643
|
+
return getObjectType(value) === "WeakSet";
|
|
644
|
+
}
|
|
645
|
+
function isWhitespaceString(value) {
|
|
646
|
+
return isString(value) && /^\s+$/v.test(value);
|
|
647
|
+
}
|
|
648
|
+
function predicateOnArray(method, predicate, values) {
|
|
649
|
+
validatePredicate(predicate);
|
|
650
|
+
if (values.length === 0) throw new TypeError("Invalid number of values");
|
|
651
|
+
return method.call(values, predicate);
|
|
652
|
+
}
|
|
653
|
+
new Intl.ListFormat("en", {
|
|
654
|
+
style: "long",
|
|
655
|
+
type: "conjunction"
|
|
656
|
+
});
|
|
657
|
+
new Intl.ListFormat("en", {
|
|
658
|
+
style: "long",
|
|
659
|
+
type: "disjunction"
|
|
660
|
+
});
|
|
661
|
+
keysOf({
|
|
662
|
+
isArray: "Array",
|
|
663
|
+
isArrayBuffer: "ArrayBuffer",
|
|
664
|
+
isArrayLike: "array-like",
|
|
665
|
+
isAsyncFunction: "AsyncFunction",
|
|
666
|
+
isAsyncGenerator: "AsyncGenerator",
|
|
667
|
+
isAsyncGeneratorFunction: "AsyncGeneratorFunction",
|
|
668
|
+
isAsyncIterable: "AsyncIterable",
|
|
669
|
+
isBigint: "bigint",
|
|
670
|
+
isBigInt64Array: "BigInt64Array",
|
|
671
|
+
isBigUint64Array: "BigUint64Array",
|
|
672
|
+
isBlob: "Blob",
|
|
673
|
+
isBoolean: "boolean",
|
|
674
|
+
isBoundFunction: "bound Function",
|
|
675
|
+
isBuffer: "Buffer",
|
|
676
|
+
isClass: "Class",
|
|
677
|
+
isDataView: "DataView",
|
|
678
|
+
isDate: "Date",
|
|
679
|
+
isDirectInstanceOf: "T",
|
|
680
|
+
isEmptyArray: "empty array",
|
|
681
|
+
isEmptyMap: "empty map",
|
|
682
|
+
isEmptyObject: "empty object",
|
|
683
|
+
isEmptySet: "empty set",
|
|
684
|
+
isEmptyString: "empty string",
|
|
685
|
+
isEmptyStringOrWhitespace: "empty string or whitespace",
|
|
686
|
+
isEnumCase: "EnumCase",
|
|
687
|
+
isError: "Error",
|
|
688
|
+
isEvenInteger: "even integer",
|
|
689
|
+
isFalsy: "falsy",
|
|
690
|
+
isFiniteNumber: "finite number",
|
|
691
|
+
isFloat32Array: "Float32Array",
|
|
692
|
+
isFloat64Array: "Float64Array",
|
|
693
|
+
isFormData: "FormData",
|
|
694
|
+
isFunction: "Function",
|
|
695
|
+
isGenerator: "Generator",
|
|
696
|
+
isGeneratorFunction: "GeneratorFunction",
|
|
697
|
+
isHtmlElement: "HTMLElement",
|
|
698
|
+
isInfinite: "infinite number",
|
|
699
|
+
isInRange: "in range",
|
|
700
|
+
isInt16Array: "Int16Array",
|
|
701
|
+
isInt32Array: "Int32Array",
|
|
702
|
+
isInt8Array: "Int8Array",
|
|
703
|
+
isInteger: "integer",
|
|
704
|
+
isIterable: "Iterable",
|
|
705
|
+
isMap: "Map",
|
|
706
|
+
isNan: "NaN",
|
|
707
|
+
isNativePromise: "native Promise",
|
|
708
|
+
isNegativeInteger: "negative integer",
|
|
709
|
+
isNegativeNumber: "negative number",
|
|
710
|
+
isNodeStream: "Node.js Stream",
|
|
711
|
+
isNonEmptyArray: "non-empty array",
|
|
712
|
+
isNonEmptyMap: "non-empty map",
|
|
713
|
+
isNonEmptyObject: "non-empty object",
|
|
714
|
+
isNonEmptySet: "non-empty set",
|
|
715
|
+
isNonEmptyString: "non-empty string",
|
|
716
|
+
isNonEmptyStringAndNotWhitespace: "non-empty string and not whitespace",
|
|
717
|
+
isNonNegativeInteger: "non-negative integer",
|
|
718
|
+
isNonNegativeNumber: "non-negative number",
|
|
719
|
+
isNull: "null",
|
|
720
|
+
isNullOrUndefined: "null or undefined",
|
|
721
|
+
isNumber: "number",
|
|
722
|
+
isNumericString: "string with a number",
|
|
723
|
+
isObject: "Object",
|
|
724
|
+
isObservable: "Observable",
|
|
725
|
+
isOddInteger: "odd integer",
|
|
726
|
+
isPlainObject: "plain object",
|
|
727
|
+
isPositiveInteger: "positive integer",
|
|
728
|
+
isPositiveNumber: "positive number",
|
|
729
|
+
isPrimitive: "primitive",
|
|
730
|
+
isPromise: "Promise",
|
|
731
|
+
isPropertyKey: "PropertyKey",
|
|
732
|
+
isRegExp: "RegExp",
|
|
733
|
+
isSafeInteger: "safe integer",
|
|
734
|
+
isSet: "Set",
|
|
735
|
+
isSharedArrayBuffer: "SharedArrayBuffer",
|
|
736
|
+
isString: "string",
|
|
737
|
+
isSymbol: "symbol",
|
|
738
|
+
isTruthy: "truthy",
|
|
739
|
+
isTupleLike: "tuple-like",
|
|
740
|
+
isTypedArray: "TypedArray",
|
|
741
|
+
isUint16Array: "Uint16Array",
|
|
742
|
+
isUint32Array: "Uint32Array",
|
|
743
|
+
isUint8Array: "Uint8Array",
|
|
744
|
+
isUint8ClampedArray: "Uint8ClampedArray",
|
|
745
|
+
isUndefined: "undefined",
|
|
746
|
+
isUrlInstance: "URL",
|
|
747
|
+
isUrlSearchParams: "URLSearchParams",
|
|
748
|
+
isUrlString: "string with a URL",
|
|
749
|
+
isValidDate: "valid Date",
|
|
750
|
+
isValidLength: "valid length",
|
|
751
|
+
isWeakMap: "WeakMap",
|
|
752
|
+
isWeakRef: "WeakRef",
|
|
753
|
+
isWeakSet: "WeakSet",
|
|
754
|
+
isWhitespaceString: "whitespace string"
|
|
755
|
+
});
|
|
756
|
+
//#endregion
|
|
77
757
|
//#region src/build.ts
|
|
78
758
|
/**
|
|
79
759
|
* Extracts one member from a Dictionary Structured Field and serializes that
|
|
@@ -420,7 +1100,7 @@ function orderedParameterEntries(parameters) {
|
|
|
420
1100
|
*/
|
|
421
1101
|
function toStructuredParameterValue(value) {
|
|
422
1102
|
if (value instanceof Date) return Math.floor(value.getTime() / 1e3);
|
|
423
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
1103
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || isArrayBuffer(value)) return value;
|
|
424
1104
|
return value.toString();
|
|
425
1105
|
}
|
|
426
1106
|
/**
|