JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q69484F
  • License ISC

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

Package Exports

  • define-configurable

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (define-configurable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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)
    }
  }
})