Skip to content

Commit

Permalink
refactor: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jun 6, 2023
1 parent f5677bc commit 3a765d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ResolverFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const UseFilePlugin = require("./UseFilePlugin");
/** @typedef {string|string[]|false} AliasOptionNewRequest */
/** @typedef {{[k: string]: AliasOptionNewRequest}} AliasOptions */
/** @typedef {{[k: string]: string|string[] }} ExtensionAliasOptions */
/** @typedef {{apply: function(Resolver): void} | function(this: Resolver, Resolver): void} Plugin */
/** @typedef {false | 0 | "" | null | undefined} Falsy */
/** @typedef {{apply: function(Resolver): void} | (function(this: Resolver, Resolver): void) | Falsy} Plugin */

/**
* @typedef {Object} UserResolveOptions
Expand Down
2 changes: 2 additions & 0 deletions test/plugins.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ describe("plugins", function () {
const resolver = ResolverFactory.createResolver({
fileSystem: require("fs"),
plugins: [
0,
"",
false,
null,
undefined,
Expand Down
5 changes: 5 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ declare interface ParsedIdentifier {
internal: boolean;
}
type Plugin =
| undefined
| null
| false
| ""
| 0
| { apply: (arg0: Resolver) => void }
| ((this: Resolver, arg1: Resolver) => void);
declare interface PnpApiImpl {
Expand Down

0 comments on commit 3a765d9

Please sign in to comment.