Skip to content

Commit 48f0dc0

Browse files
committed
Fix TSC generating broken .d.ts files
1 parent d8e1388 commit 48f0dc0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/index.js

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

715
/**

0 commit comments

Comments
 (0)