summaryrefslogtreecommitdiff
path: root/node_modules/async/internal/onlyOnce.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/async/internal/onlyOnce.js')
-rw-r--r--node_modules/async/internal/onlyOnce.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/async/internal/onlyOnce.js b/node_modules/async/internal/onlyOnce.js
new file mode 100644
index 0000000..6ad721b
--- /dev/null
+++ b/node_modules/async/internal/onlyOnce.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = onlyOnce;
+function onlyOnce(fn) {
+ return function (...args) {
+ if (fn === null) throw new Error("Callback was already called.");
+ var callFn = fn;
+ fn = null;
+ callFn.apply(this, args);
+ };
+}
+module.exports = exports["default"]; \ No newline at end of file