1.0.0 • Published 9 years ago
var-statement v1.0.0
var-statement v1.0.0
npm install aleclarson/var-statement#1.0.0
usage
Function.fromString = (string) -> eval "(function () { return " + inner + "; })()"
myFunc = `function () { var hello, foo, test, bar, world; }`
VarStatement = require "var-statement"
statement = VarStatement.first myFunc
newFunc = Function.fromString statement.remove "world", "hello", "test"
newFunc.toString() # "function () { var foo, bar; }"
tests
All tests are passing! Find out for yourself:
npm install -g jasmine-node
npm test
1.0.0
9 years ago