Skip to content

Commit 158e044

Browse files
refactor(types): more
1 parent 3092f7c commit 158e044

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

lib/FileSystemInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ class FileSystemInfo {
11581158
/**
11591159
* @param {string} path path
11601160
* @param {string} reason reason
1161-
* @param {string[]} args arguments
1161+
* @param {any[]} args arguments
11621162
*/
11631163
_log(path, reason, ...args) {
11641164
const key = path + reason;

lib/javascript/JavascriptModulesPlugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,10 @@ class JavascriptModulesPlugin {
456456
context.__webpack_require__
457457
);
458458
} catch (e) {
459-
e.stack += printGeneratedCodeForStack(options.module, code);
459+
e.stack += printGeneratedCodeForStack(
460+
options.module,
461+
/** @type {string} */ (code)
462+
);
460463
throw e;
461464
}
462465
});

lib/util/memoize.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const memoize = fn => {
2323
cache = true;
2424
// Allow to clean up memory for fn
2525
// and all dependent resources
26-
// @ts-expect-error this is a hack to allow to clean up memory
2726
fn = undefined;
2827
return /** @type {T} */ (result);
2928
}

lib/util/runtime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ class RuntimeSpecMap {
516516

517517
/**
518518
* @param {RuntimeSpec} runtime the runtimes
519-
* @param {() => T} computer function to compute the value
520-
* @returns {T} true, when the runtime was deleted
519+
* @param {() => TODO} computer function to compute the value
520+
* @returns {TODO} true, when the runtime was deleted
521521
*/
522522
provide(runtime, computer) {
523523
switch (this._mode) {

types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11233,7 +11233,7 @@ declare class RuntimeSpecMap<T> {
1123311233
get(runtime: RuntimeSpec): undefined | T;
1123411234
has(runtime: RuntimeSpec): boolean;
1123511235
set(runtime: RuntimeSpec, value: T): void;
11236-
provide(runtime: RuntimeSpec, computer: () => T): T;
11236+
provide(runtime: RuntimeSpec, computer: () => any): any;
1123711237
delete(runtime: RuntimeSpec): void;
1123811238
update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
1123911239
keys(): RuntimeSpec[];

0 commit comments

Comments
 (0)