Skip to content

Commit a079f64

Browse files
committed
change log
1 parent f1d379b commit a079f64

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

changelog.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# 2.12.0
2+
3+
- Add
4+
- OnceIter
5+
> Cache the results of the iterator
6+
7+
- pipe
8+
> fp style pipe function
9+
10+
**Example**
11+
```ts
12+
const f = pipe(
13+
(a: number, b: number) => a + b,
14+
(a: number) => a + 2,
15+
)
16+
f(1, 2) // => 5
17+
```
18+
19+
- seq/ops
20+
move seq ops from `seq` to `seq/ops`
21+
22+
- seq/fp
23+
> fp style seq ops
24+
25+
- seq/linq
26+
> linq style seq alias
27+
28+
- seq.includes
29+
> same as `array.includes`
30+
31+
- se.sum
32+
- seq.avg
33+
- seq.toArray
34+
- seq.toSet
35+
- seq.toMap
36+
37+
- static Seq.empty
38+
> Create empty seq
39+
40+
**Example**
41+
42+
```ts
43+
Seq.empty<number>()
44+
```
45+
46+
- static Seq.to
47+
> Create a Seq from a range starting from 0
48+
49+
**Example**
50+
51+
```ts
52+
Seq.to(3) // [0, 1, 2]
53+
```
54+
55+
- static Seq.range
56+
> Create a Seq from a range
57+
58+
**Example**
59+
60+
```ts
61+
Seq.range(3, 6) // [3, 4, 5]
62+
```
63+
64+
- seq.push
65+
> like array.push
66+
67+
- seq.unshift
68+
> like array.unshift
69+
70+
- seq.as
71+
> cast types
72+
73+
- seq.groupBy
74+
> linq groupBy
75+
76+
- seq.product
77+
> Cartesian product
78+
79+
**Example**
80+
```ts
81+
seq([1, 2, 3]).product(['a', 'b'])
82+
// returns
83+
[
84+
[1, 'a'],
85+
[1, 'b'],
86+
[2, 'a'],
87+
[2, 'b'],
88+
[3, 'a'],
89+
[3, 'b'],
90+
]
91+
```
92+
93+
- seq.relate
94+
> sql inner join
95+
96+
**Example**
97+
```ts
98+
seq([1, 2, 3]).relate(['1', '2', '3'], a => a, b => +b)
99+
// returns
100+
[
101+
[1, '1'],
102+
[2, '2'],
103+
[3, '3'],
104+
]
105+
```
106+
107+
# 2.11.0
108+
- Add
109+
- Linked\<T>, LinkedNode\<T>
110+
> Doubly Linked List
111+
112+
**Example**
113+
```ts
114+
const l = new Linked<number>()
115+
l.push(1)
116+
```
117+
118+
# 2.9.0
119+
120+
- Add
121+
- AsyncPool
122+
> Asynchronous pool
123+
> Used to ensure that the number of asynchronous executions at the same time does not exceed the limit
124+
125+
**Example**
126+
```ts
127+
const pool = new AsyncPool(1000)
128+
pool.run(() => fetch('foo/bar'))
129+
```
130+
131+
# 2.8.0
132+
133+
Add types
134+
- TupleConcat
135+
- KeyofExcludeValue
136+
- KeyofExtractValue
137+
- PickValue
138+
- OmitValue
139+
- ObjFromEntries
140+
- ObjKeys
141+
- ObjVals
142+
- ObjEntry
143+
- EntryValue
144+
- EntryKey
145+
- ObjPath
146+
- ValByPath
147+
- ObjPathEntry

src/onceiter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** Cache the results of the iterator */
12
export class OnceIter<T> implements Iterable<T> {
23
constructor(source: Iterable<T>) {
34
this.#iterator = source[Symbol.iterator]()

src/seq/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class Seq<T> implements Iterable<T> {
1616
return this.iter()[Symbol.iterator]()
1717
}
1818

19+
/** Create empty seq */
1920
static empty<T>(): Seq<T> {
2021
return new Seq(function* () { })
2122
}

0 commit comments

Comments
 (0)