0.0.5 • Published 7 months ago

typescript-kotlin-extensions v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

TypeScript Kotlin Extensions

An extension library in TypeScript, to extend the functions of Arrays.

[1, 2, 3, 4, 5].first() // 1
[1, 2, 3, 4, 5].last() // 5
[null, 2, null, 4, 5].first((e) => e != null) // 2

Designs

Most of functions are copied from Kotlin Standard Library. Some of them are not very easy to implement, so I used another way to do like the reverse loop parts.

Almost all the functions that throws are turned into returning undefined like first of an empty array.

Credit

I like code in Kotlin very much, for its extension methods. So every time I code in TypeScript, I wonder if I can bring that to TS. And this project just be created.

0.0.5

7 months ago

0.0.4

11 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago