Files
cannaiq/frontend/node_modules/es-toolkit/dist/function/once.js
2025-11-28 19:45:44 -07:00

18 lines
330 B
JavaScript

'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function once(func) {
let called = false;
let cache;
return function (...args) {
if (!called) {
called = true;
cache = func(...args);
}
return cache;
};
}
exports.once = once;