Skip to content
This repository was archived by the owner on Jul 4, 2019. It is now read-only.

Commit d726f66

Browse files
authored
Update README.md
1 parent d0d7215 commit d726f66

1 file changed

Lines changed: 55 additions & 2 deletions

File tree

README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ LINQ 💥 implementation library for TypeScript ❄️
2020
1. `yarn test`
2121
2. ava write test-report to screen
2222

23-
![image](https://user-images.githubusercontent.com/13326808/41032243-7248e6e8-698b-11e8-9329-d9ad7046222d.png)
24-
23+
![image](https://user-images.githubusercontent.com/13326808/41082352-ad6fe5f4-6a36-11e8-8e51-4d98f0dec746.png)
2524

2625

2726
### Usage 🌱
@@ -329,6 +328,60 @@ let array = [{name: "Chtholly Nola", age: 17}, { name: "Ithea Myse", age: 18 }]
329328
array.MinBy(x => x.age) // => {name: "Chtholly Nola", age: 17}
330329
```
331330

331+
#### Exclude
332+
Excludes elements from a sequence starting at a given index
333+
```TypeScript
334+
let array = ["CO2", "Ir2O", "C2O3", "NH3", "C2H6", "H2C03"]
335+
336+
/* ... */
337+
338+
array.Exclude(1, 2) // -> ["CO2", "NH3", "C2H6", "H2C03"]
339+
```
340+
341+
#### Flatten
342+
Flattens a sequence containing arbitrarily-nested sequences.
343+
```TypeScript
344+
let array = ["CO2", ["C2O3", ["NH3", 127.4], 241, "H2C03"]
345+
346+
/* ... */
347+
348+
array.Flatten() // -> ["CO2", "C2O3", "NH3", 127.4, 241, "H2C03"]
349+
```
350+
351+
352+
#### Pairwise
353+
Returns a sequence resulting from applying a function to each element in the source sequence and its predecessor, with the exception of the first element which is only returned as the predecessor of the second element
354+
```TypeScript
355+
let array = ["atom", "core", "neutron"];
356+
357+
/* ... */
358+
359+
array.Pairwise((x, y) => `${x} contains ${y}`) // -> ["atom contains core", "core contains neutron"]
360+
```
361+
362+
#### Pipe
363+
Executes the given action on each element in the source sequence and yields it
364+
```TypeScript
365+
let array = [{name: 'neutron', lifetime: 880}, {name: "proton", lifetime: Infinity}]
366+
367+
/* ... */
368+
369+
array.Pipe(x => x.lifetime++);
370+
array.Where(x => x.name == "neutron").lifetime // -> 881
371+
```
372+
373+
#### Lag
374+
Produces a projection of a sequence by evaluating pairs of elements separated by a negative offset.
375+
```TypeScript
376+
let array = [0, 1, 2, 3, 4];
377+
378+
/* ... */
379+
380+
array.Lag(/*step*/2, /*defaultValue*/0, (a, b) => { return { A: a, B: b}; })
381+
//returned -> [{"A":0,"B":0},{"A":1,"B":0},{"A":2},{"A":3},{"A":4,"B":0}]
382+
```
383+
384+
332385
333386
### RoadMap
334387
#### Standard:

0 commit comments

Comments
 (0)