var-statement

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i var-statement

Weekly Downloads

0

Version

1.0.0

License

none

Last publish

Collaborators

  • aleclarson