feathers-utils 2.1.0 → 2.1.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/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/utils/mergeQuery/mergeArrays.ts +3 -3
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ const _debounce = require('lodash/debounce.js');
|
|
|
16
16
|
const _isObject = require('lodash/isObject.js');
|
|
17
17
|
|
|
18
18
|
function mergeArrays(targetArr, sourceArr, handle, prependKey, actionOnEmptyIntersect) {
|
|
19
|
-
if (!sourceArr
|
|
19
|
+
if (!sourceArr || !targetArr) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if (handle === "target") {
|
package/dist/index.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ interface MergeQueryOptions<T> extends FilterQueryOptions<T> {
|
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
declare function mergeArrays<T>(targetArr: T[], sourceArr: T[], handle: Handle, prependKey?: Path, actionOnEmptyIntersect?: ActionOnEmptyIntersect): T[] | undefined;
|
|
146
|
+
declare function mergeArrays<T>(targetArr: T[] | undefined, sourceArr: T[] | undefined, handle: Handle, prependKey?: Path, actionOnEmptyIntersect?: ActionOnEmptyIntersect): T[] | undefined;
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* Merges two queries into one.
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import _debounce from 'lodash/debounce.js';
|
|
|
14
14
|
import _isObject from 'lodash/isObject.js';
|
|
15
15
|
|
|
16
16
|
function mergeArrays(targetArr, sourceArr, handle, prependKey, actionOnEmptyIntersect) {
|
|
17
|
-
if (!sourceArr
|
|
17
|
+
if (!sourceArr || !targetArr) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
if (handle === "target") {
|
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@ import type { Path } from "../../typesInternal";
|
|
|
2
2
|
import type { Handle, ActionOnEmptyIntersect } from "./types";
|
|
3
3
|
|
|
4
4
|
export function mergeArrays<T>(
|
|
5
|
-
targetArr: T[],
|
|
6
|
-
sourceArr: T[],
|
|
5
|
+
targetArr: T[] | undefined,
|
|
6
|
+
sourceArr: T[] | undefined,
|
|
7
7
|
handle: Handle,
|
|
8
8
|
prependKey?: Path,
|
|
9
9
|
actionOnEmptyIntersect?: ActionOnEmptyIntersect
|
|
10
10
|
): T[] | undefined {
|
|
11
|
-
if (!sourceArr
|
|
11
|
+
if (!sourceArr || !targetArr) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
if (handle === "target") {
|