estools / espurify Goto Github PK
View Code? Open in Web Editor NEWClone AST without extra properties
License: MIT License
Clone AST without extra properties
License: MIT License
espurify ignore .default
property by default.
Is it expected bahavior?
"use strict";
const esprima = require("esprima");
const escodegen = require("escodegen");
const espurify = require('espurify');
var code = `function addPrefix(text, prefix = "Default:") {
return prefix + text;
}`;
const jsAst = esprima.parse(code);
const modifiedAst = espurify(jsAst);
console.log(escodegen.generate(modifiedAst));
/*
function addPrefix(text, prefix) { // <= no default parameter
return prefix + text;
}
*/
bower install --save espurify
is not working because of the error Package optionator not found
C:\test>bower install --save espurify
bower escodegen#~1.6.1 cached git://github.com/Constellation/escodegen.git#1.6.1
bower escodegen#~1.6.1 validate 1.6.1 against git://github.com/Constellation/escodegen.git#~1.6.1
bower espurify#* cached git://github.com/estools/espurify.git#1.3.0
bower espurify#* validate 1.3.0 against git://github.com/estools/espurify.git#*
bower estraverse#^1.9.1 cached git://github.com/Constellation/estraverse.git#1.9.3
bower estraverse#^1.9.1 validate 1.9.3 against git://github.com/Constellation/estraverse.git#^1.9.1
bower esprima#^1.2.2 cached git://github.com/ariya/esprima.git#1.2.4
bower esprima#^1.2.2 validate 1.2.4 against git://github.com/ariya/esprima.git#^1.2.2
bower esutils#^1.1.6 cached git://github.com/Constellation/esutils.git#1.1.6
bower esutils#^1.1.6 validate 1.1.6 against git://github.com/Constellation/esutils.git#^1.1.6
bower optionator#^0.5.0 ENOTFOUND Package optionator not found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.