BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/recast/example
Run
Logout
Edit File
Size: 956 B
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/recast/example/add-braces
Text
Base64
#!/usr/bin/env node var recast = require("recast"); var types = recast.types; var n = types.namedTypes; var b = types.builders; require("recast").run(function(ast, callback) { recast.visit(ast, { visitIfStatement: function(path) { var stmt = path.node; stmt.consequent = fix(stmt.consequent); var alt = stmt.alternate; if (!n.IfStatement.check(alt)) { stmt.alternate = fix(alt); } this.traverse(path); }, visitWhileStatement: visitLoop, visitForStatement: visitLoop, visitForInStatement: visitLoop }); callback(ast); }); function visitLoop(path) { var loop = path.node; loop.body = fix(loop.body); this.traverse(path); } function fix(clause) { if (clause) { if (!n.BlockStatement.check(clause)) { clause = b.blockStatement([clause]); } } return clause; }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
add-braces
956 B
lrwxr-xr-x
2025-03-28 11:04:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generic-identity
401 B
lrwxr-xr-x
2025-03-28 11:04:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
identity
176 B
lrwxr-xr-x
2025-03-28 11:04:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
to-while
2.19 KB
lrwxr-xr-x
2025-03-28 11:04:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).