🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

polux

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

polux

A simple package that contains some utility functions

unpublished
latest
npmnpm
Version
0.4.8
Version published
Maintainers
2
Created
Source

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)
// => { array: [20, 30], slicedCount: 1 }

flatConcat

  • Concatenate values in an array at a given position
_.flatConcat(3, 30, [10, 20, 40, 50])
// => [10, 20, 30, 40, 50]

random

  • Returns a random value from an array
_.random([10, 20, 30])
// => Random Value 

_.random([10, 20, 30], 0, 1)
// => 10 or 20

Objects

omit

  • Returns one or more objects omitting the defined keys
_.omit(['birthday'], { name: 'dr1zzyts', age: 17, birthday: 11})
// => { name: 'dr1zzyts', age: 17 }

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})
// => { 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})
// => { name: 'dr1zzyts', age: 17 }

pickTypes

  • Returns one or more new objects with keys that only contain values ​​of defined types
_.pick(['string'], { name: 'dr1zzyts', age: 17, birthday: 11})
// => { name: 'dr1zzyts'}

Keywords

util

FAQs

Package last updated on 04 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts