1.0.12 • Published 10 years ago

define-configurable v1.0.12

Weekly downloads
8
License
ISC
Repository
github
Last release
10 years ago

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

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago