Skip to content

Commit

Permalink
feat: support cache selected typescript version (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangmingfu authored Feb 19, 2025
1 parent bbc740b commit 33ca3c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ export function useStore(
}
}
if (vueVersion.value) files._version = vueVersion.value
if (typescriptVersion.value !== 'latest' || files._tsVersion) {
files._tsVersion = typescriptVersion.value
}
return '#' + utoa(JSON.stringify(files))
}
const deserialize: ReplStore['deserialize'] = (
Expand All @@ -289,6 +292,8 @@ export function useStore(
for (const filename in saved) {
if (filename === '_version') {
vueVersion.value = saved[filename]
} else if (filename === '_tsVersion') {
typescriptVersion.value = saved[filename]
} else {
setFile(files.value, filename, saved[filename])
}
Expand Down

0 comments on commit 33ca3c0

Please sign in to comment.