lbear
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

LBear

CI version

A simple collections library based on ES6.

Installation

npm i lbear

Usage

Immutable Map

import { ImMap } from 'lbear/map'

const map = ImMap.of({ a: 1, b: 2, c: 3 })

for (const [k, v] of map) {
  console.log(`${k} => ${v}`)
}

Option

import { Option } from 'lbear/option'

const value = Option.some(1)
const empty = Option.none()

Seq

import { Seq } from 'lbear/seq'

const seq = Seq.of(1, 2, 3)
const odd = seq.filter(x => x % 2 == 1)
const arr = odd.toArray()

License

MIT License © 2021 XLor

Readme

Keywords

Package Sidebar

Install

npm i lbear

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

30.3 kB

Total Files

15

Last publish

Collaborators

  • yjl9903