Urara-Blog/node_modules/.pnpm-store/v3/files/c3/eea0b4018a66a8497de7f57ed7b671218870dc086a95f854f4e0fa9f654804aa5522a9bf8ff16ea773b5e73ccd8992665403a421df9076b24855f60f7e0f2a
2022-08-14 01:14:53 +08:00

15 lines
No EOL
363 B
Text

"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"];