mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
17 lines
563 B
TypeScript
17 lines
563 B
TypeScript
// Loaded from https://raw.githubusercontent.com/denjucks/dex/master/lib/util/finally-mixin.js
|
|
|
|
|
|
import noop from './noop.js';
|
|
|
|
const finallyMixin = (prototype) =>
|
|
Object.assign(prototype, {
|
|
finally(onFinally) {
|
|
return this.then().finally(onFinally);
|
|
},
|
|
});
|
|
|
|
// FYI: Support for `Promise.prototype.finally` was not introduced until Node 9.
|
|
// Therefore, Knex will need to conditionally inject support for `.finally(..)`
|
|
// until support for Node 8 is officially dropped.
|
|
export default Promise.prototype.finally ? finallyMixin : noop;
|