Comparing version 1.0.0 to 1.1.0
@@ -5,5 +5,15 @@ 'use strict'; | ||
function define(bounded, unbounded) { | ||
if (bounded.unbounded !== unbounded) { | ||
Object.defineProperty(bounded, 'unbounded', { | ||
value: unbounded.unbounded || unbounded, | ||
enumerable: false, | ||
configurable: false, | ||
writable: false | ||
}); | ||
} | ||
return bounded; | ||
} | ||
function binder() { | ||
var unbounded = this.unbounded || this; | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
@@ -13,10 +23,5 @@ args[_key] = arguments[_key]; | ||
var result = bind.apply(this, args); | ||
Object.defineProperty(result, 'unbounded', { | ||
value: unbounded, | ||
enumerable: false, | ||
configurable: false, | ||
writable: false | ||
}); | ||
return result; | ||
var bounded = bind.apply(this, args); | ||
define(bounded, this); | ||
return bounded; | ||
} | ||
@@ -29,4 +34,5 @@ | ||
} | ||
return module.exports; | ||
} | ||
module.exports = { bind: bind, binder: binder, patch: patch }; | ||
module.exports = { bind: bind, binder: binder, patch: patch, define: define }; |
# History | ||
## v1.1.0 2018 July 13 | ||
- Exports `define` for manually specifying the `unbounded` property | ||
## v1.0.0 2018 July 13 | ||
- Initial working version |
{ | ||
"name": "unbounded", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Function.prototype.bind replacement that provides an `unbounded` hidden property on the returned bounded function, that contains the original unbounded function", | ||
@@ -5,0 +5,0 @@ "homepage": "ssh://git@github.com/bevry/unbounded", |
@@ -46,3 +46,3 @@ <!-- TITLE/ --> | ||
<li>Module: <code>require('unbounded')</code></li> | ||
<li>CDN URL: <code>//wzrd.in/bundle/unbounded@1.0.0</code></li></ul> | ||
<li>CDN URL: <code>//wzrd.in/bundle/unbounded@1.1.0</code></li></ul> | ||
@@ -49,0 +49,0 @@ <a href="http://enderjs.com" title="Ender is a full featured package manager for your browser"><h3>Ender</h3></a><ul> |
@@ -5,12 +5,18 @@ 'use strict' | ||
function define (bounded, unbounded) { | ||
if (bounded.unbounded !== unbounded) { | ||
Object.defineProperty(bounded, 'unbounded', { | ||
value: unbounded.unbounded || unbounded, | ||
enumerable: false, | ||
configurable: false, | ||
writable: false | ||
}) | ||
} | ||
return bounded | ||
} | ||
function binder (...args) { | ||
const unbounded = this.unbounded || this | ||
const result = bind.apply(this, args) | ||
Object.defineProperty(result, 'unbounded', { | ||
value: unbounded, | ||
enumerable: false, | ||
configurable: false, | ||
writable: false | ||
}) | ||
return result | ||
const bounded = bind.apply(this, args) | ||
define(bounded, this) | ||
return bounded | ||
} | ||
@@ -23,4 +29,5 @@ | ||
} | ||
return module.exports | ||
} | ||
module.exports = { bind, binder, patch } | ||
module.exports = { bind, binder, patch, define } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15694
56