semantic-typescript 0.3.8 → 0.4.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/collectable.d.ts +12 -0
- package/dist/collectable.js +41 -7
- package/dist/collector.d.ts +91 -50
- package/dist/collector.js +126 -108
- package/dist/factory.d.ts +9 -35
- package/dist/factory.js +4 -68
- package/dist/guard.d.ts +31 -25
- package/dist/guard.js +83 -65
- package/dist/hash.d.ts +14 -0
- package/dist/hash.js +211 -0
- package/dist/hook.d.ts +16 -4
- package/dist/hook.js +19 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/map.d.ts +72 -0
- package/dist/map.js +247 -0
- package/dist/optional.js +8 -23
- package/dist/semantic.js +42 -47
- package/dist/set.d.ts +19 -0
- package/dist/set.js +64 -0
- package/dist/statistics.js +28 -22
- package/dist/symbol.d.ts +8 -0
- package/dist/symbol.js +8 -0
- package/dist/utility.d.ts +8 -1
- package/dist/utility.js +9 -0
- package/dist/window.js +7 -5
- package/package.json +1 -5
- package/readme.cn.md +381 -636
- package/readme.md +3 -1
package/readme.md
CHANGED
|
@@ -285,6 +285,7 @@ console.log(empty.get(100)); // Outputs 100
|
|
|
285
285
|
| `useReduce<E, R>(identity: R, accumulator: TriFunctional<R, E, bigint, R>, finisher: Functional<R, R>): Collector<E, R, R>` | Creates a collector that reduces elements with identity and finisher | `identity: R`, `accumulator: TriFunctional<R, E, bigint, R>`, `finisher: Functional<R, R>` | `Collector<E, R, R>` |
|
|
286
286
|
| `useToArray<E>(): Collector<E, E[], E[]>` | Creates a collector that accumulates elements into an array | None | `Collector<E, E[], E[]>` |
|
|
287
287
|
| `useToMap<E, K, V>(keyExtractor: Functional<E, K>, valueExtractor: Functional<E, V>): Collector<E, Map<K, V>, Map<K, V>>` | Creates a collector that accumulates elements into a map | `keyExtractor: Functional<E, K>`, `valueExtractor: Functional<E, V>` | `Collector<E, Map<K, V>, Map<K, V>>` |
|
|
288
|
+
| `useToHashMap<E, K, V>(keyExtractor: Functional<E, K>, valueExtractor: Functional<E, V>): Collector<E, Map<K, V>, Map<K, V>>` | Creates a collector that accumulates elements into a hash map | `keyExtractor: Functional<E, K>`, `valueExtractor: Functional<E, V>` | `Collector<E, Map<K, V>, Map<K, V>>` |
|
|
288
289
|
| `useToSet<E>(): Collector<E, Set<E>, Set<E>>` | Creates a collector that accumulates elements into a set | None | `Collector<E, Set<E>, Set<E>>` |
|
|
289
290
|
| `useWrite<E, S = string>(stream: WritableStream<S>): Collector<E, Promise<WritableStream<S>>, Promise<WritableStream<S>>>` | Creates a collector that writes elements to a stream | `stream: WritableStream<S>` | `Collector<E, Promise<WritableStream<S>>, Promise<WritableStream<S>>>` |
|
|
290
291
|
| `useWrite<E, S = string>(stream: WritableStream<S>, accumulator: BiFunctional<WritableStream<S>, E, WritableStream<S>>): Collector<E, Promise<WritableStream<S>>, Promise<WritableStream<S>>>` | Creates a collector that writes elements to a stream with custom accumulator | `stream: WritableStream<S>`, `accumulator: BiFunctional<WritableStream<S>, E, WritableStream<S>>` | `Collector<E, Promise<WritableStream<S>>, Promise<WritableStream<S>>>` |
|
|
@@ -611,7 +612,9 @@ let customizedCollector = from([1, 2, 3, 4, 5]).toCollectable((generator: Genera
|
|
|
611
612
|
| `source(): Generator<E>` | Returns generator source | O(1) | O(1) |
|
|
612
613
|
| `toArray(): Array<E>` | Converts to array | O(n) | O(n) |
|
|
613
614
|
| `toMap<K, V>(keyExtractor: Functional<E, K>, valueExtractor: Functional<E, V>): Map<K, V>` | Converts to map | O(n) | O(n) |
|
|
615
|
+
| `toHashMap<K, V>(keyExtractor: Functional<E, K>, valueExtractor: Functional<E, V>): Map<K, V>` | Converts to hash map | O(n) | O(n) |
|
|
614
616
|
| `toSet(): Set<E>` | Converts to set | O(n) | O(n) |
|
|
617
|
+
| `toHashSet(): Set<E>` | Converts to hash set | O(n) | O(n) |
|
|
615
618
|
| `write<S = string>(stream: WritableStream<S>): Promise<WritableStream<S>>` | Writes to stream | O(n) | O(1) |
|
|
616
619
|
| `write<S = string>(stream: WritableStream<S>, accumulator: BiFunctional<WritableStream<S>, E, WritableStream<S>>): Promise<WritableStream<S>>` | Writes with accumulator | O(n) | O(1) |
|
|
617
620
|
| `write<S = string>(stream: WritableStream<S>, accumulator: TriFunctional<WritableStream<S>, E, bigint, WritableStream<S>>): Promise<WritableStream<S>>` | Writes with index-aware accumulator | O(n) | O(1) |
|
|
@@ -851,4 +854,3 @@ let bigIntStatistics: BigintStatistics<bigint> = data
|
|
|
851
854
|
|
|
852
855
|
This library provides TypeScript developers with powerful and flexible streaming capabilities, combining the benefits of functional programming with type safety guarantees.
|
|
853
856
|
|
|
854
|
-
|