Skip to content

Commit

Permalink
refactor: remove legacy typescript compatible logic
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Sep 19, 2023
1 parent 3e3688b commit 72a1907
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/builder/bundless/dts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,11 @@ export default async function getDeclarations(
// ref: https://github.com/LeDDGroup/typescript-transform-paths/blob/06c317839ca2f2426ad5c39c640e231f739af115/src/transformer.ts#L136-L140
const proxyTs = new Proxy(ts, {
get(target: any, prop) {
// typescript internal method since 4.4.x
const PROXY_KEY = 'tryParsePatterns';

return prop === PROXY_KEY
? () =>
PROXY_KEY in target
? target.tryParsePatterns(transformPaths)
: target.getOwnKeys(transformPaths)
? () => target[PROXY_KEY](transformPaths)
: target[prop];
},
});
Expand Down

0 comments on commit 72a1907

Please sign in to comment.