1.0.15 • Published 2 years ago

array-deluxe v1.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Array-Deluxe 🦸‍♂️

Superpowers for your JavaScript arrays

import 'array-deluxe'

[1,2,3].map(x => x+1).unique().shuffle().mean()

Usage

Import

import 'array-deluxe'
// OR
require('array-deluxe')

Number functions

const list = [1,1,3]
list.max()     // 3
list.min()     // 1
list.sum()     // 5
list.median()  // 1
list.mean()    // 2.5
list.unique()  // [1,3]
list.shuffle() // [1,3,1]

Object functions

const people = [
    {name:"snap",    age:21},
    {name:"pop",     age:23},
    {name:"crackle", age:21},
];
people.select("name") // ["snap","pop","crackle"]
people.max("age")     // 23
people.min("age")     // 21
people.sum("age")     // 65
people.median("age")  // 21
people.mean("age")    // 21.6..

Todo

  • Tests
  • TypeScript support
1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.4

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago