mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 16:40:19 +00:00

- node-gyp@0.6.5 - abstracted-out configs - publishing over proxies - bugfixes to all the deps
20 lines
346 B
JavaScript
20 lines
346 B
JavaScript
module.exports = once
|
|
|
|
once.proto = once(function () {
|
|
Object.defineProperty(Function.prototype, 'once', {
|
|
value: function () {
|
|
return once(this)
|
|
},
|
|
configurable: true
|
|
})
|
|
})
|
|
|
|
function once (fn) {
|
|
var called = false
|
|
return function () {
|
|
if (called) return
|
|
called = true
|
|
return fn.apply(this, arguments)
|
|
}
|
|
}
|