@lightsparkdev/core 1.1.0 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lightsparkdev/core
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b43609d: - Add isObject
8
+
9
+ ## 1.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - c17a851: - Update types. Non-public constructObject can return null
14
+
3
15
  ## 1.1.0
4
16
 
5
17
  ### Minor Changes
@@ -921,8 +921,12 @@ function lsidToUUID(lsid) {
921
921
  }
922
922
 
923
923
  // src/utils/typeGuards.ts
924
- function isUint8Array(variable) {
925
- return variable instanceof Uint8Array;
924
+ function isUint8Array(value) {
925
+ return value instanceof Uint8Array;
926
+ }
927
+ function isObject2(value) {
928
+ const type = typeof value;
929
+ return value != null && (type == "object" || type == "function");
926
930
  }
927
931
 
928
932
  // src/utils/types.ts
@@ -976,6 +980,7 @@ export {
976
980
  pollUntil,
977
981
  lsidToUUID,
978
982
  isUint8Array,
983
+ isObject2 as isObject,
979
984
  isType,
980
985
  notNullUndefined
981
986
  };
@@ -236,6 +236,7 @@ declare function sleep(ms: number): Promise<unknown>;
236
236
 
237
237
  declare function lsidToUUID(lsid: string): string;
238
238
 
239
- declare function isUint8Array(variable: unknown): variable is Uint8Array;
239
+ declare function isUint8Array(value: unknown): value is Uint8Array;
240
+ declare function isObject(value: unknown): value is Record<string, unknown>;
240
241
 
241
- export { isType as $, isErrorMsg as A, errorToJSON as B, ConfigKeys as C, bytesToHex as D, hexToBytes as E, getLocalStorageConfigItem as F, getLocalStorageBoolean as G, setLocalStorageBoolean as H, deleteLocalStorageItem as I, getCurrentLocale as J, countryCodesToCurrencyCodes as K, CurrencyLocales as L, CurrencyCodes as M, localeToCurrencyCode as N, clamp as O, linearInterpolate as P, round as Q, isNumber as R, SDKCurrencyAmountType as S, pollUntil as T, sleep as U, lsidToUUID as V, isUint8Array as W, Maybe as X, ExpandRecursively as Y, ById as Z, OmitTypename as _, b64encode as a, DeepPartial as a0, JSONLiteral as a1, JSONType as a2, JSONObject as a3, NN as a4, notNullUndefined as a5, PartialBy as a6, Complete as a7, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, CurrencyUnit as e, CurrencyUnitType as f, convertCurrencyAmountValue as g, convertCurrencyAmount as h, CurrencyMap as i, CurrencyAmountObj as j, CurrencyAmountArg as k, isCurrencyAmountObj as l, isSDKCurrencyAmount as m, mapCurrencyAmount as n, isCurrencyMap as o, abbrCurrencyUnit as p, formatCurrencyStr as q, localeToCurrencySymbol as r, separateCurrencyStrParts as s, isBrowser as t, urlsafe_b64decode as u, isNode as v, isTest as w, isError as x, isErrorWithMessage as y, getErrorMsg as z };
242
+ export { OmitTypename as $, isErrorMsg as A, errorToJSON as B, ConfigKeys as C, bytesToHex as D, hexToBytes as E, getLocalStorageConfigItem as F, getLocalStorageBoolean as G, setLocalStorageBoolean as H, deleteLocalStorageItem as I, getCurrentLocale as J, countryCodesToCurrencyCodes as K, CurrencyLocales as L, CurrencyCodes as M, localeToCurrencyCode as N, clamp as O, linearInterpolate as P, round as Q, isNumber as R, SDKCurrencyAmountType as S, pollUntil as T, sleep as U, lsidToUUID as V, isUint8Array as W, isObject as X, Maybe as Y, ExpandRecursively as Z, ById as _, b64encode as a, isType as a0, DeepPartial as a1, JSONLiteral as a2, JSONType as a3, JSONObject as a4, NN as a5, notNullUndefined as a6, PartialBy as a7, Complete as a8, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, CurrencyUnit as e, CurrencyUnitType as f, convertCurrencyAmountValue as g, convertCurrencyAmount as h, CurrencyMap as i, CurrencyAmountObj as j, CurrencyAmountArg as k, isCurrencyAmountObj as l, isSDKCurrencyAmount as m, mapCurrencyAmount as n, isCurrencyMap as o, abbrCurrencyUnit as p, formatCurrencyStr as q, localeToCurrencySymbol as r, separateCurrencyStrParts as s, isBrowser as t, urlsafe_b64decode as u, isNode as v, isTest as w, isError as x, isErrorWithMessage as y, getErrorMsg as z };
package/dist/index.cjs CHANGED
@@ -74,6 +74,7 @@ __export(src_exports, {
74
74
  isErrorWithMessage: () => isErrorWithMessage,
75
75
  isNode: () => isNode,
76
76
  isNumber: () => isNumber,
77
+ isObject: () => isObject2,
77
78
  isSDKCurrencyAmount: () => isSDKCurrencyAmount,
78
79
  isTest: () => isTest,
79
80
  isType: () => isType,
@@ -1365,8 +1366,12 @@ function lsidToUUID(lsid) {
1365
1366
  }
1366
1367
 
1367
1368
  // src/utils/typeGuards.ts
1368
- function isUint8Array(variable) {
1369
- return variable instanceof Uint8Array;
1369
+ function isUint8Array(value) {
1370
+ return value instanceof Uint8Array;
1371
+ }
1372
+ function isObject2(value) {
1373
+ const type = typeof value;
1374
+ return value != null && (type == "object" || type == "function");
1370
1375
  }
1371
1376
 
1372
1377
  // src/utils/types.ts
@@ -1729,6 +1734,7 @@ var Requester_default = Requester;
1729
1734
  isErrorWithMessage,
1730
1735
  isNode,
1731
1736
  isNumber,
1737
+ isObject,
1732
1738
  isSDKCurrencyAmount,
1733
1739
  isTest,
1734
1740
  isType,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { Z as ById, a7 as Complete, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a0 as DeepPartial, Y as ExpandRecursively, a1 as JSONLiteral, a3 as JSONObject, a2 as JSONType, X as Maybe, a4 as NN, _ as OmitTypename, a6 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, m as isSDKCurrencyAmount, w as isTest, $ as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a5 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from './index-4698c2db.js';
1
+ export { _ as ById, a8 as Complete, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a1 as DeepPartial, Z as ExpandRecursively, a2 as JSONLiteral, a4 as JSONObject, a3 as JSONType, Y as Maybe, a5 as NN, $ as OmitTypename, a7 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, X as isObject, m as isSDKCurrencyAmount, w as isTest, a0 as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a6 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from './index-b1e5d968.js';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  declare class LightsparkException extends Error {
@@ -135,7 +135,7 @@ type Query<T> = {
135
135
  * The function that will be called to construct the object from the
136
136
  * response. *
137
137
  */
138
- constructObject: (rawData: any) => T;
138
+ constructObject: (rawData: any) => T | null;
139
139
  /** The id of the node that will be used to sign the query. **/
140
140
  signingNodeId?: string;
141
141
  /** True if auth headers should be omitted for this query. **/
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { Z as ById, a7 as Complete, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a0 as DeepPartial, Y as ExpandRecursively, a1 as JSONLiteral, a3 as JSONObject, a2 as JSONType, X as Maybe, a4 as NN, _ as OmitTypename, a6 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, m as isSDKCurrencyAmount, w as isTest, $ as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a5 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from './index-4698c2db.js';
1
+ export { _ as ById, a8 as Complete, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a1 as DeepPartial, Z as ExpandRecursively, a2 as JSONLiteral, a4 as JSONObject, a3 as JSONType, Y as Maybe, a5 as NN, $ as OmitTypename, a7 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, X as isObject, m as isSDKCurrencyAmount, w as isTest, a0 as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a6 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from './index-b1e5d968.js';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  declare class LightsparkException extends Error {
@@ -135,7 +135,7 @@ type Query<T> = {
135
135
  * The function that will be called to construct the object from the
136
136
  * response. *
137
137
  */
138
- constructObject: (rawData: any) => T;
138
+ constructObject: (rawData: any) => T | null;
139
139
  /** The id of the node that will be used to sign the query. **/
140
140
  signingNodeId?: string;
141
141
  /** True if auth headers should be omitted for this query. **/
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ import {
27
27
  isErrorWithMessage,
28
28
  isNode,
29
29
  isNumber,
30
+ isObject,
30
31
  isSDKCurrencyAmount,
31
32
  isTest,
32
33
  isType,
@@ -43,7 +44,7 @@ import {
43
44
  setLocalStorageBoolean,
44
45
  sleep,
45
46
  urlsafe_b64decode
46
- } from "./chunk-XRYQNSG7.js";
47
+ } from "./chunk-YRWJVCZI.js";
47
48
 
48
49
  // src/Logger.ts
49
50
  var LoggingLevel = /* @__PURE__ */ ((LoggingLevel2) => {
@@ -743,6 +744,7 @@ export {
743
744
  isErrorWithMessage,
744
745
  isNode,
745
746
  isNumber,
747
+ isObject,
746
748
  isSDKCurrencyAmount,
747
749
  isTest,
748
750
  isType,
@@ -57,6 +57,7 @@ __export(utils_exports, {
57
57
  isErrorWithMessage: () => isErrorWithMessage,
58
58
  isNode: () => isNode,
59
59
  isNumber: () => isNumber,
60
+ isObject: () => isObject2,
60
61
  isSDKCurrencyAmount: () => isSDKCurrencyAmount,
61
62
  isTest: () => isTest,
62
63
  isType: () => isType,
@@ -999,8 +1000,12 @@ function lsidToUUID(lsid) {
999
1000
  }
1000
1001
 
1001
1002
  // src/utils/typeGuards.ts
1002
- function isUint8Array(variable) {
1003
- return variable instanceof Uint8Array;
1003
+ function isUint8Array(value) {
1004
+ return value instanceof Uint8Array;
1005
+ }
1006
+ function isObject2(value) {
1007
+ const type = typeof value;
1008
+ return value != null && (type == "object" || type == "function");
1004
1009
  }
1005
1010
 
1006
1011
  // src/utils/types.ts
@@ -1039,6 +1044,7 @@ function notNullUndefined(value) {
1039
1044
  isErrorWithMessage,
1040
1045
  isNode,
1041
1046
  isNumber,
1047
+ isObject,
1042
1048
  isSDKCurrencyAmount,
1043
1049
  isTest,
1044
1050
  isType,
@@ -1 +1 @@
1
- export { Z as ById, a7 as Complete, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a0 as DeepPartial, Y as ExpandRecursively, a1 as JSONLiteral, a3 as JSONObject, a2 as JSONType, X as Maybe, a4 as NN, _ as OmitTypename, a6 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, m as isSDKCurrencyAmount, w as isTest, $ as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a5 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from '../index-4698c2db.js';
1
+ export { _ as ById, a8 as Complete, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a1 as DeepPartial, Z as ExpandRecursively, a2 as JSONLiteral, a4 as JSONObject, a3 as JSONType, Y as Maybe, a5 as NN, $ as OmitTypename, a7 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, X as isObject, m as isSDKCurrencyAmount, w as isTest, a0 as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a6 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from '../index-b1e5d968.js';
@@ -1 +1 @@
1
- export { Z as ById, a7 as Complete, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a0 as DeepPartial, Y as ExpandRecursively, a1 as JSONLiteral, a3 as JSONObject, a2 as JSONType, X as Maybe, a4 as NN, _ as OmitTypename, a6 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, m as isSDKCurrencyAmount, w as isTest, $ as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a5 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from '../index-4698c2db.js';
1
+ export { _ as ById, a8 as Complete, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a1 as DeepPartial, Z as ExpandRecursively, a2 as JSONLiteral, a4 as JSONObject, a3 as JSONType, Y as Maybe, a5 as NN, $ as OmitTypename, a7 as PartialBy, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, X as isObject, m as isSDKCurrencyAmount, w as isTest, a0 as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a6 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from '../index-b1e5d968.js';
@@ -26,6 +26,7 @@ import {
26
26
  isErrorWithMessage,
27
27
  isNode,
28
28
  isNumber,
29
+ isObject,
29
30
  isSDKCurrencyAmount,
30
31
  isTest,
31
32
  isType,
@@ -42,7 +43,7 @@ import {
42
43
  setLocalStorageBoolean,
43
44
  sleep,
44
45
  urlsafe_b64decode
45
- } from "../chunk-XRYQNSG7.js";
46
+ } from "../chunk-YRWJVCZI.js";
46
47
  export {
47
48
  CurrencyUnit,
48
49
  abbrCurrencyUnit,
@@ -71,6 +72,7 @@ export {
71
72
  isErrorWithMessage,
72
73
  isNode,
73
74
  isNumber,
75
+ isObject,
74
76
  isSDKCurrencyAmount,
75
77
  isTest,
76
78
  isType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/core",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -11,7 +11,7 @@ type Query<T> = {
11
11
  * The function that will be called to construct the object from the
12
12
  * response. *
13
13
  */
14
- constructObject: (rawData: any) => T; // eslint-disable-line @typescript-eslint/no-explicit-any -- LIG-3400
14
+ constructObject: (rawData: any) => T | null; // eslint-disable-line @typescript-eslint/no-explicit-any -- LIG-3400
15
15
 
16
16
  /** The id of the node that will be used to sign the query. **/
17
17
  signingNodeId?: string;
@@ -1,3 +1,8 @@
1
- export function isUint8Array(variable: unknown): variable is Uint8Array {
2
- return variable instanceof Uint8Array;
1
+ export function isUint8Array(value: unknown): value is Uint8Array {
2
+ return value instanceof Uint8Array;
3
+ }
4
+
5
+ export function isObject(value: unknown): value is Record<string, unknown> {
6
+ const type = typeof value;
7
+ return value != null && (type == "object" || type == "function");
3
8
  }