Minimal Lodash-like utilities.
Purpose: To avoid installing Lodash in favor of "babel" ESNext features (like map
, filter
, reduce
) but at the same time making available some missing features.
- compact (
array
) => (array
) - get (
obj
,key
,defaultValue
) => (any
) - has (
obj
,key
) => (boolean
) - last (
array
) => (any
) - omit (
object
,[keys]
) => (object
) - pick (
object
,[keys]
) => (object
) - random (low
number
, highnumber
) => (number
) - range (low
number
, highnumber
) => (array
) - sample (
array
) => (any
) - uid (strLength
number
) => (string
) - uniq (
array
) => (array
)
import _ from '@jmaguirrei/belt';
const array = [ 1, 2, 3, 4 ];
console.log(_.last(array)) // 4