fix: types

This commit is contained in:
alexander-akait 2025-08-22 14:11:29 +03:00
parent 82966a31a7
commit ba552aabfc
4 changed files with 5 additions and 9 deletions

View File

@ -130,8 +130,8 @@ const ABSOLUTE_PATH_REGEX = /^([a-zA-Z]:\\|\\\\|\/)/;
* @typedef {object} LoaderItem
* @property {string} loader
* @property {string | null | undefined | Record<string, EXPECTED_ANY>} options
* @property {string=} ident
* @property {string=} type
* @property {string | null=} ident
* @property {string | null=} type
*/
/**

View File

@ -1245,10 +1245,7 @@ If changing the source code is not an option there is also a resolve options cal
? parsedResult.query.slice(1)
: undefined
: item.options,
ident:
item.options === undefined
? undefined
: /** @type {string} */ (item.ident)
ident: item.options === undefined ? undefined : item.ident
};
return callback(null, resolved);

View File

@ -10,7 +10,6 @@ const { SyncHook } = require("tapable");
/** @typedef {import("../../declarations/WebpackOptions").Falsy} Falsy */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetLoaderOptions} RuleSetLoaderOptions */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetRule} RuleSetRule */
/** @typedef {import("../NormalModule").LoaderItem} LoaderItem */
/** @typedef {(Falsy | RuleSetRule)[]} RuleSetRules */

4
types.d.ts vendored
View File

@ -9311,8 +9311,8 @@ declare interface LoaderDefinitionFunction<
declare interface LoaderItem {
loader: string;
options?: null | string | Record<string, any>;
ident?: string;
type?: string;
ident?: null | string;
type?: null | string;
}
declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
default?: