Skip to content

Commit 5042f97

Browse files
committed
chore: remove dead code from analysis worker
1 parent b873f9b commit 5042f97

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

src/lib/analyze-css.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
11
import type { analyze as AnalyzeCss } from '@projectwallace/css-analyzer'
22

3-
let worker: Worker
4-
53
export class CssAnalysisError extends Error { }
64

75
export type CssAnalysis = ReturnType<typeof AnalyzeCss>
8-
9-
export function analyze(css: string) {
10-
return new Promise((resolve, reject) => {
11-
// setup the worker
12-
if (!worker) {
13-
worker = new Worker(new URL('$lib/analyzer-worker.js', import.meta.url), {
14-
type: 'module'
15-
})
16-
}
17-
18-
// Respond to worker callbacks
19-
worker.onmessage = (event) => {
20-
if ('error' in event.data) {
21-
reject(new CssAnalysisError(event.data.error))
22-
}
23-
resolve(event.data as CssAnalysis)
24-
}
25-
26-
worker.onerror = (error) => reject(error)
27-
28-
// Send CSS to the worker
29-
worker.postMessage(css)
30-
})
31-
}

src/lib/analyzer-worker.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)