@ls-stack/utils 3.62.0 → 3.63.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.
@@ -31,6 +31,7 @@ __export(arrayUtils_exports, {
31
31
  hasDuplicates: () => hasDuplicates,
32
32
  intersperse: () => intersperse,
33
33
  isInArray: () => isInArray,
34
+ isInArrayWithoutNarrowing: () => isInArrayWithoutNarrowing,
34
35
  looseIsInArray: () => looseIsInArray,
35
36
  rejectArrayUndefinedValues: () => rejectArrayUndefinedValues,
36
37
  rejectDuplicates: () => rejectDuplicates,
@@ -106,6 +107,9 @@ function isInArray(value, oneOf) {
106
107
  }
107
108
  return false;
108
109
  }
110
+ function isInArrayWithoutNarrowing(value, oneOf) {
111
+ return oneOf.includes(value);
112
+ }
109
113
  function looseIsInArray(value, array) {
110
114
  return array.includes(value);
111
115
  }
@@ -215,6 +219,7 @@ function repeat(value, count, separator) {
215
219
  hasDuplicates,
216
220
  intersperse,
217
221
  isInArray,
222
+ isInArrayWithoutNarrowing,
218
223
  looseIsInArray,
219
224
  rejectArrayUndefinedValues,
220
225
  rejectDuplicates,
@@ -76,6 +76,7 @@ declare function arrayWithPrevAndIndex<T>(array: T[]): {
76
76
  index: number;
77
77
  }[];
78
78
  declare function isInArray<T, const U extends T>(value: T, oneOf: readonly U[]): value is U;
79
+ declare function isInArrayWithoutNarrowing<T, const U extends T>(value: T, oneOf: readonly U[]): boolean;
79
80
  declare function looseIsInArray(value: unknown, array: readonly unknown[]): boolean;
80
81
  declare function findAfterIndex<T>(array: T[], index: number, predicate: (item: T) => boolean): T | undefined;
81
82
  declare function findBeforeIndex<T>(array: T[], index: number, predicate: (item: T) => boolean): T | undefined;
@@ -167,4 +168,4 @@ declare function intersperse<T, I>(array: T[], separator: I): (T | I)[];
167
168
  */
168
169
  declare function repeat<T>(value: T, count: number, separator?: T): T[];
169
170
 
170
- export { type FilterAndMapReturn, type SortByProps, type SortByValueFn, arrayOps, arrayWithPrev, arrayWithPrevAndIndex, filterAndMap, findAfterIndex, findAndMap, findBeforeIndex, getAscIndexOrder, hasDuplicates, intersperse, isInArray, looseIsInArray, rejectArrayUndefinedValues, rejectDuplicates, repeat, sortBy, truncateArray };
171
+ export { type FilterAndMapReturn, type SortByProps, type SortByValueFn, arrayOps, arrayWithPrev, arrayWithPrevAndIndex, filterAndMap, findAfterIndex, findAndMap, findBeforeIndex, getAscIndexOrder, hasDuplicates, intersperse, isInArray, isInArrayWithoutNarrowing, looseIsInArray, rejectArrayUndefinedValues, rejectDuplicates, repeat, sortBy, truncateArray };
@@ -76,6 +76,7 @@ declare function arrayWithPrevAndIndex<T>(array: T[]): {
76
76
  index: number;
77
77
  }[];
78
78
  declare function isInArray<T, const U extends T>(value: T, oneOf: readonly U[]): value is U;
79
+ declare function isInArrayWithoutNarrowing<T, const U extends T>(value: T, oneOf: readonly U[]): boolean;
79
80
  declare function looseIsInArray(value: unknown, array: readonly unknown[]): boolean;
80
81
  declare function findAfterIndex<T>(array: T[], index: number, predicate: (item: T) => boolean): T | undefined;
81
82
  declare function findBeforeIndex<T>(array: T[], index: number, predicate: (item: T) => boolean): T | undefined;
@@ -167,4 +168,4 @@ declare function intersperse<T, I>(array: T[], separator: I): (T | I)[];
167
168
  */
168
169
  declare function repeat<T>(value: T, count: number, separator?: T): T[];
169
170
 
170
- export { type FilterAndMapReturn, type SortByProps, type SortByValueFn, arrayOps, arrayWithPrev, arrayWithPrevAndIndex, filterAndMap, findAfterIndex, findAndMap, findBeforeIndex, getAscIndexOrder, hasDuplicates, intersperse, isInArray, looseIsInArray, rejectArrayUndefinedValues, rejectDuplicates, repeat, sortBy, truncateArray };
171
+ export { type FilterAndMapReturn, type SortByProps, type SortByValueFn, arrayOps, arrayWithPrev, arrayWithPrevAndIndex, filterAndMap, findAfterIndex, findAndMap, findBeforeIndex, getAscIndexOrder, hasDuplicates, intersperse, isInArray, isInArrayWithoutNarrowing, looseIsInArray, rejectArrayUndefinedValues, rejectDuplicates, repeat, sortBy, truncateArray };
@@ -10,13 +10,14 @@ import {
10
10
  hasDuplicates,
11
11
  intersperse,
12
12
  isInArray,
13
+ isInArrayWithoutNarrowing,
13
14
  looseIsInArray,
14
15
  rejectArrayUndefinedValues,
15
16
  rejectDuplicates,
16
17
  repeat,
17
18
  sortBy,
18
19
  truncateArray
19
- } from "./chunk-GVIDV772.js";
20
+ } from "./chunk-WFQJUJTC.js";
20
21
  import "./chunk-C2SVCIWE.js";
21
22
  import "./chunk-JF2MDHOJ.js";
22
23
  export {
@@ -31,6 +32,7 @@ export {
31
32
  hasDuplicates,
32
33
  intersperse,
33
34
  isInArray,
35
+ isInArrayWithoutNarrowing,
34
36
  looseIsInArray,
35
37
  rejectArrayUndefinedValues,
36
38
  rejectDuplicates,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sortBy
3
- } from "./chunk-GVIDV772.js";
3
+ } from "./chunk-WFQJUJTC.js";
4
4
  import {
5
5
  isPlainObject
6
6
  } from "./chunk-JF2MDHOJ.js";
@@ -60,6 +60,9 @@ function isInArray(value, oneOf) {
60
60
  }
61
61
  return false;
62
62
  }
