@daiso-tech/core 0.48.0 → 0.48.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.
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
import { type StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
5
|
import { type Comparator, type PredicateInvokable, type ForEach, type Map, type Modifier, type Tap, type Transform, type Reduce, type CrossJoinResult, type EnsureMap, type EnsureRecord } from "../../collection/contracts/_shared/_module.js";
|
|
6
6
|
import { type ISerializable } from "../../serde/contracts/_module.js";
|
|
7
|
-
import { type Lazyable } from "../../utilities/_module.js";
|
|
7
|
+
import { type IterableValue, type Lazyable } from "../../utilities/_module.js";
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
11
11
|
* @group Contracts
|
|
12
12
|
*/
|
|
13
|
-
export type Collapse<TValue> = TValue extends Array<infer TItem> |
|
|
13
|
+
export type Collapse<TValue> = TValue extends Array<infer TItem> | IterableValue<infer TItem> | ICollection<infer TItem> ? TItem : TValue;
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
16
|
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
@@ -203,7 +203,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
203
203
|
* }
|
|
204
204
|
* ```
|
|
205
205
|
*/
|
|
206
|
-
flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>,
|
|
206
|
+
flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, IterableValue<TOutput>>): ICollection<TOutput>;
|
|
207
207
|
/**
|
|
208
208
|
* The `change` method changes only the items that passes `predicateFn` using `mapFn`.
|
|
209
209
|
* @example
|
|
@@ -1023,7 +1023,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1023
1023
|
* }
|
|
1024
1024
|
* ```
|
|
1025
1025
|
*/
|
|
1026
|
-
difference<TOutput = TInput>(iterable:
|
|
1026
|
+
difference<TOutput = TInput>(iterable: IterableValue<TInput>, selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
1027
1027
|
/**
|
|
1028
1028
|
* The `repeat` method will repeat the original collection `amount` times.
|
|
1029
1029
|
* @example
|
|
@@ -1088,7 +1088,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1088
1088
|
* }
|
|
1089
1089
|
* ```
|
|
1090
1090
|
*/
|
|
1091
|
-
padStart<TExtended = TInput>(maxLength: number, fillItems:
|
|
1091
|
+
padStart<TExtended = TInput>(maxLength: number, fillItems: IterableValue<TExtended>): ICollection<TInput | TExtended>;
|
|
1092
1092
|
/**
|
|
1093
1093
|
* The `padEnd` method pads this collection with `fillItems` until the resulting collection size reaches `maxLength`.
|
|
1094
1094
|
* The padding is applied from the end of this collection.
|
|
@@ -1146,7 +1146,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1146
1146
|
* }
|
|
1147
1147
|
* ```
|
|
1148
1148
|
*/
|
|
1149
|
-
padEnd<TExtended = TInput>(maxLength: number, fillItems:
|
|
1149
|
+
padEnd<TExtended = TInput>(maxLength: number, fillItems: IterableValue<TExtended>): ICollection<TInput | TExtended>;
|
|
1150
1150
|
/**
|
|
1151
1151
|
* The `slice` method creates porition of the original collection selected from `start` and `end`
|
|
1152
1152
|
* where `start` and `end` (end not included) represent the index of items in the collection.
|
|
@@ -1246,7 +1246,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1246
1246
|
* }
|
|
1247
1247
|
* ```
|
|
1248
1248
|
*/
|
|
1249
|
-
prepend<TExtended = TInput>(iterable:
|
|
1249
|
+
prepend<TExtended = TInput>(iterable: IterableValue<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
1250
1250
|
/**
|
|
1251
1251
|
* The `append` method adds `iterable` to the end of the collection.
|
|
1252
1252
|
* @example
|
|
@@ -1263,7 +1263,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1263
1263
|
* }
|
|
1264
1264
|
* ```
|
|
1265
1265
|
*/
|
|
1266
|
-
append<TExtended = TInput>(iterable:
|
|
1266
|
+
append<TExtended = TInput>(iterable: IterableValue<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
1267
1267
|
/**
|
|
1268
1268
|
* The `insertBefore` method adds `iterable` before the first item that matches `predicateFn`.
|
|
1269
1269
|
* @example
|
|
@@ -1280,7 +1280,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1280
1280
|
* }
|
|
1281
1281
|
* ```
|
|
1282
1282
|
*/
|
|
1283
|
-
insertBefore<TExtended = TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>, iterable:
|
|
1283
|
+
insertBefore<TExtended = TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>, iterable: IterableValue<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
1284
1284
|
/**
|
|
1285
1285
|
* The `insertAfter` method adds `iterable` after the first item that matches `predicateFn`.
|
|
1286
1286
|
* @example
|
|
@@ -1297,7 +1297,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1297
1297
|
* }
|
|
1298
1298
|
* ```
|
|
1299
1299
|
*/
|
|
1300
|
-
insertAfter<TExtended = TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>, iterable:
|
|
1300
|
+
insertAfter<TExtended = TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>, iterable: IterableValue<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
1301
1301
|
/**
|
|
1302
1302
|
* The `crossJoin` method cross joins the collection's values among `iterables`, returning a Cartesian product with all possible permutations.
|
|
1303
1303
|
* @example
|
|
@@ -1342,7 +1342,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1342
1342
|
* }
|
|
1343
1343
|
* ```
|
|
1344
1344
|
*/
|
|
1345
|
-
crossJoin<TExtended>(iterable:
|
|
1345
|
+
crossJoin<TExtended>(iterable: IterableValue<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
|
|
1346
1346
|
/**
|
|
1347
1347
|
* The `zip` method merges together the values of `iterable` with the values of the collection at their corresponding index.
|
|
1348
1348
|
* The returned collection has size of the shortest collection.
|
|
@@ -1386,7 +1386,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<Ser
|
|
|
1386
1386
|
* }
|
|
1387
1387
|
* ```
|
|
1388
1388
|
*/
|
|
1389
|
-
zip<TExtended>(iterable:
|
|
1389
|
+
zip<TExtended>(iterable: IterableValue<TExtended>): ICollection<[TInput, TExtended]>;
|
|
1390
1390
|
/**
|
|
1391
1391
|
* The `sort` method sorts the collection. You can provide a `comparator` function.
|
|
1392
1392
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.contract.js","sourceRoot":"","sources":["../../../src/collection/contracts/collection.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAyB,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAYN,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAON,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAsB,MAAM,8BAA8B,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"collection.contract.js","sourceRoot":"","sources":["../../../src/collection/contracts/collection.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAyB,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAYN,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAON,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAsB,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAqC,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daiso-tech/core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.48.
|
|
4
|
+
"version": "0.48.1",
|
|
5
5
|
"author": "Yousif Abdulkarim",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"description": "The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/
|
|
12
|
+
"url": "git+https://github.com/daiso-tech/daiso-core.git"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"./dist"
|