polux
- Polux is a simple interactive package that contains some utility functions
Arrays
disappear
- Removing elements from an array according to the given callback function
_.disappear([10,20,30], (value) => value > 10)
flatConcat
- Concatenate values in an array at a given position
_.flatConcat(3, 30, [10, 20, 40, 50])
random
- Returns a random value from an array
_.random([10, 20, 30])
_.random([10, 20, 30], 0, 1)
Objects
omit
- Returns one or more objects omitting the defined keys
_.omit(['birthday'], { name: 'dr1zzyts', age: 17, birthday: 11})
omitTypes
- Returns one or more new objects with keys that do not contain the values of defined types
_.omitTypes(['string'], { name: 'dr1zzyts', age: 17, birthday: 11})
pick
- Returns one or more new objects with just the defined keys
_.pick(['name', 'age'], { name: 'dr1zzyts', age: 17, birthday: 11})
pickTypes
- Returns one or more new objects with keys that only contain values of defined types
_.pick(['string'], { name: 'dr1zzyts', age: 17, birthday: 11})