63
+ function isInArrayWithoutNarrowing(value, oneOf) {
64
+ return oneOf.includes(value);
65
+ }
63
66
  function looseIsInArray(value, array) {
64
67
  return array.includes(value);
65
68
  }
@@ -164,6 +167,7 @@ export {
164
167
  arrayWithPrev,
165
168
  arrayWithPrevAndIndex,
166
169
  isInArray,
170
+ isInArrayWithoutNarrowing,
167
171
  looseIsInArray,
168
172
  findAfterIndex,
169
173
  findBeforeIndex,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GMJTLFM6.js";
4
4
  import {
5
5
  sortBy
6
- } from "./chunk-GVIDV772.js";
6
+ } from "./chunk-WFQJUJTC.js";
7
7
 
8
8
  // src/objUtils.ts
9
9
  import { Result } from "t-result";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-5DZT3Z5Z.js";
10
10
  import {
11
11
  truncateArray
12
- } from "./chunk-GVIDV772.js";
12
+ } from "./chunk-WFQJUJTC.js";
13
13
  import {
14
14
  invariant
15
15
  } from "./chunk-C2SVCIWE.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  filterObjectOrArrayKeys
3
- } from "./chunk-2LO5FYP5.js";
4
- import "./chunk-GVIDV772.js";
3
+ } from "./chunk-MI4UE2PQ.js";
4
+ import "./chunk-WFQJUJTC.js";
5
5
  import "./chunk-C2SVCIWE.js";
6
6
  import "./chunk-JF2MDHOJ.js";
7
7
  export {
package/dist/objUtils.js CHANGED
@@ -14,9 +14,9 @@ import {
14
14
  pick,
15
15
  rejectObjUndefinedValues,
16
16
  sortObjectKeys
17
- } from "./chunk-SGRS4OEE.js";
17
+ } from "./chunk-ZXIKIA5B.js";
18
18
  import "./chunk-GMJTLFM6.js";
19
- import "./chunk-GVIDV772.js";
19
+ import "./chunk-WFQJUJTC.js";
20
20
  import "./chunk-C2SVCIWE.js";
21
21
  import "./chunk-JF2MDHOJ.js";
22
22
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  filterAndMap
3
- } from "./chunk-GVIDV772.js";
3
+ } from "./chunk-WFQJUJTC.js";
4
4
  import "./chunk-C2SVCIWE.js";
5
5
  import {
6
6
  isTruthy
package/dist/testUtils.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  omit,
6
6
  pick
7
- } from "./chunk-SGRS4OEE.js";
7
+ } from "./chunk-ZXIKIA5B.js";
8
8
  import "./chunk-GMJTLFM6.js";
9
9
  import {
10
10
  filterObjectOrArrayKeys
11
- } from "./chunk-2LO5FYP5.js";
11
+ } from "./chunk-MI4UE2PQ.js";
12
12
  import "./chunk-IATIXMCE.js";
13
13
  import {
14
14
  deepEqual
@@ -26,7 +26,7 @@ import "./chunk-BM4PYVOX.js";
26
26
  import {
27
27
  arrayWithPrevAndIndex,
28
28
  filterAndMap
29
- } from "./chunk-GVIDV772.js";
29
+ } from "./chunk-WFQJUJTC.js";
30
30
  import {
31
31
  isObject
32
32
  } from "./chunk-C2SVCIWE.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ls-stack/utils",
3
3
  "description": "Universal TypeScript utilities for browser and Node.js",
4
- "version": "3.62.0",
4
+ "version": "3.63.0",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist",