File tree Expand file tree Collapse file tree 6 files changed +5
-5
lines changed
packages/scramjet/packages/core Expand file tree Collapse file tree 6 files changed +5
-5
lines changed File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export interface ScramjetFetchParsed {
4040 clientUrl ?: URL ;
4141
4242 meta : URLMeta ;
43- scriptType : string ;
43+ scriptType : "module" | "regular" ;
4444}
4545
4646export interface ScramjetFetchResponse {
@@ -209,13 +209,13 @@ export function parseRequest(
209209 const strippedUrl = new URL ( request . rawUrl . href ) ;
210210 const extraParams : Record < string , string > = { } ;
211211
212- let scriptType = "" ;
212+ let scriptType : "module" | "regular" = "regular " ;
213213 let topFrameName : string | undefined ;
214214 let parentFrameName : string | undefined ;
215215 for ( const [ param , value ] of [ ...request . rawUrl . searchParams . entries ( ) ] ) {
216216 switch ( param ) {
217217 case "type" :
218- scriptType = value ;
218+ if ( value === "module" ) scriptType = value ;
219219 break ;
220220 case "dest" :
221221 break ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export type ScramjetInterface = {
3636 ) : Element [ ] ;
3737 getWorkerInjectScripts ?(
3838 meta : URLMeta ,
39- type : "module" | undefined ,
39+ type : "module" | "regular" ,
4040 script : ( src : string ) => string
4141 ) : string ;
4242} ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { URLMeta } from "@rewriters/url";
55export function rewriteWorkers (
66 context : ScramjetContext ,
77 js : string | Uint8Array ,
8- type : "module" | undefined ,
8+ type : "module" | "regular" ,
99 url : string ,
1010 meta : URLMeta
1111) {
You can’t perform that action at this time.
0 commit comments