# kt.ts

> Porting Kotlin stdlib api to typescript

Latest version **0.1.0-alpha.5** (published 2020-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install kt.ts
pnpm add kt.ts
yarn add kt.ts
bun add kt.ts
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-alpha.5 |
| Published | 2020-09-06 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 72.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | gaplo917 |
| Keywords | kotlin, typscript |

## Links

- npm: https://www.npmjs.com/package/kt.ts
- npm.io page: https://npm.io/package/kt.ts

## Dependencies (2)

- [deep-equal](https://npm.io/package/deep-equal.md) ^2.0.3
- [object-hash](https://npm.io/package/object-hash.md) ^2.0.3

## Recent versions

- 0.1.0-alpha.5 (latest) — 2020-09-06
- 0.1.0-alpha.4 — 2020-08-25
- 0.1.0-alpha.2 — 2020-08-24
- 0.1.0-alpha.1 — 2020-08-24
- 0.1.0-alpha.0 — 2020-08-24

## README

![kt.ts banner](https://cdn.jsdelivr.net/gh/gaplo917/kt.ts@master/meta/github-kt-ts-banner@2x.jpg)

# Kotlin Stdlib API in Typescript
Porting the Kotlin standard library design rationale to typescript. Boost the productivity by using the wise API design. 

***(WIP: This project is under active development. You are welcome to contribute.)***

# Getting Started to Contribute

Pick the not-yet-implemented API(below list) and try to [create a GitHub issues with the feature template](https://github.com/gaplo917/kt.ts/issues/new?assignees=&labels=&template=implement-ktlist-features.md&title=%5BFeat%5D+Implement+Kt+List+). There is a full check-list for you to contribute this project :). 
[Here is the example](https://github.com/gaplo917/kt.ts/issues/6).

## Getting Started
This module designed to be used in Typescript environment for utilizing strict 
type-checking and IDE auto-complete experience that similar to Kotlin Development.

If your want to use it in javascript project, I highly recommend you to use a relatively 
[new VSCode feature @ts-check](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_type-checking-javascript) 
Or [Intellij-based IDE](https://blog.jetbrains.com/webstorm/2019/09/using-typescript-to-check-your-javascript-code/) to enable type checking.

```shell
npm install kt.ts

# OR

yarn add kt.ts
```


```ts
// node >= 11
import 'kt.ts'

const result = [1,2,[3,3]].flatMap(it => it).distinct()

console.log(result)
```


### Kotlin List API
* [x] contains
* [x] elementAt
* [x] elementAtOrElse
* [x] elementAtOrNull
* [x] ~~find~~
* [x] findLast
* [x] first
* [x] first
* [x] firstOrNull
* [x] firstOrNull
* [ ] getOrElse
* [ ] getOrNull
* [ ] indexOf
* [ ] indexOfFirst
* [ ] indexOfLast
* [ ] last
* [ ] last
* [ ] lastIndexOf
* [ ] lastOrNull
* [ ] random
* [ ] single
* [ ] single
* [ ] singleOrNull
* [ ] singleOrNull
* [ ] drop
* [ ] dropLast
* [ ] dropLastWhile
* [ ] dropWhile
* [x] ~~filter~~
* [x] filterIndexed
* [x] filterNot
* [x] filterNotNull
* [ ] slice
* [ ] take
* [ ] takeLast
* [ ] takeLastWhile
* [ ] takeWhile
* [ ] reverse
* [ ] reversed
* [ ] sortBy
* [ ] sortByDescending
* [ ] sortDescending
* [ ] sorted
* [ ] sortedBy
* [ ] sortedByDescending
* [ ] sortedDescending
* [ ] sortedWith
* [ ] associate
* [ ] associateBy
* [ ] associateBy
* [ ] associateWith
* [ ] toSet
* [ ] groupBy
* [ ] groupBy
* [ ] mapIndexed
* [ ] mapIndexedNotNull
* [ ] mapNotNull
* [ ] withIndex
* [x] distinct
* [x] distinctBy
* [ ] intersect
* [ ] subtract
* [ ] union
* [ ] all
* [ ] any
* [ ] any
* [ ] count
* [ ] count
* [ ] fold
* [ ] foldIndexed
* [ ] foldRight
* [ ] foldRightIndexed
* [x] ~~forEach~~
* [x] forEachIndexed
* [ ] max
* [ ] maxBy
* [ ] maxWith
* [ ] min
* [ ] minBy
* [ ] minWith
* [ ] none
* [ ] none
* [ ] onEach
* [ ] reduce
* [ ] reduceIndexed
* [ ] reduceRight
* [ ] reduceRightIndexed
* [ ] sumBy
* [ ] requireNoNulls
* [ ] requireNoNulls
* [ ] chunked
* [ ] chunked
* [ ] minus
* [ ] minus
* [ ] minusElement
* [ ] partition
* [ ] plus
* [ ] plus
* [ ] plusElement
* [ ] windowed
* [ ] windowed
* [ ] zip
* [ ] zip
* [ ] zip
* [ ] zip
* [ ] zipWithNext
* [ ] zipWithNext
* [ ] joinTo
* [ ] joinToString
* [ ] average
* [ ] sum
* [x] containsAll
* [ ] get
* [ ] isEmpty
* [ ] iterator
* [ ] subList
* [x] size
* [ ] lastIndex

### Extra for TS and Kotlin-Like API
* [x] filterNotEmpty

---
_Source: https://npm.io/package/kt.ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
