-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not fail when returning null or undefined from an async options ho…
…ok (#4039)
- Loading branch information
1 parent
5a22c8a
commit 6559f68
Showing
3 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'handles async plugin options', | ||
options: { | ||
preserveEntrySignatures: false, | ||
plugins: [ | ||
{ | ||
options(options) { | ||
assert.strictEqual(options.preserveEntrySignatures, false); | ||
return Promise.resolve({ ...options, preserveEntrySignatures: 'strict' }); | ||
} | ||
}, | ||
{ | ||
options(options) { | ||
assert.strictEqual(options.preserveEntrySignatures, 'strict'); | ||
return Promise.resolve(null); | ||
} | ||
} | ||
] | ||
}, | ||
exports(exports) { | ||
assert.strictEqual(exports.foo, 1); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const foo = 1; |