@tolki/utils 1.6.2 → 1.6.4

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/guards.js CHANGED
@@ -1,184 +1,174 @@
1
- function b(t) {
2
- return Array.isArray(t);
1
+ // src/guards.ts
2
+ /* @__NO_SIDE_EFFECTS__ */
3
+ function e(e) {
4
+ return Array.isArray(e);
5
+ }
6
+ /* @__NO_SIDE_EFFECTS__ */
7
+ function t(t) {
8
+ return !/* @__PURE__ */ b(t) && typeof t == "object" && !/* @__PURE__ */ e(t);
9
+ }
10
+ /* @__NO_SIDE_EFFECTS__ */
11
+ function n(e) {
12
+ if (!/* @__PURE__ */ t(e)) return !1;
13
+ let n = Object.getPrototypeOf(e);
14
+ return n === Object.prototype || n === null;
15
+ }
16
+ /* @__NO_SIDE_EFFECTS__ */
17
+ function r(e) {
18
+ return /* @__PURE__ */ n(e) && Object.hasOwn(e, "name") && /* @__PURE__ */ s(e.name) && Object.hasOwn(e, "value") && (/* @__PURE__ */ s(e.value) || /* @__PURE__ */ u(e.value));
19
+ }
20
+ /* @__NO_SIDE_EFFECTS__ */
21
+ function i(e) {
22
+ return typeof e == "object";
23
+ }
24
+ /* @__NO_SIDE_EFFECTS__ */
25
+ function a(e) {
26
+ return !/* @__PURE__ */ b(e) && !/* @__PURE__ */ v(e) && /* @__PURE__ */ i(e);
27
+ }
28
+ /* @__NO_SIDE_EFFECTS__ */
29
+ function o(e) {
30
+ if (!/* @__PURE__ */ a(e) && !/* @__PURE__ */ _(e)) return !1;
31
+ let t = Object.getOwnPropertyDescriptor(e, "constructor")?.value;
32
+ return /* @__PURE__ */ _(t) && t.prototype === e;
33
+ }
34
+ /* @__NO_SIDE_EFFECTS__ */
35
+ function s(e) {
36
+ return typeof e == "string";
37
+ }
38
+ /* @__NO_SIDE_EFFECTS__ */
39
+ function c(e) {
40
+ return !!(/* @__PURE__ */ s(e) || /* @__PURE__ */ u(e) || /* @__PURE__ */ l(e));
41
+ }
42
+ /* @__NO_SIDE_EFFECTS__ */
43
+ function l(e) {
44
+ return !!(/* @__PURE__ */ t(e) && /* @__PURE__ */ _(e.toString));
45
+ }
46
+ /* @__NO_SIDE_EFFECTS__ */
47
+ function u(e) {
48
+ return typeof e == "number" && !isNaN(e);
49
+ }
50
+ /* @__NO_SIDE_EFFECTS__ */
51
+ function d(e) {
52
+ return /* @__PURE__ */ u(e) && Number.isInteger(e);
53
+ }
54
+ /* @__NO_SIDE_EFFECTS__ */
55
+ function f(e) {
56
+ return /* @__PURE__ */ u(e) && !Number.isInteger(e);
57
+ }
58
+ /* @__NO_SIDE_EFFECTS__ */
59
+ function p(e) {
60
+ return /* @__PURE__ */ d(e) && e >= -(2 ** 63) && e < 2 ** 63 && !Object.is(e, -0);
61
+ }
62
+ /* @__NO_SIDE_EFFECTS__ */
63
+ function m(e) {
64
+ return /* @__PURE__ */ u(e) && e >= 0;
65
+ }
66
+ /* @__NO_SIDE_EFFECTS__ */
67
+ function h(e) {
68
+ return /* @__PURE__ */ u(e) && e < 0;
69
+ }
70
+ /* @__NO_SIDE_EFFECTS__ */
71
+ function g(e) {
72
+ return typeof e == "boolean";
73
+ }
74
+ /* @__NO_SIDE_EFFECTS__ */
75
+ function _(e) {
76
+ return typeof e == "function";
77
+ }
78
+ /* @__NO_SIDE_EFFECTS__ */
79
+ function v(e) {
80
+ return e === void 0;
81
+ }
82
+ /* @__NO_SIDE_EFFECTS__ */
83
+ function y(e) {
84
+ return typeof e == "symbol";
85
+ }
86
+ /* @__NO_SIDE_EFFECTS__ */
87
+ function b(e) {
88
+ return e === null;
89
+ }
90
+ /* @__NO_SIDE_EFFECTS__ */
91
+ function x(e) {
92
+ return e instanceof Map;
93
+ }
94
+ /* @__NO_SIDE_EFFECTS__ */
95
+ function S(e) {
96
+ return e instanceof Set;
97
+ }
98
+ /* @__NO_SIDE_EFFECTS__ */
99
+ function C(e) {
100
+ return /* @__PURE__ */ b(e) || /* @__PURE__ */ v(e) || /* @__PURE__ */ s(e) ? !1 : /* @__PURE__ */ _(e[Symbol.iterator]);
101
+ }
102
+ /* @__NO_SIDE_EFFECTS__ */
103
+ function w(e) {
104
+ return e instanceof WeakMap;
3
105
  }
4
- function y(t) {
5
- return !o(t) && typeof t == "object" && !b(t);
106
+ /* @__NO_SIDE_EFFECTS__ */
107
+ function T(e) {
108
+ return e instanceof WeakSet;
6
109
  }
7
- function m(t) {
8
- if (!y(t))
9
- return !1;
10
- const n = Object.getPrototypeOf(t);
11
- return n === Object.prototype || n === null;
110
+ /* @__NO_SIDE_EFFECTS__ */
111
+ function E(n) {
112
+ return Number.isNaN(n) ? !0 : /* @__PURE__ */ u(n) ? n === 0 : /* @__PURE__ */ v(n) || /* @__PURE__ */ b(n) ? !0 : /* @__PURE__ */ g(n) ? n === !1 : /* @__PURE__ */ s(n) ? n.trim() === "" : /* @__PURE__ */ x(n) || /* @__PURE__ */ S(n) ? n.size === 0 : /* @__PURE__ */ e(n) ? n.length === 0 : /* @__PURE__ */ t(n) ? Object.keys(n).length === 0 : !1;
12
113
  }
13
- function w(t) {
14
- return m(t) && Object.hasOwn(t, "name") && e(t.name) && Object.hasOwn(t, "value") && (e(t.value) || r(t.value));
114
+ /* @__NO_SIDE_EFFECTS__ */
115
+ function D(e) {
116
+ return !/* @__PURE__ */ E(e);
15
117
  }
16
- function j(t) {
17
- return typeof t == "object";
118
+ /* @__NO_SIDE_EFFECTS__ */
119
+ function O(t) {
120
+ return t === !1 || t === null || /* @__PURE__ */ v(t) || t === 0 || t === 0n || t === "" || t === "0" ? !0 : /* @__PURE__ */ e(t) ? t.length === 0 : /* @__PURE__ */ x(t) || /* @__PURE__ */ S(t) ? t.size === 0 : /* @__PURE__ */ n(t) ? Object.keys(t).length === 0 : !1;
18
121
  }
19
- function P(t) {
20
- return !o(t) && !c(t) && j(t);
122
+ var k = /^[ \t\n\r\v\f]*[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[ \t\n\r\v\f]*$/;
123
+ /* @__NO_SIDE_EFFECTS__ */
124
+ function A(e) {
125
+ return typeof e == "number" ? !0 : /* @__PURE__ */ s(e) ? k.test(e) : !1;
21
126
  }
22
- function E(t) {
23
- if (!P(t) && !u(t))
24
- return !1;
25
- const n = Object.getOwnPropertyDescriptor(
26
- t,
27
- "constructor"
28
- )?.value;
29
- return u(n) && n.prototype === t;
127
+ /* @__NO_SIDE_EFFECTS__ */
128
+ function j(e) {
129
+ return /* @__PURE__ */ b(e) || /* @__PURE__ */ g(e) || /* @__PURE__ */ u(e) || /* @__PURE__ */ s(e) || /* @__PURE__ */ y(e) || /* @__PURE__ */ v(e);
30
130
  }
31
- function e(t) {
32
- return typeof t == "string";
131
+ /* @__NO_SIDE_EFFECTS__ */
132
+ function M(e) {
133
+ return !/* @__PURE__ */ j(e);
33
134
  }
34
- function W(t) {
35
- return !!(e(t) || r(t) || S(t));
135
+ /* @__NO_SIDE_EFFECTS__ */
136
+ function N(e) {
137
+ return /* @__PURE__ */ u(e) && Number.isFinite(e);
36
138
  }
37
- function S(t) {
38
- return !!(y(t) && u(t.toString));
39
- }
40
- function r(t) {
41
- return typeof t == "number" && !isNaN(t);
42
- }
43
- function d(t) {
44
- return r(t) && Number.isInteger(t);
45
- }
46
- function z(t) {
47
- return r(t) && !Number.isInteger(t);
48
- }
49
- function R(t) {
50
- return d(t) && t >= -9223372036854776e3 && t < 2 ** 63 && !Object.is(t, -0);
51
- }
52
- function _(t) {
53
- return r(t) && t >= 0;
54
- }
55
- function B(t) {
56
- return r(t) && t < 0;
57
- }
58
- function N(t) {
59
- return typeof t == "boolean";
60
- }
61
- function u(t) {
62
- return typeof t == "function";
63
- }
64
- function c(t) {
65
- return typeof t > "u";
66
- }
67
- function A(t) {
68
- return typeof t == "symbol";
69
- }
70
- function o(t) {
71
- return t === null;
72
- }
73
- function h(t) {
74
- return t instanceof Map;
75
- }
76
- function g(t) {
77
- return t instanceof Set;
78
- }
79
- function C(t) {
80
- return o(t) || c(t) || e(t) ? !1 : u(
81
- t[Symbol.iterator]
82
- );
83
- }
84
- function D(t) {
85
- return t instanceof WeakMap;
86
- }
87
- function U(t) {
88
- return t instanceof WeakSet;
89
- }
90
- function k(t) {
91
- return Number.isNaN(t) ? !0 : r(t) ? t === 0 : c(t) || o(t) ? !0 : N(t) ? t === !1 : e(t) ? t.trim() === "" : h(t) || g(t) ? t.size === 0 : b(t) ? t.length === 0 : y(t) ? Object.keys(t).length === 0 : !1;
92
- }
93
- function V(t) {
94
- return !k(t);
95
- }
96
- function x(t) {
97
- return t === !1 || t === null || c(t) || t === 0 || t === 0n || t === "" || t === "0" ? !0 : b(t) ? t.length === 0 : h(t) || g(t) ? t.size === 0 : m(t) ? Object.keys(t).length === 0 : !1;
98
- }
99
- const I = /^[ \t\n\r\v\f]*[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[ \t\n\r\v\f]*$/;
100
- function G(t) {
101
- return typeof t == "number" ? !0 : e(t) ? I.test(t) : !1;
102
- }
103
- function M(t) {
104
- return o(t) || N(t) || r(t) || e(t) || A(t) || c(t);
105
- }
106
- function H(t) {
107
- return !M(t);
139
+ /* @__NO_SIDE_EFFECTS__ */
140
+ function P(e) {
141
+ return Array.isArray(e);
108
142
  }
143
+ /* @__NO_SIDE_EFFECTS__ */
109
144
  function F(t) {
110
- return r(t) && Number.isFinite(t);
111
- }
112
- function $(t) {
113
- return Array.isArray(t);
114
- }
115
- function q(t) {
116
- return b(t) || m(t) || h(t);
117
- }
118
- function p(t) {
119
- if (e(t))
120
- return t;
121
- if (N(t))
122
- return t ? "1" : "";
123
- if (o(t))
124
- return "";
125
- if (F(t)) {
126
- const n = String(t);
127
- return n.includes("e") ? null : n;
128
- }
129
- return null;
130
- }
131
- function T(t, n) {
132
- const f = p(t), i = p(n);
133
- return f !== null && i !== null ? f === i : t === n || typeof t == "number" && typeof n == "number" && Number.isNaN(t) && Number.isNaN(n);
134
- }
135
- function J(t) {
136
- const n = /* @__PURE__ */ new Set(), f = [];
137
- for (const i of t) {
138
- const s = p(i);
139
- o(s) ? f.push(i) : n.add(s);
140
- }
141
- return (i) => {
142
- const s = p(i);
143
- return o(s) ? f.some((O) => T(i, O)) : n.has(s);
144
- };
145
- }
146
- export {
147
- $ as isAccessibleData,
148
- b as isArray,
149
- N as isBoolean,
150
- w as isEnumCase,
151
- k as isFalsy,
152
- F as isFiniteNumber,
153
- z as isFloat,
154
- u as isFunction,
155
- d as isInteger,
156
- C as isIterable,
157
- h as isMap,
158
- B as isNegativeNumber,
159
- H as isNonPrimitive,
160
- o as isNull,
161
- r as isNumber,
162
- y as isObject,
163
- j as isObjectAny,
164
- q as isPhpAccessible,
165
- x as isPhpFalsy,
166
- R as isPhpInt,
167
- G as isPhpNumeric,
168
- m as isPlainObject,
169
- _ as isPositiveNumber,
170
- M as isPrimitive,
171
- E as isPrototypeObject,
172
- g as isSet,
173
- e as isString,
174
- W as isStringable,
175
- A as isSymbol,
176
- V as isTruthy,
177
- P as isTruthyObject,
178
- c as isUndefined,
179
- D as isWeakMap,
180
- U as isWeakSet,
181
- S as objectToString,
182
- T as phpValueMatch,
183
- J as phpValueMatcher
184
- };
145
+ return /* @__PURE__ */ e(t) || /* @__PURE__ */ n(t) || /* @__PURE__ */ x(t);
146
+ }
147
+ function I(e) {
148
+ if (/* @__PURE__ */ s(e)) return e;
149
+ if (/* @__PURE__ */ g(e)) return e ? "1" : "";
150
+ if (/* @__PURE__ */ b(e)) return "";
151
+ if (/* @__PURE__ */ N(e)) {
152
+ let t = String(e);
153
+ return t.includes("e") ? null : t;
154
+ }
155
+ return null;
156
+ }
157
+ /* @__NO_SIDE_EFFECTS__ */
158
+ function L(e, t) {
159
+ let n = I(e), r = I(t);
160
+ return n !== null && r !== null ? n === r : e === t || typeof e == "number" && typeof t == "number" && Number.isNaN(e) && Number.isNaN(t);
161
+ }
162
+ /* @__NO_SIDE_EFFECTS__ */
163
+ function R(e) {
164
+ let t = /* @__PURE__ */ new Set(), n = [];
165
+ for (let r of e) {
166
+ let e = I(r);
167
+ /* @__PURE__ */ b(e) ? n.push(r) : t.add(e);
168
+ }
169
+ return (e) => {
170
+ let r = I(e);
171
+ return /* @__PURE__ */ b(r) ? n.some((t) => /* @__PURE__ */ L(e, t)) : t.has(r);
172
+ };
173
+ }
174
+ export { P as isAccessibleData, e as isArray, g as isBoolean, r as isEnumCase, E as isFalsy, N as isFiniteNumber, f as isFloat, _ as isFunction, d as isInteger, C as isIterable, x as isMap, h as isNegativeNumber, M as isNonPrimitive, b as isNull, u as isNumber, t as isObject, i as isObjectAny, F as isPhpAccessible, O as isPhpFalsy, p as isPhpInt, A as isPhpNumeric, n as isPlainObject, m as isPositiveNumber, j as isPrimitive, o as isPrototypeObject, S as isSet, s as isString, c as isStringable, y as isSymbol, D as isTruthy, a as isTruthyObject, v as isUndefined, w as isWeakMap, T as isWeakSet, l as objectToString, L as phpValueMatch, R as phpValueMatcher };
package/dist/index.js CHANGED
@@ -1,104 +1,11 @@
1
- import { arrayableItems as t, arrayableValues as i, castableToArray as s, cssListItemToString as a, getAccessibleValues as o, normalizeToArray as p, phpIntArgument as l, phpIntCast as n, phpStringCast as y, toArrayable as c, toJsonSerializable as m, toJsonable as u, toPhpKeyString as h } from "./cast.js";
2
- import { compareValues as b, looseEqual as S, operatorMatch as x, strictEqual as f } from "./equality.js";
3
- import { InvalidArgumentException as K, ItemNotFoundException as d, MultipleItemsFoundException as A, UnexpectedValueException as P } from "./exceptions.js";
4
- import { isAccessibleData as E, isArray as M, isBoolean as N, isEnumCase as T, isFalsy as F, isFiniteNumber as O, isFloat as V, isFunction as C, isInteger as j, isIterable as k, isMap as w, isNegativeNumber as L, isNonPrimitive as U, isNull as z, isNumber as D, isObject as R, isObjectAny as W, isPhpAccessible as q, isPhpFalsy as J, isPhpInt as B, isPhpNumeric as G, isPlainObject as H, isPositiveNumber as Q, isPrimitive as X, isPrototypeObject as Y, isSet as Z, isString as _, isStringable as $, isSymbol as ee, isTruthy as re, isTruthyObject as te, isUndefined as ie, isWeakMap as se, isWeakSet as ae, objectToString as oe, phpValueMatch as pe, phpValueMatcher as le } from "./guards.js";
5
- import { arrayKeyExistsError as ye, defineKey as ce, deleteMapKey as me, entriesKeyValue as ue, hasOwnToString as he, isIllegalOffset as ge, isIntegerLikeKey as be, isPhpArrayKey as Se, isUnsafeKey as xe, keyedEntries as fe, nextIntegerKey as Ie, phpArrayKey as Ke, phpComputedKey as de, readMapKey as Ae, reindexIntegerKeys as Pe, renumberPhpIntegerKeys as ve, writeMapKey as Ee } from "./keys.js";
6
- import { resolvePadLength as Ne, resolveRangeSize as Te, resolveSliceRange as Fe, resolveSpliceRange as Oe, resolveTakeCount as Ve } from "./range.js";
7
- import { phpDebugType as je, phpTypeName as ke, resolveDefault as we, typeOf as Le } from "./reflect.js";
8
- import { createSortSpecComparator as ze, phpSortComparator as De } from "./sorting.js";
9
- import { arrayValueMessage as We, escapeShellArg as qe, escapeWindowsShellArg as Je, lowerFirst as Be, toLower as Ge, toUpper as He, upperFirst as Qe } from "./string.js";
10
- export {
11
- K as InvalidArgumentException,
12
- d as ItemNotFoundException,
13
- A as MultipleItemsFoundException,
14
- P as UnexpectedValueException,
15
- ye as arrayKeyExistsError,
16
- We as arrayValueMessage,
17
- t as arrayableItems,
18
- i as arrayableValues,
19
- s as castableToArray,
20
- b as compareValues,
21
- ze as createSortSpecComparator,
22
- a as cssListItemToString,
23
- ce as defineKey,
24
- me as deleteMapKey,
25
- ue as entriesKeyValue,
26
- qe as escapeShellArg,
27
- Je as escapeWindowsShellArg,
28
- o as getAccessibleValues,
29
- he as hasOwnToString,
30
- E as isAccessibleData,
31
- M as isArray,
32
- N as isBoolean,
33
- T as isEnumCase,
34
- F as isFalsy,
35
- O as isFiniteNumber,
36
- V as isFloat,
37
- C as isFunction,
38
- ge as isIllegalOffset,
39
- j as isInteger,
40
- be as isIntegerLikeKey,
41
- k as isIterable,
42
- w as isMap,
43
- L as isNegativeNumber,
44
- U as isNonPrimitive,
45
- z as isNull,
46
- D as isNumber,
47
- R as isObject,
48
- W as isObjectAny,
49
- q as isPhpAccessible,
50
- Se as isPhpArrayKey,
51
- J as isPhpFalsy,
52
- B as isPhpInt,
53
- G as isPhpNumeric,
54
- H as isPlainObject,
55
- Q as isPositiveNumber,
56
- X as isPrimitive,
57
- Y as isPrototypeObject,
58
- Z as isSet,
59
- _ as isString,
60
- $ as isStringable,
61
- ee as isSymbol,
62
- re as isTruthy,
63
- te as isTruthyObject,
64
- ie as isUndefined,
65
- xe as isUnsafeKey,
66
- se as isWeakMap,
67
- ae as isWeakSet,
68
- fe as keyedEntries,
69
- S as looseEqual,
70
- Be as lowerFirst,
71
- Ie as nextIntegerKey,
72
- p as normalizeToArray,
73
- oe as objectToString,
74
- x as operatorMatch,
75
- Ke as phpArrayKey,
76
- de as phpComputedKey,
77
- je as phpDebugType,
78
- l as phpIntArgument,
79
- n as phpIntCast,
80
- De as phpSortComparator,
81
- y as phpStringCast,
82
- ke as phpTypeName,
83
- pe as phpValueMatch,
84
- le as phpValueMatcher,
85
- Ae as readMapKey,
86
- Pe as reindexIntegerKeys,
87
- ve as renumberPhpIntegerKeys,
88
- we as resolveDefault,
89
- Ne as resolvePadLength,
90
- Te as resolveRangeSize,
91
- Fe as resolveSliceRange,
92
- Oe as resolveSpliceRange,
93
- Ve as resolveTakeCount,
94
- f as strictEqual,
95
- c as toArrayable,
96
- m as toJsonSerializable,
97
- u as toJsonable,
98
- Ge as toLower,
99
- h as toPhpKeyString,
100
- He as toUpper,
101
- Le as typeOf,
102
- Qe as upperFirst,
103
- Ee as writeMapKey
104
- };
1
+ import { isAccessibleData as e, isArray as t, isBoolean as n, isEnumCase as r, isFalsy as i, isFiniteNumber as a, isFloat as o, isFunction as s, isInteger as c, isIterable as l, isMap as u, isNegativeNumber as d, isNonPrimitive as f, isNull as p, isNumber as m, isObject as h, isObjectAny as g, isPhpAccessible as _, isPhpFalsy as v, isPhpInt as y, isPhpNumeric as b, isPlainObject as x, isPositiveNumber as S, isPrimitive as C, isPrototypeObject as w, isSet as T, isString as E, isStringable as D, isSymbol as O, isTruthy as k, isTruthyObject as A, isUndefined as j, isWeakMap as M, isWeakSet as N, objectToString as P, phpValueMatch as F, phpValueMatcher as I } from "./guards.js";
2
+ import { phpDebugType as L, phpTypeName as R, resolveDefault as z, typeOf as B } from "./reflect.js";
3
+ import { arrayKeyExistsError as V, defineKey as H, deleteMapKey as U, entriesKeyValue as W, hasOwnToString as G, isIllegalOffset as K, isIntegerLikeKey as q, isPhpArrayKey as J, isUnsafeKey as Y, keyedEntries as X, nextIntegerKey as Z, phpArrayKey as Q, phpComputedKey as $, readMapKey as ee, reindexIntegerKeys as te, renumberPhpIntegerKeys as ne, writeMapKey as re } from "./keys.js";
4
+ import { arrayableItems as ie, arrayableValues as ae, castableToArray as oe, cssListItemToString as se, getAccessibleValues as ce, normalizeToArray as le, phpIntArgument as ue, phpIntCast as de, phpStringCast as fe, toArrayable as pe, toJsonSerializable as me, toJsonable as he, toPhpKeyString as ge } from "./cast.js";
5
+ import { compareValues as _e, looseEqual as ve, operatorMatch as ye, strictEqual as be } from "./equality.js";
6
+ import { InvalidArgumentException as xe, ItemNotFoundException as Se, MultipleItemsFoundException as Ce, UnexpectedValueException as we } from "./exceptions.js";
7
+ import { resolvePadLength as Te, resolveRangeSize as Ee, resolveSliceRange as De, resolveSpliceRange as Oe, resolveTakeCount as ke } from "./range.js";
8
+ import { createSortSpecComparator as Ae, phpSortComparator as je } from "./sorting.js";
9
+ import { arrayValueMessage as Me, escapeShellArg as Ne, escapeWindowsShellArg as Pe, lowerFirst as Fe, toLower as Ie, toUpper as Le, upperFirst as Re } from "./string.js";
10
+ import "./utils.js";
11
+ export { xe as InvalidArgumentException, Se as ItemNotFoundException, Ce as MultipleItemsFoundException, we as UnexpectedValueException, V as arrayKeyExistsError, Me as arrayValueMessage, ie as arrayableItems, ae as arrayableValues, oe as castableToArray, _e as compareValues, Ae as createSortSpecComparator, se as cssListItemToString, H as defineKey, U as deleteMapKey, W as entriesKeyValue, Ne as escapeShellArg, Pe as escapeWindowsShellArg, ce as getAccessibleValues, G as hasOwnToString, e as isAccessibleData, t as isArray, n as isBoolean, r as isEnumCase, i as isFalsy, a as isFiniteNumber, o as isFloat, s as isFunction, K as isIllegalOffset, c as isInteger, q as isIntegerLikeKey, l as isIterable, u as isMap, d as isNegativeNumber, f as isNonPrimitive, p as isNull, m as isNumber, h as isObject, g as isObjectAny, _ as isPhpAccessible, J as isPhpArrayKey, v as isPhpFalsy, y as isPhpInt, b as isPhpNumeric, x as isPlainObject, S as isPositiveNumber, C as isPrimitive, w as isPrototypeObject, T as isSet, E as isString, D as isStringable, O as isSymbol, k as isTruthy, A as isTruthyObject, j as isUndefined, Y as isUnsafeKey, M as isWeakMap, N as isWeakSet, X as keyedEntries, ve as looseEqual, Fe as lowerFirst, Z as nextIntegerKey, le as normalizeToArray, P as objectToString, ye as operatorMatch, Q as phpArrayKey, $ as phpComputedKey, L as phpDebugType, ue as phpIntArgument, de as phpIntCast, je as phpSortComparator, fe as phpStringCast, R as phpTypeName, F as phpValueMatch, I as phpValueMatcher, ee as readMapKey, te as reindexIntegerKeys, ne as renumberPhpIntegerKeys, z as resolveDefault, Te as resolvePadLength, Ee as resolveRangeSize, De as resolveSliceRange, Oe as resolveSpliceRange, ke as resolveTakeCount, be as strictEqual, pe as toArrayable, me as toJsonSerializable, he as toJsonable, Ie as toLower, ge as toPhpKeyString, Le as toUpper, B as typeOf, Re as upperFirst, re as writeMapKey };
package/dist/keys.d.ts CHANGED
@@ -140,6 +140,7 @@ export declare function readMapKey(map: ReadonlyMap<unknown, unknown>, key: stri
140
140
  *
141
141
  * An existing key keeps its place, and any later key PHP stores as the same one is removed.
142
142
  *
143
+ * @sideEffects mutates - Writes the key into the given Map.
143
144
  * @param map - The Map to write into, changed in place.
144
145
  * @param key - The key to write, cast as PHP casts an array key.
145
146
  * @param value - The value to store.
@@ -153,6 +154,7 @@ export declare function writeMapKey(map: Map<unknown, unknown>, key: string | nu
153
154
  /**
154
155
  * Delete every Map entry whose key PHP stores as the given key.
155
156
  *
157
+ * @sideEffects mutates - Deletes the key from the given Map.
156
158
  * @param map - The Map to remove from, changed in place.
157
159
  * @param key - The key to remove, cast as PHP casts an array key.
158
160
  *
@@ -205,6 +207,7 @@ export declare function renumberPhpIntegerKeys<TValue>(entries: [string, TValue]
205
207
  * plain `result[key] = value` lets a `"__proto__"` key reparent `result`. A key that is already
206
208
  * non-configurable keeps its attributes and only takes the new value.
207
209
  *
210
+ * @sideEffects mutates - Defines the key on the given target object.
208
211
  * @param target - The object to define the key on
209
212
  * @param key - The key to define
210
213
  * @param value - The value to store under the key
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EACjD,KAAK,EAAE,CAAC,GACT,CAAC,SAAS,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,CAMpC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,GAAG,MAAM,CAatE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAkCzD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,OAAO,EACd,OAAO,GAAE;IACL,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,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