Socket
Socket
Sign inDemoInstall

define-configurable

Package Overview
Dependencies
17
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    define-configurable

Defines new (or modifies existing) properties (using Object.defineProperty, setting `configurable: true` by default


Version published
Maintainers
1
Install size
4.25 MB
Created

Readme

Source

define-configurable

Defines new (or modifies existing) properties using Object.defineProperty on an object passed to define as this, setting configurable by default

Build Status js-standard-style npm version Coverage Status

--

Simple

const define = require('define-configurable')
const subject = {}
const props = [
  { one: true },
  { two () {
      console.log('do nothing')
    }
  }
]
define.apply(subject, props)

Extend

const define = require('define-configurable')
const subject = {
  search (arg) {}
}

define.apply(subject, {
  extend: {
    // optmized method for extending up till 7 arguments
    search (method, arg) {
      return method.call(this, arg)
    }
  }
})

Keywords

FAQs

Last updated on 19 Oct 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc