0.1.1 • Published 10 years ago
function-type v0.1.1
function-type 
The function type object.
- The function type could have a
globalScopeandglobalobject.- the
globalobject can not be exported. used to expose the functions. - the
globalScopeobject can be exported.
- the
- the function value could have
scopeobject.- the
scopeobject can be exported.
- the
the globalScope and scope can specify the global function to use.
It must be enclosed in '`'.
Usage
var FunctionType = require('function-type')
var Func = FunctionType({
globalScope:{
hi: 'hi '
, echo: '`echo`'
, log: '`log`'
}
, global: {
echo: function(a){return a}
, log: console.log
}
})
var f = Func.create('function print(a){log(hi+title+a)}', {scope:{title:'myTest:'}})
f.valueOf()('123')
//='hi myTest:123'API
See abstract-type.
TODO
License
MIT