CB-12003 updated node_modules

This commit is contained in:
Steve Gill
2016-10-17 10:50:30 -07:00
parent 2e37d2c253
commit 0b710a86a9
36 changed files with 602 additions and 299 deletions
Generated Vendored
+21
View File
@@ -1,5 +1,6 @@
var wrappy = require('wrappy')
module.exports = wrappy(once)
module.exports.strict = wrappy(onceStrict)
once.proto = once(function () {
Object.defineProperty(Function.prototype, 'once', {
@@ -8,6 +9,13 @@ once.proto = once(function () {
},
configurable: true
})
Object.defineProperty(Function.prototype, 'onceStrict', {
value: function () {
return onceStrict(this)
},
configurable: true
})
})
function once (fn) {
@@ -19,3 +27,16 @@ function once (fn) {
f.called = false
return f
}
function onceStrict (fn) {
var f = function () {
if (f.called)
throw new Error(f.onceError)
f.called = true
return f.value = fn.apply(this, arguments)
}
var name = fn.name || 'Function wrapped with `once`'
f.onceError = name + " shouldn't be called more than once"
f.called = false
return f
}