@pie-element/shared-lodash 0.1.1-next.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/index.d.ts +124 -0
- package/dist/index.js +326 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
type AnyFn = (...args: any[]) => any;
|
|
2
|
+
type Iteratee<T, R = unknown> = ((value: T, index: number | string, collection: any) => R) | string | object;
|
|
3
|
+
type Predicate<T> = Iteratee<T, boolean>;
|
|
4
|
+
export interface CancelableFunction<T extends AnyFn> {
|
|
5
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
6
|
+
cancel(): void;
|
|
7
|
+
flush(): ReturnType<T> | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function assign<T extends object>(object: T, ...sources: Array<object | null | undefined>): T;
|
|
10
|
+
export declare function chunk<T>(array: T[] | null | undefined, size?: number): T[][];
|
|
11
|
+
export declare function clone<T>(value: T): T;
|
|
12
|
+
export declare function cloneDeep<T>(value: T): T;
|
|
13
|
+
export declare function compact<T>(array: T[] | null | undefined): T[];
|
|
14
|
+
export declare function concat<T>(array: T[] | null | undefined, ...values: Array<T | T[]>): T[];
|
|
15
|
+
export declare function debounce<T extends AnyFn>(fn: T, wait?: number, options?: {
|
|
16
|
+
leading?: boolean;
|
|
17
|
+
trailing?: boolean;
|
|
18
|
+
maxWait?: number;
|
|
19
|
+
}): CancelableFunction<T>;
|
|
20
|
+
export declare function defaults<T extends object>(object: T, ...sources: Array<Record<string, unknown> | null | undefined>): T;
|
|
21
|
+
export declare function difference<T>(array: T[] | null | undefined, ...values: T[][]): T[];
|
|
22
|
+
export declare function differenceWith<T, U>(array: T[] | null | undefined, values: U[] | null | undefined, comparator: (a: T, b: U) => boolean): T[];
|
|
23
|
+
export declare function every<T>(collection: T[] | Record<string, T> | null | undefined, predicate?: Predicate<T>): boolean;
|
|
24
|
+
export declare function escape(value: unknown): string;
|
|
25
|
+
export declare function find<T>(collection: T[] | Record<string, T> | null | undefined, predicate?: Predicate<T>): T | undefined;
|
|
26
|
+
export declare function findKey<T>(object: Record<string, T> | null | undefined, predicate?: Predicate<T>): string | undefined;
|
|
27
|
+
export declare function flatten<T>(array: Array<T | T[]> | null | undefined): T[];
|
|
28
|
+
export declare function flatMap<T, R>(collection: T[] | Record<string, T> | null | undefined, iteratee?: Iteratee<T, R | R[]>): R[];
|
|
29
|
+
export declare function forEach<T>(collection: T[] | Record<string, T> | null | undefined, iteratee: (value: T, index: number | string, collection: any) => void): T[] | Record<string, T> | null | undefined;
|
|
30
|
+
export declare function get(object: unknown, path: string | number | Array<string | number>, defaultValue?: unknown): any;
|
|
31
|
+
export declare function groupBy<T>(collection: T[] | Record<string, T> | null | undefined, iteratee?: Iteratee<T>): Record<string, T[]>;
|
|
32
|
+
export declare function head<T>(array: T[] | null | undefined): T | undefined;
|
|
33
|
+
export declare function initial<T>(array: T[] | null | undefined): T[];
|
|
34
|
+
export declare function includes<T>(collection: T[] | string | Record<string, T> | null | undefined, value: T | string): boolean;
|
|
35
|
+
export declare function intersection<T>(...arrays: Array<T[] | null | undefined>): T[];
|
|
36
|
+
export declare function isArray(value: unknown): value is unknown[];
|
|
37
|
+
export declare function isEmpty(value: unknown): boolean;
|
|
38
|
+
export declare function isEqual(a: unknown, b: unknown): boolean;
|
|
39
|
+
export declare function isEqualWith(a: unknown, b: unknown, customizer?: (a: unknown, b: unknown) => boolean | undefined): boolean;
|
|
40
|
+
export declare function isFinite(value: unknown): boolean;
|
|
41
|
+
export declare function isFunction(value: unknown): value is AnyFn;
|
|
42
|
+
export declare function isNumber(value: unknown): value is number;
|
|
43
|
+
export declare function isObject(value: unknown): value is object;
|
|
44
|
+
export declare function isString(value: unknown): value is string;
|
|
45
|
+
export declare function isUndefined(value: unknown): value is undefined;
|
|
46
|
+
export declare function map<T, R>(collection: T[] | Record<string, T> | null | undefined, iteratee?: Iteratee<T, R>): R[];
|
|
47
|
+
export declare function max(array: number[] | null | undefined): number | undefined;
|
|
48
|
+
export declare function merge<T extends object>(object: T, ...sources: Array<Record<string, any> | null | undefined>): T;
|
|
49
|
+
export declare function omit<T extends Record<string, any>>(object: T | null | undefined, paths: string | string[]): Partial<T>;
|
|
50
|
+
export declare function omitBy<T extends Record<string, any>>(object: T | null | undefined, predicate?: Predicate<any>): Partial<T>;
|
|
51
|
+
export declare function pick<T extends Record<string, any>>(object: T | null | undefined, ...paths: Array<string | string[]>): Partial<T>;
|
|
52
|
+
export declare function range(start: number, end?: number, step?: number): number[];
|
|
53
|
+
export declare function rangeRight(start: number, end?: number, step?: number): number[];
|
|
54
|
+
export declare function reduce<T, R>(collection: T[] | Record<string, T> | null | undefined, iteratee: (accumulator: R, value: T, index: number | string, collection: any) => R, accumulator: R): R;
|
|
55
|
+
export declare function remove<T>(array: T[], predicate?: Predicate<T>): T[];
|
|
56
|
+
export declare function set<T extends object>(object: T, path: string | number | Array<string | number>, value: unknown): T;
|
|
57
|
+
export declare function shuffle<T>(array: T[] | null | undefined): T[];
|
|
58
|
+
export declare function tail<T>(array: T[] | null | undefined): T[];
|
|
59
|
+
export declare function takeRight<T>(array: T[] | null | undefined, count?: number): T[];
|
|
60
|
+
export declare function throttle<T extends AnyFn>(fn: T, wait?: number, options?: {
|
|
61
|
+
leading?: boolean;
|
|
62
|
+
trailing?: boolean;
|
|
63
|
+
}): CancelableFunction<T>;
|
|
64
|
+
export declare function times<T = number>(count: number, iteratee?: (index: number) => T): T[];
|
|
65
|
+
export declare function uniqueId(prefix?: string): string;
|
|
66
|
+
export declare function uniq<T>(array: T[] | null | undefined): T[];
|
|
67
|
+
export declare function uniqWith<T>(array: T[] | null | undefined, comparator: (a: T, b: T) => boolean): T[];
|
|
68
|
+
export declare function zip(...arrays: unknown[][]): unknown[][];
|
|
69
|
+
declare const lodash: {
|
|
70
|
+
assign: typeof assign;
|
|
71
|
+
chunk: typeof chunk;
|
|
72
|
+
clone: typeof clone;
|
|
73
|
+
cloneDeep: typeof cloneDeep;
|
|
74
|
+
compact: typeof compact;
|
|
75
|
+
concat: typeof concat;
|
|
76
|
+
debounce: typeof debounce;
|
|
77
|
+
defaults: typeof defaults;
|
|
78
|
+
difference: typeof difference;
|
|
79
|
+
differenceWith: typeof differenceWith;
|
|
80
|
+
every: typeof every;
|
|
81
|
+
escape: typeof escape;
|
|
82
|
+
find: typeof find;
|
|
83
|
+
findKey: typeof findKey;
|
|
84
|
+
flatten: typeof flatten;
|
|
85
|
+
flatMap: typeof flatMap;
|
|
86
|
+
forEach: typeof forEach;
|
|
87
|
+
get: typeof get;
|
|
88
|
+
groupBy: typeof groupBy;
|
|
89
|
+
head: typeof head;
|
|
90
|
+
includes: typeof includes;
|
|
91
|
+
initial: typeof initial;
|
|
92
|
+
intersection: typeof intersection;
|
|
93
|
+
isArray: typeof isArray;
|
|
94
|
+
isEmpty: typeof isEmpty;
|
|
95
|
+
isEqual: typeof isEqual;
|
|
96
|
+
isEqualWith: typeof isEqualWith;
|
|
97
|
+
isFinite: typeof isFinite;
|
|
98
|
+
isFunction: typeof isFunction;
|
|
99
|
+
isNumber: typeof isNumber;
|
|
100
|
+
isObject: typeof isObject;
|
|
101
|
+
isString: typeof isString;
|
|
102
|
+
isUndefined: typeof isUndefined;
|
|
103
|
+
map: typeof map;
|
|
104
|
+
max: typeof max;
|
|
105
|
+
merge: typeof merge;
|
|
106
|
+
omit: typeof omit;
|
|
107
|
+
omitBy: typeof omitBy;
|
|
108
|
+
pick: typeof pick;
|
|
109
|
+
range: typeof range;
|
|
110
|
+
rangeRight: typeof rangeRight;
|
|
111
|
+
reduce: typeof reduce;
|
|
112
|
+
remove: typeof remove;
|
|
113
|
+
set: typeof set;
|
|
114
|
+
shuffle: typeof shuffle;
|
|
115
|
+
tail: typeof tail;
|
|
116
|
+
takeRight: typeof takeRight;
|
|
117
|
+
throttle: typeof throttle;
|
|
118
|
+
times: typeof times;
|
|
119
|
+
uniqueId: typeof uniqueId;
|
|
120
|
+
uniq: typeof uniq;
|
|
121
|
+
uniqWith: typeof uniqWith;
|
|
122
|
+
zip: typeof zip;
|
|
123
|
+
};
|
|
124
|
+
export default lodash;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
var e = Object.prototype;
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e == "object" && !!e;
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [e] : e.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
return (t) => x(t, e);
|
|
11
|
+
}
|
|
12
|
+
function i(e) {
|
|
13
|
+
return (n) => t(n) ? Object.entries(e).every(([e, t]) => A(n[e], t)) : !1;
|
|
14
|
+
}
|
|
15
|
+
function a(e) {
|
|
16
|
+
return typeof e == "function" ? e : typeof e == "string" ? r(e) : t(e) ? i(e) : ((e) => e);
|
|
17
|
+
}
|
|
18
|
+
function o(e, ...t) {
|
|
19
|
+
return Object.assign(e, ...t.filter(Boolean));
|
|
20
|
+
}
|
|
21
|
+
function s(e, t = 1) {
|
|
22
|
+
if (!e?.length || t < 1) return [];
|
|
23
|
+
let n = [];
|
|
24
|
+
for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
function c(e) {
|
|
28
|
+
return Array.isArray(e) ? e.slice() : t(e) ? { ...e } : e;
|
|
29
|
+
}
|
|
30
|
+
function l(e) {
|
|
31
|
+
if (!t(e)) return e;
|
|
32
|
+
if (e instanceof Date) return new Date(e.getTime());
|
|
33
|
+
if (Array.isArray(e)) return e.map((e) => l(e));
|
|
34
|
+
let n = {};
|
|
35
|
+
for (let [t, r] of Object.entries(e)) n[t] = l(r);
|
|
36
|
+
return n;
|
|
37
|
+
}
|
|
38
|
+
function u(e) {
|
|
39
|
+
return (e ?? []).filter(Boolean);
|
|
40
|
+
}
|
|
41
|
+
function d(e, ...t) {
|
|
42
|
+
let n = [...e ?? []];
|
|
43
|
+
for (let e of t) Array.isArray(e) ? n.push(...e) : n.push(e);
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function f(e, t = 0, n = {}) {
|
|
47
|
+
let r, i, a, o, s, c = n.leading === !0, l = n.trailing !== !1, u = () => {
|
|
48
|
+
if (!a) return s;
|
|
49
|
+
let t = a, n = o;
|
|
50
|
+
return a = void 0, o = void 0, s = e.apply(n, t), s;
|
|
51
|
+
}, d = () => {
|
|
52
|
+
r && clearTimeout(r), i && clearTimeout(i), r = void 0, i = void 0, a = void 0, o = void 0;
|
|
53
|
+
}, f = function(...e) {
|
|
54
|
+
let d = c && !r;
|
|
55
|
+
return a = e, o = this, d && u(), r && clearTimeout(r), r = setTimeout(() => {
|
|
56
|
+
r = void 0, i &&= (clearTimeout(i), void 0), l ? u() : (a = void 0, o = void 0);
|
|
57
|
+
}, t), n.maxWait !== void 0 && !i && (i = setTimeout(() => {
|
|
58
|
+
r && clearTimeout(r), r = void 0, i = void 0, l || !c ? u() : (a = void 0, o = void 0);
|
|
59
|
+
}, n.maxWait)), s;
|
|
60
|
+
};
|
|
61
|
+
return f.cancel = d, f.flush = () => (r &&= (clearTimeout(r), void 0), i &&= (clearTimeout(i), void 0), u()), f;
|
|
62
|
+
}
|
|
63
|
+
function p(e, ...t) {
|
|
64
|
+
for (let n of t) if (n) for (let [t, r] of Object.entries(n)) e[t] === void 0 && (e[t] = r);
|
|
65
|
+
return e;
|
|
66
|
+
}
|
|
67
|
+
function m(e, ...t) {
|
|
68
|
+
let n = new Set(t.flat());
|
|
69
|
+
return (e ?? []).filter((e) => !n.has(e));
|
|
70
|
+
}
|
|
71
|
+
function h(e, t, n) {
|
|
72
|
+
return (e ?? []).filter((e) => !(t ?? []).some((t) => n(e, t)));
|
|
73
|
+
}
|
|
74
|
+
function g(e, t) {
|
|
75
|
+
let n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});
|
|
76
|
+
for (let [t, i] of r) if (!n(i, t, e)) return !1;
|
|
77
|
+
return !0;
|
|
78
|
+
}
|
|
79
|
+
function ee(e) {
|
|
80
|
+
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
81
|
+
}
|
|
82
|
+
function _(e, t) {
|
|
83
|
+
let n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});
|
|
84
|
+
for (let [t, i] of r) if (n(i, t, e)) return i;
|
|
85
|
+
}
|
|
86
|
+
function v(e, t) {
|
|
87
|
+
let n = a(t);
|
|
88
|
+
for (let [t, r] of Object.entries(e ?? {})) if (n(r, t, e)) return t;
|
|
89
|
+
}
|
|
90
|
+
function y(e) {
|
|
91
|
+
let t = [];
|
|
92
|
+
for (let n of e ?? []) Array.isArray(n) ? t.push(...n) : t.push(n);
|
|
93
|
+
return t;
|
|
94
|
+
}
|
|
95
|
+
function te(e, t) {
|
|
96
|
+
return R(e, t).flat();
|
|
97
|
+
}
|
|
98
|
+
function b(e, t) {
|
|
99
|
+
let n = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});
|
|
100
|
+
for (let [r, i] of n) t(i, r, e);
|
|
101
|
+
return e;
|
|
102
|
+
}
|
|
103
|
+
function x(e, t, r) {
|
|
104
|
+
let i = e;
|
|
105
|
+
for (let e of n(t)) {
|
|
106
|
+
if (i == null) return r;
|
|
107
|
+
i = i[e];
|
|
108
|
+
}
|
|
109
|
+
return i === void 0 ? r : i;
|
|
110
|
+
}
|
|
111
|
+
function S(e, t) {
|
|
112
|
+
let n = a(t);
|
|
113
|
+
return K(e, (t, r, i) => {
|
|
114
|
+
let a = String(n(r, i, e));
|
|
115
|
+
return (t[a] ??= []).push(r), t;
|
|
116
|
+
}, {});
|
|
117
|
+
}
|
|
118
|
+
function C(e) {
|
|
119
|
+
return e?.[0];
|
|
120
|
+
}
|
|
121
|
+
function w(e) {
|
|
122
|
+
return (e ?? []).slice(0, -1);
|
|
123
|
+
}
|
|
124
|
+
function T(e, t) {
|
|
125
|
+
return typeof e == "string" ? e.includes(String(t)) : Array.isArray(e) ? e.includes(t) : Object.values(e ?? {}).includes(t);
|
|
126
|
+
}
|
|
127
|
+
function E(...e) {
|
|
128
|
+
let [t, ...n] = e;
|
|
129
|
+
return $((t ?? []).filter((e) => n.every((t) => (t ?? []).includes(e))));
|
|
130
|
+
}
|
|
131
|
+
function D(e) {
|
|
132
|
+
return Array.isArray(e);
|
|
133
|
+
}
|
|
134
|
+
function O(e) {
|
|
135
|
+
return e == null ? !0 : typeof e == "string" || Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : t(e) ? Object.keys(e).length === 0 : !0;
|
|
136
|
+
}
|
|
137
|
+
function k(n, r, i) {
|
|
138
|
+
let a = i?.(n, r);
|
|
139
|
+
if (a !== void 0) return !!a;
|
|
140
|
+
if (Object.is(n, r)) return !0;
|
|
141
|
+
if (!t(n) || !t(r)) return !1;
|
|
142
|
+
if (n instanceof Date || r instanceof Date) return n instanceof Date && r instanceof Date && n.getTime() === r.getTime();
|
|
143
|
+
if (Array.isArray(n) || Array.isArray(r)) return Array.isArray(n) && Array.isArray(r) && n.length === r.length && n.every((e, t) => k(e, r[t], i));
|
|
144
|
+
let o = Object.keys(n), s = Object.keys(r);
|
|
145
|
+
return o.length === s.length && o.every((t) => e.hasOwnProperty.call(r, t) && k(n[t], r[t], i));
|
|
146
|
+
}
|
|
147
|
+
function A(e, t) {
|
|
148
|
+
return k(e, t);
|
|
149
|
+
}
|
|
150
|
+
function j(e, t, n) {
|
|
151
|
+
return k(e, t, n);
|
|
152
|
+
}
|
|
153
|
+
function M(e) {
|
|
154
|
+
return Number.isFinite(e);
|
|
155
|
+
}
|
|
156
|
+
function N(e) {
|
|
157
|
+
return typeof e == "function";
|
|
158
|
+
}
|
|
159
|
+
function P(e) {
|
|
160
|
+
return typeof e == "number" || e instanceof Number;
|
|
161
|
+
}
|
|
162
|
+
function F(e) {
|
|
163
|
+
return typeof e == "object" && !!e || typeof e == "function";
|
|
164
|
+
}
|
|
165
|
+
function I(e) {
|
|
166
|
+
return typeof e == "string" || e instanceof String;
|
|
167
|
+
}
|
|
168
|
+
function L(e) {
|
|
169
|
+
return e === void 0;
|
|
170
|
+
}
|
|
171
|
+
function R(e, t) {
|
|
172
|
+
let n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {}), i = [];
|
|
173
|
+
for (let [t, a] of r) i.push(n(a, t, e));
|
|
174
|
+
return i;
|
|
175
|
+
}
|
|
176
|
+
function z(e) {
|
|
177
|
+
return e?.length ? Math.max(...e) : void 0;
|
|
178
|
+
}
|
|
179
|
+
function B(e, ...n) {
|
|
180
|
+
for (let r of n) if (r) for (let [n, i] of Object.entries(r)) t(i) && !Array.isArray(i) && t(e[n]) ? B(e[n], i) : e[n] = l(i);
|
|
181
|
+
return e;
|
|
182
|
+
}
|
|
183
|
+
function V(e, t) {
|
|
184
|
+
let n = { ...e ?? {} };
|
|
185
|
+
for (let e of Array.isArray(t) ? t : [t]) delete n[e];
|
|
186
|
+
return n;
|
|
187
|
+
}
|
|
188
|
+
function H(e, t) {
|
|
189
|
+
let n = a(t), r = {};
|
|
190
|
+
for (let [t, i] of Object.entries(e ?? {})) n(i, t, e) || (r[t] = i);
|
|
191
|
+
return r;
|
|
192
|
+
}
|
|
193
|
+
function U(e, ...t) {
|
|
194
|
+
let n = {};
|
|
195
|
+
for (let r of t.flat()) e && r in e && (n[r] = e[r]);
|
|
196
|
+
return n;
|
|
197
|
+
}
|
|
198
|
+
function W(e, t, n = 1) {
|
|
199
|
+
let r = t ?? e, i = t === void 0 ? 0 : e;
|
|
200
|
+
if (n === 0) return [];
|
|
201
|
+
let a = [], o = n > 0;
|
|
202
|
+
for (let e = i; o ? e < r : e > r; e += n) a.push(e);
|
|
203
|
+
return a;
|
|
204
|
+
}
|
|
205
|
+
function G(e, t, n = 1) {
|
|
206
|
+
return W(e, t, n).reverse();
|
|
207
|
+
}
|
|
208
|
+
function K(e, t, n) {
|
|
209
|
+
let r = n, i = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});
|
|
210
|
+
for (let [n, a] of i) r = t(r, a, n, e);
|
|
211
|
+
return r;
|
|
212
|
+
}
|
|
213
|
+
function q(e, t) {
|
|
214
|
+
let n = a(t), r = [];
|
|
215
|
+
for (let t = e.length - 1; t >= 0; t--) n(e[t], t, e) && r.unshift(...e.splice(t, 1));
|
|
216
|
+
return r;
|
|
217
|
+
}
|
|
218
|
+
function J(e, t, r) {
|
|
219
|
+
let i = n(t), a = e;
|
|
220
|
+
return i.forEach((e, t) => {
|
|
221
|
+
if (t === i.length - 1) {
|
|
222
|
+
a[e] = r;
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
let n = i[t + 1];
|
|
226
|
+
a[e] ??= typeof n == "number" || /^\d+$/.test(String(n)) ? [] : {}, a = a[e];
|
|
227
|
+
}), e;
|
|
228
|
+
}
|
|
229
|
+
function Y(e) {
|
|
230
|
+
let t = [...e ?? []];
|
|
231
|
+
for (let e = t.length - 1; e > 0; e--) {
|
|
232
|
+
let n = Math.floor(Math.random() * (e + 1));
|
|
233
|
+
[t[e], t[n]] = [t[n], t[e]];
|
|
234
|
+
}
|
|
235
|
+
return t;
|
|
236
|
+
}
|
|
237
|
+
function X(e) {
|
|
238
|
+
return (e ?? []).slice(1);
|
|
239
|
+
}
|
|
240
|
+
function Z(e, t = 1) {
|
|
241
|
+
return t <= 0 ? [] : (e ?? []).slice(-t);
|
|
242
|
+
}
|
|
243
|
+
function Q(e, t = 0, n = {}) {
|
|
244
|
+
return f(e, t, {
|
|
245
|
+
leading: n.leading !== !1,
|
|
246
|
+
trailing: n.trailing !== !1,
|
|
247
|
+
maxWait: t
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
function ne(e, t) {
|
|
251
|
+
let n = t ?? ((e) => e);
|
|
252
|
+
return Array.from({ length: Math.max(0, e) }, (e, t) => n(t));
|
|
253
|
+
}
|
|
254
|
+
var re = 0;
|
|
255
|
+
function ie(e = "") {
|
|
256
|
+
return re += 1, `${e}${re}`;
|
|
257
|
+
}
|
|
258
|
+
function $(e) {
|
|
259
|
+
return Array.from(new Set(e ?? []));
|
|
260
|
+
}
|
|
261
|
+
function ae(e, t) {
|
|
262
|
+
let n = [];
|
|
263
|
+
for (let r of e ?? []) n.some((e) => t(r, e)) || n.push(r);
|
|
264
|
+
return n;
|
|
265
|
+
}
|
|
266
|
+
function oe(...e) {
|
|
267
|
+
let t = Math.max(0, ...e.map((e) => e.length));
|
|
268
|
+
return Array.from({ length: t }, (t, n) => e.map((e) => e[n]));
|
|
269
|
+
}
|
|
270
|
+
var se = {
|
|
271
|
+
assign: o,
|
|
272
|
+
chunk: s,
|
|
273
|
+
clone: c,
|
|
274
|
+
cloneDeep: l,
|
|
275
|
+
compact: u,
|
|
276
|
+
concat: d,
|
|
277
|
+
debounce: f,
|
|
278
|
+
defaults: p,
|
|
279
|
+
difference: m,
|
|
280
|
+
differenceWith: h,
|
|
281
|
+
every: g,
|
|
282
|
+
escape: ee,
|
|
283
|
+
find: _,
|
|
284
|
+
findKey: v,
|
|
285
|
+
flatten: y,
|
|
286
|
+
flatMap: te,
|
|
287
|
+
forEach: b,
|
|
288
|
+
get: x,
|
|
289
|
+
groupBy: S,
|
|
290
|
+
head: C,
|
|
291
|
+
includes: T,
|
|
292
|
+
initial: w,
|
|
293
|
+
intersection: E,
|
|
294
|
+
isArray: D,
|
|
295
|
+
isEmpty: O,
|
|
296
|
+
isEqual: A,
|
|
297
|
+
isEqualWith: j,
|
|
298
|
+
isFinite: M,
|
|
299
|
+
isFunction: N,
|
|
300
|
+
isNumber: P,
|
|
301
|
+
isObject: F,
|
|
302
|
+
isString: I,
|
|
303
|
+
isUndefined: L,
|
|
304
|
+
map: R,
|
|
305
|
+
max: z,
|
|
306
|
+
merge: B,
|
|
307
|
+
omit: V,
|
|
308
|
+
omitBy: H,
|
|
309
|
+
pick: U,
|
|
310
|
+
range: W,
|
|
311
|
+
rangeRight: G,
|
|
312
|
+
reduce: K,
|
|
313
|
+
remove: q,
|
|
314
|
+
set: J,
|
|
315
|
+
shuffle: Y,
|
|
316
|
+
tail: X,
|
|
317
|
+
takeRight: Z,
|
|
318
|
+
throttle: Q,
|
|
319
|
+
times: ne,
|
|
320
|
+
uniqueId: ie,
|
|
321
|
+
uniq: $,
|
|
322
|
+
uniqWith: ae,
|
|
323
|
+
zip: oe
|
|
324
|
+
};
|
|
325
|
+
//#endregion
|
|
326
|
+
export { o as assign, s as chunk, c as clone, l as cloneDeep, u as compact, d as concat, f as debounce, se as default, p as defaults, m as difference, h as differenceWith, ee as escape, g as every, _ as find, v as findKey, te as flatMap, y as flatten, b as forEach, x as get, S as groupBy, C as head, T as includes, w as initial, E as intersection, D as isArray, O as isEmpty, A as isEqual, j as isEqualWith, M as isFinite, N as isFunction, P as isNumber, F as isObject, I as isString, L as isUndefined, R as map, z as max, B as merge, V as omit, H as omitBy, U as pick, W as range, G as rangeRight, K as reduce, q as remove, J as set, Y as shuffle, X as tail, Z as takeRight, Q as throttle, ne as times, $ as uniq, ae as uniqWith, ie as uniqueId, oe as zip };
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-element/shared-lodash",
|
|
3
|
+
"version": "0.1.1-next.0",
|
|
4
|
+
"description": "Vendored lodash helper subset for PIE elements",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "rm -rf dist tsconfig.tsbuildinfo && vite build && tsc --emitDeclarationOnly",
|
|
19
|
+
"dev": "vite build --watch",
|
|
20
|
+
"test": "vitest",
|
|
21
|
+
"clean": "rm -rf dist"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/bun": "latest",
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"vite": "^8.0.1",
|
|
27
|
+
"vitest": "^4.1.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/pie-framework/pie-elements-ng.git",
|
|
36
|
+
"directory": "packages/shared/lodash"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/pie-framework/pie-elements-ng#readme",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/pie-framework/pie-elements-ng/issues"
|
|
41
|
+
}
|
|
42
|
+
}
|