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 * @typedef {object} LoaderItem
* @property {string} loader * @property {string} loader
* @property {string | null | undefined | Record<string, EXPECTED_ANY>} options * @property {string | null | undefined | Record<string, EXPECTED_ANY>} options
* @property {string=} ident * @property {string | null=} ident
* @property {string=} type * @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) ? parsedResult.query.slice(1)
: undefined : undefined
: item.options, : item.options,
ident: ident: item.options === undefined ? undefined : item.ident
item.options === undefined
? undefined
: /** @type {string} */ (item.ident)
}; };
return callback(null, resolved); return callback(null, resolved);

View File

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

4
types.d.ts vendored
View File

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