Name: js-handler/node_modules/restify/node_modules/once/once.js
| 1: | module.exports = once |
| 2: | |
| 3: | once.proto = once(function () { |
| 4: | Object.defineProperty(Function.prototype, 'once', { |
| 5: | value: function () { |
| 6: | return once(this) |
| 7: | }, |
| 8: | configurable: true |
| 9: | }) |
| 10: | }) |
| 11: | |
| 12: | function once (fn) { |
| 13: | var called = false |
| 14: | return function () { |
| 15: | if (called) return |
| 16: | called = true |
| 17: | return fn.apply(this, arguments) |
| 18: | } |
| 19: | } |
