Skip to content

Commit

Permalink
modern build works
Browse files Browse the repository at this point in the history
  • Loading branch information
PuruVJ committed Jul 13, 2024
1 parent 5e14684 commit 006394c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
20 changes: 20 additions & 0 deletions examples/try-esm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Traverse } from 'neotraverse/modern';

const obj = {
a: 1,
b: 2,
c: {
d: 3,
e: 4,
f: {
g: 5,
h: 6,
},
},
};

new Traverse(obj).forEach((ctx, node) => {
if (node === 6) ctx.update(68);
});

console.log(obj);
16 changes: 16 additions & 0 deletions examples/try-esm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "try-esm",
"version": "1.0.0",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"neotraverse": "0.6.9-test.1"
}
}
23 changes: 23 additions & 0 deletions examples/try-esm/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neotraverse",
"version": "0.6.8",
"version": "0.6.9-test.1",
"description": "traverse and transform objects by visiting every node on a recursive walk",
"main": "dist/legacy/legacy.cjs",
"type": "module",
Expand Down

0 comments on commit 006394c

Please sign in to comment.