@hybridly/utils 0.1.0-alpha.0 → 0.1.0-alpha.2
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.cjs +3 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -335,8 +335,9 @@ function when(condition, data, _default) {
|
|
|
335
335
|
}
|
|
336
336
|
return data;
|
|
337
337
|
}
|
|
338
|
-
function merge(x, y) {
|
|
339
|
-
|
|
338
|
+
function merge(x, y, options = {}) {
|
|
339
|
+
const arrayMerge = typeof options?.arrayMerge === "function" ? options.arrayMerge : options?.overwriteArray !== false ? (_, s) => s : void 0;
|
|
340
|
+
return baseMerge__default(x, y, { arrayMerge });
|
|
340
341
|
}
|
|
341
342
|
function removeTrailingSlash(string) {
|
|
342
343
|
return string.replace(/\/+$/, "");
|
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,11 @@ declare function match<TValue extends string | number = string, TReturnValue = u
|
|
|
41
41
|
declare function debounce<F extends (...params: any[]) => ReturnType<F>>(fn: F, delay: number): F;
|
|
42
42
|
declare function value<T>(value: T | (() => T)): T;
|
|
43
43
|
declare function when<T, D>(condition: any, data: T, _default?: D): T | D | undefined;
|
|
44
|
-
|
|
44
|
+
interface MergeOptions {
|
|
45
|
+
overwriteArray?: boolean;
|
|
46
|
+
arrayMerge?: (target: any[], source: any[]) => any[];
|
|
47
|
+
}
|
|
48
|
+
declare function merge<T>(x: Partial<T>, y: Partial<T>, options?: MergeOptions): T;
|
|
45
49
|
declare function removeTrailingSlash(string: string): string;
|
|
46
50
|
|
|
47
51
|
declare const debug: {
|
package/dist/index.mjs
CHANGED
|
@@ -325,8 +325,9 @@ function when(condition, data, _default) {
|
|
|
325
325
|
}
|
|
326
326
|
return data;
|
|
327
327
|
}
|
|
328
|
-
function merge(x, y) {
|
|
329
|
-
|
|
328
|
+
function merge(x, y, options = {}) {
|
|
329
|
+
const arrayMerge = typeof options?.arrayMerge === "function" ? options.arrayMerge : options?.overwriteArray !== false ? (_, s) => s : void 0;
|
|
330
|
+
return baseMerge(x, y, { arrayMerge });
|
|
330
331
|
}
|
|
331
332
|
function removeTrailingSlash(string) {
|
|
332
333
|
return string.replace(/\/+$/, "");
|