diff options
Diffstat (limited to 'node_modules/mongoose/lib/helpers/once.js')
-rw-r--r-- | node_modules/mongoose/lib/helpers/once.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/mongoose/lib/helpers/once.js b/node_modules/mongoose/lib/helpers/once.js new file mode 100644 index 0000000..0267579 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/once.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function once(fn) { + let called = false; + return function() { + if (called) { + return; + } + called = true; + return fn.apply(null, arguments); + }; +};
\ No newline at end of file |