From f93e7e488c14bae2bc846f5657e71f141ebc8d41 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Tue, 15 Aug 2023 14:13:55 +0200 Subject: [PATCH 1/2] Test passing a literal object to processor.stringify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The object type is correctly inferred as an mdast Root. We should make sure this doesn’t break. --- index.test-d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.test-d.ts b/index.test-d.ts index d92e1483..52e9f4ff 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -575,6 +575,10 @@ const remarkStringify: Plugin<[], MdastRoot, string> = function () { // Empty. } +expectType( + unified().use(remarkStringify).stringify({type: 'root', children: []}) +) + expectType(unified().use(remarkParse).use(rehypeParse).parse('')) expectType( From 158083b716ef3022843a52fca849d4678be4535b Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Tue, 15 Aug 2023 14:18:40 +0200 Subject: [PATCH 2/2] Fix test --- index.test-d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.test-d.ts b/index.test-d.ts index 52e9f4ff..dd58bf4a 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -575,7 +575,7 @@ const remarkStringify: Plugin<[], MdastRoot, string> = function () { // Empty. } -expectType( +expectType( unified().use(remarkStringify).stringify({type: 'root', children: []}) )