0.0.11 • Published 3 years ago
@ornstio/ts-linq v0.0.11
@ornstio/ts-linq
Adds LINQ-like typed extensions to Typescript arrays https://ts-linq.ornstio.com/ https://www.npmjs.com/package/@ornstio/ts-linq
Installation
$ npm i @ornstio/ts-linq
Usage
Add the following lines to main.ts:
import { tsLinq } from "@ornstio/ts-linq";
tsLinq();
Examples
any
[0, 1].any((_) => _ === 0)
= true
except
const arr = [{ x: 0 }, { x: 1 }, { x: 2 }];
arr.except([{ x: 0 }, { x: 1 }, { x: 3 }], (a, b) => a.x === b.x);
= [{x:2},{x:3}]