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 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 && !targetArr) {
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 && !targetArr) {
17
+ if (!sourceArr || !targetArr) {
18
18
  return;
19
19
  }
20
20
  if (handle === "target") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feathers-utils",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Some utils for projects using '@feathersjs/feathers'",
5
5
  "author": "fratzinger",
6
6
  "repository": {
@@ -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 && !targetArr) {
11
+ if (!sourceArr || !targetArr) {
12
12
  return;
13
13
  }
14
14
  if (handle === "target") {