1.0.0 • Published 9 years ago

var-statement v1.0.0

Weekly downloads
6
License
-
Repository
github
Last release
9 years ago

var-statement v1.0.0 stable

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