Skip to content

Commit b6fa5be

Browse files
committed
chore: update transform types
1 parent 13ab5b1 commit b6fa5be

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"lint-staged": "latest",
6969
"pinst": "latest",
7070
"prettier": "latest",
71+
"rollup": "^3.15.0",
7172
"typescript": "4.8.4",
7273
"unbuild": "1.1.1",
7374
"vite": "4.1.1",

pnpm-lock.yaml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/transform.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Context, createContext, runInContext } from 'node:vm'
22
import { pathToFileURL } from 'node:url'
33

4-
import { walk } from 'estree-walker'
4+
import { walk, Node } from 'estree-walker'
55
import type { SimpleCallExpression } from 'estree'
6-
6+
import type { SourceMapInput } from 'rollup'
77
import { createUnplugin } from 'unplugin'
88
import MagicString from 'magic-string'
99
import { parseURL, parseQuery } from 'ufo'
@@ -60,7 +60,7 @@ export const MagicRegExpTransformPlugin = createUnplugin(() => {
6060

6161
const s = new MagicString(code)
6262

63-
walk(this.parse(code), {
63+
walk(this.parse(code) as Node, {
6464
enter(_node) {
6565
if (_node.type !== 'CallExpression') return
6666
const node = _node as SimpleCallExpression
@@ -92,7 +92,7 @@ export const MagicRegExpTransformPlugin = createUnplugin(() => {
9292
if (s.hasChanged()) {
9393
return {
9494
code: s.toString(),
95-
map: s.generateMap({ includeContent: true, source: id }),
95+
map: s.generateMap({ includeContent: true, source: id }) as SourceMapInput,
9696
}
9797
}
9898
},

0 commit comments

Comments
 (0)