firest commit

This commit is contained in:
wwweww
2026-02-21 22:48:40 +08:00
commit 55e8053e07
1034 changed files with 99049 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import {once} from 'node:events';
// Combines `util.aborted()` and `events.addAbortListener()`: promise-based and cleaned up with a stop signal
export const onAbortedSignal = async (mainSignal, stopSignal) => {
if (!mainSignal.aborted) {
await once(mainSignal, 'abort', {signal: stopSignal});
}
};