-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): fixing the preview types for caching
- Loading branch information
1 parent
cdfee41
commit 3509bce
Showing
2 changed files
with
9 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
// Description: Clear Timestamps | ||
|
||
import type { Script } from "../types/core" | ||
import { | ||
getGroupedScripts, | ||
processScriptPreview, | ||
scriptFlags, | ||
} from "../api/kit.js" | ||
import { Channel } from "../core/enum.js" | ||
import { formatChoices } from "../core/utils.js" | ||
import type { Script } from '../types/core' | ||
import { getGroupedScripts, processScriptPreview, scriptFlags } from '../api/kit.js' | ||
import { Channel } from '../core/enum.js' | ||
import { formatChoices } from '../core/utils.js' | ||
|
||
let groupedScripts = await getGroupedScripts() | ||
let scripts = formatChoices(groupedScripts) | ||
let firstScript = scripts.find(script => !script.skip) | ||
let preview = `` | ||
let firstScript = scripts.find((script) => !script.skip) | ||
let preview = '' | ||
try { | ||
preview = await processScriptPreview( | ||
firstScript as unknown as Script | ||
)() | ||
preview = (await processScriptPreview(firstScript as unknown as Script)()) as string | ||
} catch {} | ||
|
||
process.send({ | ||
channel: Channel.CACHE_SCRIPTS, | ||
scripts, | ||
preview, | ||
scriptFlags, | ||
scriptFlags | ||
}) | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters