@tolki/utils 1.1.0 → 1.2.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/dist/cast.d.ts ADDED
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Check if a value is arrayable (has a toArray method).
3
+ *
4
+ * @param value - The value to check
5
+ * @returns True if the value is arrayable
6
+ *
7
+ * @example
8
+ *
9
+ * isArrayable({ toArray: () => [1, 2, 3] }); -> true
10
+ * isArrayable([1, 2, 3]); -> false
11
+ * isArrayable("hello"); -> false
12
+ */
13
+ export declare function toArrayable<T>(value: unknown): value is {
14
+ toArray(): T[];
15
+ };
16
+ /**
17
+ * Check if a value is jsonable (has a toJSON method).
18
+ *
19
+ * @param value - The value to check
20
+ * @returns True if the value is jsonable
21
+ *
22
+ * @example
23
+ *
24
+ * isJsonable({ toJSON: () => ({ a: 1 }) }); -> true
25
+ * isJsonable("hello"); -> false
26
+ */
27
+ export declare function toJsonable<T>(value: unknown): value is {
28
+ toJson(): T;
29
+ } | {
30
+ toJSON(): T;
31
+ };
32
+ /**
33
+ * Check if a value is json serializable (has a jsonSerialize method).
34
+ *
35
+ * @param value - The value to check
36
+ * @returns True if the value is json serializable
37
+ *
38
+ * @example
39
+ *
40
+ * isJsonSerializable({ jsonSerialize: () => ({ a: 1 }) }); -> true
41
+ * isJsonSerializable("hello"); -> false
42
+ */
43
+ export declare function toJsonSerializable<T>(value: unknown): value is {
44
+ jsonSerialize(): T;
45
+ };
46
+ /**
47
+ * Convert a value to an array if it's already an array, otherwise return null.
48
+ * Used internally for safe array conversion without coercion.
49
+ *
50
+ * @param {unknown} value - The value to convert.
51
+ * @returns {unknown[] | null} The array if value is an array, null otherwise.
52
+ * @example
53
+ * Convert to array
54
+ * toArray([1, 2, 3]); -> [1, 2, 3]
55
+ * toArray("hello"); -> null
56
+ * toArray({}); -> null
57
+ */
58
+ export declare function castableToArray<T>(value: unknown): T[] | null;
59
+ /**
60
+ * Helper function to normalize data to an array format.
61
+ * Handles arrays only now.
62
+ *
63
+ * @param data - The data to normalize (array or other)
64
+ * @returns An array representation of the data, or null if not accessible
65
+ *
66
+ * @example
67
+ * normalizeToArray([1, 2, 3]); -> [1, 2, 3]
68
+ * normalizeToArray('hello'); -> null
69
+ */
70
+ export declare function normalizeToArray<T>(data: ReadonlyArray<T> | unknown): T[] | null;
71
+ /**
72
+ * Helper function to get normalized values from data.
73
+ * Returns array values or empty array if data is not accessible.
74
+ *
75
+ * @param data - The data to get values from
76
+ * @returns Array of values or empty array
77
+ *
78
+ * @example
79
+ * getAccessibleValues([1, 2, 3]); -> [1, 2, 3]
80
+ * getAccessibleValues('hello'); -> []
81
+ */
82
+ export declare function getAccessibleValues<T>(data: ReadonlyArray<T> | unknown): T[];
83
+ //# sourceMappingURL=cast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cast.d.ts","sourceRoot":"","sources":["../src/cast.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,OAAO,IAAI,CAAC,EAAE,CAAA;CAAE,CAM1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EACxB,KAAK,EAAE,OAAO,GACf,KAAK,IAAI;IAAE,MAAM,IAAI,CAAC,CAAA;CAAE,GAAG;IAAE,MAAM,IAAI,CAAC,CAAA;CAAE,CAS5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAChC,KAAK,EAAE,OAAO,GACf,KAAK,IAAI;IAAE,aAAa,IAAI,CAAC,CAAA;CAAE,CAMjC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,IAAI,CAG7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAC9B,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,GACjC,CAAC,EAAE,GAAG,IAAI,CAKZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,CAG5E"}
package/dist/cast.js ADDED
@@ -0,0 +1,30 @@
1
+ import { isArray as e, isObject as o, isNull as t, isFunction as n } from "./guards.js";
2
+ function a(r) {
3
+ return o(r) && !t(r) && n(r.toArray);
4
+ }
5
+ function f(r) {
6
+ if (!o(r) || t(r))
7
+ return !1;
8
+ const i = n(r.toJson), s = n(r.toJSON);
9
+ return i || s;
10
+ }
11
+ function l(r) {
12
+ return o(r) && !t(r) && n(r.jsonSerialize);
13
+ }
14
+ function A(r) {
15
+ return e(r) ? r : null;
16
+ }
17
+ function c(r) {
18
+ return Array.isArray(r) ? r.slice() : null;
19
+ }
20
+ function y(r) {
21
+ return c(r) || [];
22
+ }
23
+ export {
24
+ A as castableToArray,
25
+ y as getAccessibleValues,
26
+ c as normalizeToArray,
27
+ a as toArrayable,
28
+ l as toJsonSerializable,
29
+ f as toJsonable
30
+ };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Helper function to safely compare two unknown values for sorting.
3
+ * Provides stable comparison for objects using JSON serialization.
4
+ *
5
+ * @param a - First value to compare
6
+ * @param b - Second value to compare
7
+ * @returns -1 if a < b, 1 if a > b, 0 if equal
8
+ *
9
+ * @example
10
+ * compareValues(1, 2); -> -1
11
+ * compareValues('b', 'a'); -> 1
12
+ * compareValues({x: 1}, {x: 1}); -> 0
13
+ */
14
+ export declare function compareValues(a: unknown, b: unknown): number;
15
+ /**
16
+ * PHP-like loose equality comparison.
17
+ * Mimics PHP's == operator behavior where null, false, 0, '', and [] are considered loosely equal.
18
+ * Also handles deep comparison for arrays and objects.
19
+ *
20
+ * @param a - First value to compare
21
+ * @param b - Second value to compare
22
+ * @returns True if values are loosely equal in PHP-like manner
23
+ *
24
+ * @example
25
+ *
26
+ * looseEqual(null, false); -> true
27
+ * looseEqual(null, 0); -> true
28
+ * looseEqual(null, ''); -> true
29
+ * looseEqual(0, false); -> true
30
+ * looseEqual(1, '1'); -> true
31
+ * looseEqual(['a'], ['a']); -> true
32
+ */
33
+ export declare function looseEqual(a: unknown, b: unknown): boolean;
34
+ /**
35
+ * PHP-like strict equality comparison (=== operator).
36
+ * Performs strict type checking for primitives but value-based comparison for arrays and objects.
37
+ * NOTE: For class instances (objects with constructors other than Object), uses reference equality.
38
+ *
39
+ * @param a - First value to compare
40
+ * @param b - Second value to compare
41
+ * @returns True if values are strictly equal in PHP-like manner
42
+ *
43
+ * @example
44
+ *
45
+ * strictEqual(1, 1); -> true
46
+ * strictEqual(1, '1'); -> false (different types)
47
+ * strictEqual(['a'], ['a']); -> true (same array content)
48
+ * strictEqual({a: 1}, {a: 1}); -> true (same object content)
49
+ */
50
+ export declare function strictEqual(a: unknown, b: unknown): boolean;
51
+ //# sourceMappingURL=equality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equality.d.ts","sourceRoot":"","sources":["../src/equality.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAiB5D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAoG1D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAqE3D"}
@@ -0,0 +1,75 @@
1
+ function i(r, e) {
2
+ if (r == null && e == null) return 0;
3
+ if (r == null) return -1;
4
+ if (e == null) return 1;
5
+ if (typeof r == "object" && typeof e == "object") {
6
+ const l = JSON.stringify(r), f = JSON.stringify(e);
7
+ return l < f ? -1 : l > f ? 1 : 0;
8
+ }
9
+ return r < e ? -1 : r > e ? 1 : 0;
10
+ }
11
+ function u(r, e) {
12
+ if (r == e)
13
+ return !0;
14
+ if (typeof r == "boolean" || typeof e == "boolean") {
15
+ const n = typeof r == "boolean" ? r : e, t = typeof r == "boolean" ? e : r;
16
+ return n === !0 ? !(t === null || t === !1 || t === 0 || t === "" || Array.isArray(t) && t.length === 0) : t === null || t === 0 || t === "";
17
+ }
18
+ const l = r === null || r === !1 || r === 0 || r === "" || Array.isArray(r) && r.length === 0, f = e === null || e === !1 || e === 0 || e === "" || Array.isArray(e) && e.length === 0;
19
+ if (l && f)
20
+ return !0;
21
+ if (Array.isArray(r) && Array.isArray(e)) {
22
+ if (r.length !== e.length)
23
+ return !1;
24
+ for (let n = 0; n < r.length; n++)
25
+ if (!u(r[n], e[n]))
26
+ return !1;
27
+ return !0;
28
+ }
29
+ if (r !== null && e !== null && typeof r == "object" && typeof e == "object" && !Array.isArray(r) && !Array.isArray(e)) {
30
+ const n = Object.keys(r), t = Object.keys(e);
31
+ if (n.length !== t.length)
32
+ return !1;
33
+ for (const s of n)
34
+ if (!t.includes(s) || !u(
35
+ r[s],
36
+ e[s]
37
+ ))
38
+ return !1;
39
+ return !0;
40
+ }
41
+ return !1;
42
+ }
43
+ function o(r, e) {
44
+ if (r === e)
45
+ return !0;
46
+ if (Array.isArray(r) && Array.isArray(e)) {
47
+ if (r.length !== e.length)
48
+ return !1;
49
+ for (let l = 0; l < r.length; l++)
50
+ if (!o(r[l], e[l]))
51
+ return !1;
52
+ return !0;
53
+ }
54
+ if (r !== null && e !== null && typeof r == "object" && typeof e == "object" && !Array.isArray(r) && !Array.isArray(e)) {
55
+ const l = r.constructor === Object || r.constructor === void 0, f = e.constructor === Object || e.constructor === void 0;
56
+ if (!l || !f)
57
+ return !1;
58
+ const n = Object.keys(r), t = Object.keys(e);
59
+ if (n.length !== t.length)
60
+ return !1;
61
+ for (const s of n)
62
+ if (!t.includes(s) || !o(
63
+ r[s],
64
+ e[s]
65
+ ))
66
+ return !1;
67
+ return !0;
68
+ }
69
+ return !1;
70
+ }
71
+ export {
72
+ i as compareValues,
73
+ u as looseEqual,
74
+ o as strictEqual
75
+ };
@@ -0,0 +1,353 @@
1
+ import { DataItems } from '@tolki/types';
2
+ /**
3
+ * Check if a value is an array.
4
+ *
5
+ * @param value - The value to check
6
+ * @returns True if the value is an array
7
+ */
8
+ export declare function isArray<T>(value: DataItems<T> | T[] | unknown): value is T[];
9
+ /**
10
+ * Check if a value is an object (not null, not array).
11
+ *
12
+ * @param value - The value to check
13
+ * @returns True if the value is an object
14
+ *
15
+ * @example
16
+ *
17
+ * isObject({a: 1, b: 2}); -> true
18
+ * isObject([1, 2, 3]); -> false
19
+ * isObject(null); -> false
20
+ */
21
+ export declare function isObject<T, K extends PropertyKey = PropertyKey>(value: DataItems<T, K> | unknown): value is Record<K, T>;
22
+ /**
23
+ * Check if a value is any object (including arrays, null).
24
+ *
25
+ * @param value - The value to check
26
+ * @returns True if the value is any object
27
+ *
28
+ * @example
29
+ *
30
+ * isObjectAny({a: 1, b: 2}); -> true
31
+ * isObjectAny([1, 2, 3]); -> true
32
+ * isObjectAny(null); -> true
33
+ */
34
+ export declare function isObjectAny(value: unknown): value is object;
35
+ /**
36
+ * Check if a value is a truthy object (not null, not undefined, and an object).
37
+ *
38
+ * @param value - The value to check
39
+ * @returns True if the value is a truthy object
40
+ *
41
+ * @example
42
+ *
43
+ * isTruthyObject({a: 1, b: 2}); -> true
44
+ * isTruthyObject([1, 2, 3]); -> true
45
+ * isTruthyObject(null); -> false
46
+ * isTruthyObject(undefined); -> false
47
+ */
48
+ export declare function isTruthyObject(value: unknown): value is object;
49
+ /**
50
+ * Check if a value is a string.
51
+ *
52
+ * @param value - The value to check
53
+ * @returns True if the value is a string
54
+ *
55
+ * @example
56
+ *
57
+ * isString("hello"); -> true
58
+ * isString(123); -> false
59
+ * isString(null); -> false
60
+ */
61
+ export declare function isString(value: unknown): value is string;
62
+ /**
63
+ * Check if a value is stringable (can be converted to a string).
64
+ *
65
+ * @param value - The value to check
66
+ * @returns True if the value is stringable
67
+ *
68
+ * @example
69
+ *
70
+ * isStringable("hello"); -> true
71
+ * isStringable(new Stringable('test')); -> true
72
+ * isStringable({ toString: () => "world" }); -> true
73
+ * isStringable(123); -> false
74
+ * isStringable(null); -> false
75
+ */
76
+ export declare function isStringable(value: unknown): value is string | {
77
+ toString(): string;
78
+ };
79
+ /**
80
+ * Check if a value is an object with a toString method.
81
+ *
82
+ * @param value - The value to check
83
+ * @returns True if the value is an object with a toString method
84
+ */
85
+ export declare function objectToString(value: unknown): value is {
86
+ toString(): string;
87
+ };
88
+ /**
89
+ * Check if a value is a number (and not NaN).
90
+ *
91
+ * @param value - The value to check
92
+ * @returns True if the value is a valid number
93
+ *
94
+ * @example
95
+ *
96
+ * isNumber(123); -> true
97
+ * isNumber(3.14); -> true
98
+ * isNumber(NaN); -> false
99
+ * isNumber("123"); -> false
100
+ */
101
+ export declare function isNumber(value: unknown): value is number;
102
+ /**
103
+ * Check if a value is an integer.
104
+ *
105
+ * @param value - The value to check
106
+ * @returns True if the value is an integer
107
+ */
108
+ export declare function isInteger(value: unknown): value is number;
109
+ /**
110
+ * Check if a value is a float.
111
+ *
112
+ * @param value - The value to check
113
+ * @returns True if the value is a float
114
+ */
115
+ export declare function isFloat(value: unknown): value is number;
116
+ /**
117
+ * Check if a value is a positive number.
118
+ *
119
+ * @param value - The value to check
120
+ * @returns True if the value is a positive number
121
+ */
122
+ export declare function isPositiveNumber(value: unknown): value is number;
123
+ /**
124
+ * Check if a value is a negative number.
125
+ *
126
+ * @param value - The value to check
127
+ * @returns True if the value is a negative number
128
+ */
129
+ export declare function isNegativeNumber(value: unknown): value is number;
130
+ /**
131
+ * Check if a value is a boolean.
132
+ *
133
+ * @param value - The value to check
134
+ * @returns True if the value is a boolean
135
+ *
136
+ * @example
137
+ *
138
+ * isBoolean(true); -> true
139
+ * isBoolean(false); -> true
140
+ * isBoolean(0); -> false
141
+ * isBoolean("true"); -> false
142
+ */
143
+ export declare function isBoolean(value: unknown): value is boolean;
144
+ /**
145
+ * Check if a value is a function.
146
+ *
147
+ * @param value - The value to check
148
+ * @returns True if the value is a function
149
+ *
150
+ * @example
151
+ *
152
+ * isFunction(() => {}); -> true
153
+ * isFunction(Math.max); -> true
154
+ * isFunction("function"); -> false
155
+ * isFunction({}); -> false
156
+ */
157
+ export declare function isFunction<T extends (...args: unknown[]) => unknown>(value: unknown): value is T;
158
+ /**
159
+ * Check if a value is undefined.
160
+ *
161
+ * @param value - The value to check
162
+ * @returns True if the value is undefined
163
+ *
164
+ * @example
165
+ *
166
+ * isUndefined(undefined); -> true
167
+ * isUndefined(null); -> false
168
+ * isUndefined(""); -> false
169
+ * isUndefined(0); -> false
170
+ */
171
+ export declare function isUndefined(value: unknown): value is undefined;
172
+ /**
173
+ * Check if a value is a symbol.
174
+ *
175
+ * @param value - The value to check
176
+ * @returns True if the value is a symbol
177
+ *
178
+ * @example
179
+ *
180
+ * isSymbol(Symbol('test')); -> true
181
+ * isSymbol(Symbol.iterator); -> true
182
+ * isSymbol("symbol"); -> false
183
+ * isSymbol({}); -> false
184
+ */
185
+ export declare function isSymbol(value: unknown): value is symbol;
186
+ /**
187
+ * Check if a value is null.
188
+ *
189
+ * @param value - The value to check
190
+ * @returns True if the value is null
191
+ *
192
+ * @example
193
+ *
194
+ * isNull(null); -> true
195
+ * isNull(undefined); -> false
196
+ * isNull(""); -> false
197
+ * isNull(0); -> false
198
+ */
199
+ export declare function isNull(value: unknown): value is null;
200
+ /**
201
+ * Check if a value is a Map.
202
+ *
203
+ * @param value - The value to check
204
+ * @returns True if the value is a Map
205
+ *
206
+ * @example
207
+ *
208
+ * isMap(new Map()); -> true
209
+ * isMap({}); -> false
210
+ * isMap([]); -> false
211
+ */
212
+ export declare function isMap<K, V>(value: unknown): value is Map<K, V>;
213
+ /**
214
+ * Check if a value is a Set.
215
+ *
216
+ * @param value - The value to check
217
+ * @returns True if the value is a Set
218
+ *
219
+ * @example
220
+ *
221
+ * isSet(new Set()); -> true
222
+ * isSet({}); -> false
223
+ * isSet([]); -> false
224
+ */
225
+ export declare function isSet<T>(value: unknown): value is Set<T>;
226
+ /**
227
+ * Check if a value is iterable, meaning it implements the iterator protocol.
228
+ *
229
+ * Strings are excluded on purpose because they are treated as scalar values
230
+ * rather than collections, which mirrors how PHP treats strings when a
231
+ * function accepts an `iterable`.
232
+ *
233
+ * @param value - The value to check
234
+ * @returns True if the value can be iterated over with `for...of`
235
+ *
236
+ * @example
237
+ *
238
+ * isIterable([1, 2, 3]); -> true
239
+ * isIterable(new Set([1, 2])); -> true
240
+ * isIterable(new Map()); -> true
241
+ * isIterable("abc"); -> false
242
+ * isIterable({ a: 1 }); -> false
243
+ */
244
+ export declare function isIterable<T>(value: unknown): value is Iterable<T>;
245
+ /**
246
+ * Check if a value is a WeakMap.
247
+ *
248
+ * @param value - The value to check
249
+ * @returns True if the value is a WeakMap
250
+ */
251
+ export declare function isWeakMap<K extends object, V>(value: unknown): value is WeakMap<K, V>;
252
+ /**
253
+ * Check if a value is a WeakSet.
254
+ *
255
+ * @param value - The value to check
256
+ * @returns True if the value is a WeakSet
257
+ */
258
+ export declare function isWeakSet<T extends object>(value: unknown): value is WeakSet<T>;
259
+ /**
260
+ * Check if a value is falsy (undefined, null, false, 0, "", empty array/object).
261
+ *
262
+ * @param value - The value to check
263
+ * @returns True if the value is falsy
264
+ *
265
+ * @example
266
+ *
267
+ * isFalsy(undefined); -> true
268
+ * isFalsy(null); -> true
269
+ * isFalsy(false); -> true
270
+ * isFalsy(0); -> true
271
+ * isFalsy(""); -> true
272
+ * isFalsy([]); -> true
273
+ * isFalsy({}); -> true
274
+ * isFalsy("hello"); -> false
275
+ * isFalsy([1, 2, 3]); -> false
276
+ * isFalsy({ a: 1 }); -> false
277
+ */
278
+ export declare function isFalsy<TValue = unknown>(value: TValue): boolean;
279
+ /**
280
+ * Check if a value is truthy (not falsy).
281
+ *
282
+ * @param value - The value to check
283
+ * @returns True if the value is truthy
284
+ *
285
+ * @example
286
+ *
287
+ * isTruthy(1); -> true
288
+ * isTruthy("hello"); -> true
289
+ * isTruthy([1, 2, 3]); -> true
290
+ * isTruthy({ a: 1 }); -> true
291
+ * isTruthy(0); -> false
292
+ * isTruthy(""); -> false
293
+ * isTruthy([]); -> false
294
+ * isTruthy({}); -> false
295
+ */
296
+ export declare function isTruthy(value: unknown): boolean;
297
+ /**
298
+ * Check if a value is a primitive type (null, boolean, number, string, symbol, undefined).
299
+ *
300
+ * @param value - The value to check
301
+ * @returns True if the value is a primitive
302
+ *
303
+ * @example
304
+ *
305
+ * isPrimitive(123); -> true
306
+ * isPrimitive("hello"); -> true
307
+ * isPrimitive(null); -> true
308
+ * isPrimitive({}); -> false
309
+ * isPrimitive([]); -> false
310
+ */
311
+ export declare function isPrimitive(value: unknown): boolean;
312
+ /**
313
+ * Check if a value is a non-primitive type (object, array, function, etc.).
314
+ *
315
+ * @param value - The value to check
316
+ * @returns True if the value is a non-primitive
317
+ *
318
+ * @example
319
+ *
320
+ * isNonPrimitive({}); -> true
321
+ * isNonPrimitive([]); -> true
322
+ * isNonPrimitive(() => {}); -> true
323
+ * isNonPrimitive(123); -> false
324
+ * isNonPrimitive("hello"); -> false
325
+ */
326
+ export declare function isNonPrimitive(value: unknown): boolean;
327
+ /**
328
+ * Check if a value is a finite number.
329
+ *
330
+ * @param value - The value to check
331
+ * @returns True if the value is a finite number
332
+ *
333
+ * @example
334
+ *
335
+ * isFiniteNumber(123); -> true
336
+ * isFiniteNumber(3.14); -> true
337
+ * isFiniteNumber(Infinity); -> false
338
+ * isFiniteNumber(NaN); -> false
339
+ * isFiniteNumber("123"); -> false
340
+ */
341
+ export declare function isFiniteNumber(value: unknown): value is number;
342
+ /**
343
+ * Helper function to check if data is accessible (array only).
344
+ *
345
+ * @param data - The data to check
346
+ * @returns True if data is an array
347
+ *
348
+ * @example
349
+ * isAccessibleData([1, 2, 3]); -> true
350
+ * isAccessibleData('hello'); -> false
351
+ */
352
+ export declare function isAccessibleData(data: unknown): boolean;
353
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,OAAO,GAAG,KAAK,IAAI,CAAC,EAAE,CAE5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW,EAC3D,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,GACjC,KAAK,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAEvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,MAAM,GAAG;IAAE,QAAQ,IAAI,MAAM,CAAA;CAAE,CAc1C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,OAAO,GACf,KAAK,IAAI;IAAE,QAAQ,IAAI,MAAM,CAAA;CAAE,CASjC;AAED;;;;;;;;;;;;GAYG;AAC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