File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,11 @@ export function useStore(
142142 }
143143 }
144144
145- function setImportMap ( map : ImportMap ) {
145+ function setImportMap ( map : ImportMap , merge = false ) {
146+ if ( merge ) {
147+ map = mergeImportMap ( getImportMap ( ) , map )
148+ }
149+
146150 if ( map . imports )
147151 for ( const [ key , value ] of Object . entries ( map . imports ) ) {
148152 if ( value ) {
@@ -368,6 +372,7 @@ export function useStore(
368372 deleteFile,
369373 renameFile,
370374 getImportMap,
375+ setImportMap,
371376 getTsConfig,
372377 serialize,
373378 deserialize,
@@ -436,6 +441,7 @@ export interface ReplStore extends UnwrapRef<StoreState> {
436441 deleteFile ( filename : string ) : void
437442 renameFile ( oldFilename : string , newFilename : string ) : void
438443 getImportMap ( ) : ImportMap
444+ setImportMap ( map : ImportMap , merge ?: boolean ) : void
439445 getTsConfig ( ) : Record < string , any >
440446 serialize ( ) : string
441447 deserialize ( serializedState : string ) : void
You can’t perform that action at this time.
0 commit comments