From f9eb1fde67d8860f7e46f168d3c2f625afca5e4b Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 11 Apr 2019 10:54:00 +0200 Subject: [PATCH] oops --- lib/once.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/once.js diff --git a/lib/once.js b/lib/once.js new file mode 100644 index 000000000..369ee162e --- /dev/null +++ b/lib/once.js @@ -0,0 +1,8 @@ +module.exports = function (f) { + var called; + return function () { + if (called) { return; } + called = true; + f.apply(this, Array.prototype.slice.call(arguments)); + }; +};