Skip to content

Commit

Permalink
release: v4.2.3-dev.2
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Sep 30, 2024
1 parent c2399be commit ab3f2bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## [4.2.3-dev.2](https://github.com/qmhc/vite-plugin-dts/compare/v4.2.3-dev.1...v4.2.3-dev.2) (2024-09-30)

## [4.2.3-dev.1](https://github.com/qmhc/vite-plugin-dts/compare/v4.2.3-dev.0...v4.2.3-dev.1) (2024-09-30)

## [4.2.3-dev.0](https://github.com/qmhc/vite-plugin-dts/compare/v4.2.2...v4.2.3-dev.0) (2024-09-30)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-dts",
"version": "4.2.3-dev.1",
"version": "4.2.3-dev.2",
"type": "module",
"packageManager": "[email protected]",
"license": "MIT",
Expand Down
8 changes: 5 additions & 3 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,21 @@ function transformAlias(
return importer
}

const vlsRE = /^_?__VLS_/

function isVLSNode(node: ts.Node) {
if (ts.isVariableStatement(node)) {
return node.declarationList.declarations.some(
d => ts.isIdentifier(d.name) && `${d.name.escapedText}`.startsWith('__VLS_')
d => ts.isIdentifier(d.name) && vlsRE.test(`${d.name.escapedText}`)
)
}

if (ts.isTypeAliasDeclaration(node)) {
return `${node.name.escapedText}`.startsWith('__VLS_')
return vlsRE.test(`${node.name.escapedText}`)
}

if (ts.isFunctionDeclaration(node)) {
return !!node.name && `${node.name.escapedText}`.startsWith('__VLS_')
return !!node.name && vlsRE.test(`${node.name.escapedText}`)
}

return false
Expand Down

0 comments on commit ab3f2bc

Please sign in to comment.