1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/@hapi/hoek/lib/once.js

24 lines
345 B
JavaScript
Raw Normal View History

2023-12-18 13:12:25 +08:00
'use strict';
const internals = {};
module.exports = function (method) {
if (method._hoekOnce) {
return method;
}
let once = false;
const wrapped = function (...args) {
if (!once) {
once = true;
method(...args);
}
};
wrapped._hoekOnce = true;
return wrapped;
};