Skip to content

Commit 029962b

Browse files
committed
only handle single nodes
1 parent f9321a9 commit 029962b

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

.changeset/thin-lobsters-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'esrap': major
3+
---
4+
5+
breaking: `print(...)` only accepts a node, not an array of nodes

src/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
2323
* @returns {{ code: string, map: any }} // TODO
2424
*/
2525
export function print(node, visitors, opts = {}) {
26-
if (Array.isArray(node)) {
27-
return print(
28-
{
29-
type: 'Program',
30-
body: node,
31-
sourceType: 'module'
32-
},
33-
visitors,
34-
opts
35-
);
36-
}
37-
3826
/** @type {Command[]} */
3927
const commands = [];
4028

0 commit comments

Comments
 (0)