Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let cancelSignal = weakCancelSignal.get(abortSignal);
if (!cancelSignal) weakCancelSignal.set(abortSignal, cancelSignal = createCancelSignal(abortSignal));
return cancelSignal;
}
Object.defineProperties(AbortSignal.prototype, {
[Cancelable.cancelSignal]: {
...methodBase,
value(this: AbortSignal) {
return getOrCreateCancelSignal(this);
}
}
});
Object.defineProperties(AbortController.prototype, {
[CancelableSource.cancelSignal]: {
...methodBase,
value(this: AbortController) {
return getOrCreateCancelSignal(this.signal);
}
},
[CancelableSource.cancel]: {
...methodBase,
value(this: AbortController) {
this.abort();
}
}
});
}