@@ -66,6 +66,7 @@ const getCommentCompilationWarning = memoize(() =>
6666 * } from "../../javascript/JavascriptParser"
6767 */
6868/** @import Parser from "../../javascript/JavascriptParser" */
69+ /** @import BasicEvaluatedExpression from "../../javascript/BasicEvaluatedExpression" */
6970/** @import { ESMSettings } from "../esm/ESMImportDependencyParserPlugin" */
7071/** @import { ResourceHint } from "./WorkerDependency" */
7172
@@ -245,13 +246,13 @@ class WorkerAndWorkletPlugin {
245246 }
246247 } ;
247248
248- /** @typedef {Record<string, EXPECTED_ANY > } Values */
249+ /** @typedef {Record<string, ReturnType<BasicEvaluatedExpression["asCompileTimeValue"]> > } Values */
249250
250251 /**
251252 * Parses object expression.
252253 * @param {JavascriptParser } parser the parser
253254 * @param {ObjectExpression } expr expression
254- * @returns {{ expressions: Record<string, Expression | Pattern>, otherElements: (Property | SpreadElement)[], values: Values, spread: boolean, insertType: "comma" | "single", insertLocation: number } } parsed object
255+ * @returns {{ expressions: Record<string, Expression | Pattern | undefined >, otherElements: (Property | SpreadElement)[], values: Values, spread: boolean, insertType: "comma" | "single", insertLocation: number } } parsed object
255256 */
256257 const parseObjectExpression = ( parser , expr ) => {
257258 /** @type {Values } */
@@ -417,10 +418,8 @@ class WorkerAndWorkletPlugin {
417418 ) {
418419 continue ;
419420 }
420- /** @type {EXPECTED_ANY } */
421- ( entryOptions ) [ key ] = /** @type {EXPECTED_ANY } */ (
422- userEntryOptions
423- ) [ key ] ;
421+ /** @type {Record<string, EntryOptions[keyof EntryOptions]> } */
422+ ( entryOptions ) [ key ] = userEntryOptions [ key ] ;
424423 }
425424 }
426425 }
@@ -484,7 +483,7 @@ class WorkerAndWorkletPlugin {
484483 ? parseObjectExpression ( parser , arg2 )
485484 : {
486485 expressions :
487- /** @type {Record<string, Expression | Pattern> } */ ( { } ) ,
486+ /** @type {Record<string, Expression | Pattern | undefined > } */ ( { } ) ,
488487 otherElements : [ ] ,
489488 /** @type {Values } */
490489 values : { } ,
@@ -574,8 +573,7 @@ class WorkerAndWorkletPlugin {
574573 ) ;
575574 dep . loc = parser . getLocation ( expr ) ;
576575 parser . state . module . addPresentationalDependency ( dep ) ;
577- /** @type {EXPECTED_ANY } */
578- ( expressions ) . type = undefined ;
576+ expressions . type = undefined ;
579577 }
580578 } else if ( insertType === "comma" ) {
581579 if ( this . _module || hasSpreadInOptions ) {
0 commit comments