This commit is contained in:
2026-03-03 15:23:00 +00:00
parent 5e3726de39
commit 8e223bfbec
3689 changed files with 955330 additions and 1011 deletions

61
node_modules/@hapi/catbox/lib/pending.js generated vendored Executable file
View File

@@ -0,0 +1,61 @@
'use strict';
const internals = {};
exports = module.exports = class {
id = null;
timeout = null;
count = 1;
rule = null;
resolve = null;
reject = null;
constructor(id, rule) {
this.id = id;
this.rule = rule;
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
});
}
join() {
++this.count;
return this.promise;
}
send(err, value, cached, report) {
clearTimeout(this.timeout);
if (err &&
!cached) {
this.reject(err);
return;
}
if (!this.rule.getDecoratedValue) {
this.resolve(value);
return;
}
if (err) {
report.error = err;
}
this.resolve({ value, cached, report });
}
setTimeout(fn, timeoutMs) {
clearTimeout(this.timeout);
this.timeout = setTimeout(fn, timeoutMs);
}
};