Skip to content

Commit

Permalink
fix: update es-module-lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Aug 25, 2024
1 parent 5295795 commit 4170fad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
9 changes: 2 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions telefunc/node/transformer/getExportNames.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
export { getExportNames }

import { init, parse } from 'es-module-lexer'
import { assert } from '../utils'

async function getExportNames(src: string) {
async function getExportNames(src: string): Promise<string[]> {
await init
const parseResult = parse(src)
const exportNames = parseResult[1]
assert(Array.isArray(exportNames as any), { src, exportNamesType: typeof exportNames })
const [_imports, exports] = parseResult
const exportNames = exports.map((e) => e.n)
return exportNames
}
2 changes: 1 addition & 1 deletion telefunc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@brillout/json-serializer": "^0.5.6",
"@brillout/picocolors": "^1.0.12",
"@brillout/vite-plugin-server-entry": "^0.4.12",
"es-module-lexer": "^0.7.1",
"es-module-lexer": "^1.0.0",
"ts-morph": "^19.0.0"
},
"main": "./dist/cjs/node/server/index.js",
Expand Down

0 comments on commit 4170fad

Please sign in to comment.