Skip to content

Commit f84ec01

Browse files
committed
Fix TSC generating broken .d.ts files
1 parent 6e0fa13 commit f84ec01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
/**
22
* @typedef {import('unist').Node} Node
33
* @typedef {import('unist').Parent} Parent
4-
* @typedef {import('unist-util-is').Test} Test
4+
*
5+
* @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
6+
* Test from `unist-util-is`.
7+
*
8+
* Note: we have remove and add `undefined`, because otherwise when generating
9+
* automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
10+
* which doesn’t work when publishing on npm.
511
*/
612

713
/**

0 commit comments

Comments
 (0)