New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

clean-options

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-options

clean options

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Clean Options

Clean options.

Introduction

  • Ensure options is an object
  • Remove undefined fields in options object shallowly

Installation

npm i clean-options

Usage

const clean = require('clean-options')

function say(options) {
  const {
    name = 'Bob'
  } = clean(options)

  console.log(name)
}

say({name: 'Alice'}) // Alice
say({name: undefined}) // Bob
say({}) // Bob
say() // Bob

License

MIT

Keywords

clean

FAQs

Package last updated on 14 Mar 2018

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