nv-ctx-basic
v1.0.2
Published
nv-ctx-basic =============== - nv-ctx-basic - simple util to avoid use return and throw - similiar to nv-facutil-simple-ctx+nv-facutil-simple-inout, just for compatible with nvlang-syntax
Downloads
3
Readme
nv-ctx-basic
- nv-ctx-basic
- simple util to avoid use return and throw
- similiar to nv-facutil-simple-ctx+nv-facutil-simple-inout, just for compatible with nvlang-syntax
install
- npm install nv-ctx-basic
usage
const {creat_ctx} = require("nv-ctx-basic");
example
> var ctx = creat_ctx({a:100,b:200})
> ctx.is_rtrn()
false
> ctx.rtrn()
> ctx
Ctx { a: 100, b: 200 }
> ctx.is_rtrn()
true
> ctx.should_leave_func()
true
>
> ctx.pair()
[ true, Ctx { a: 100, b: 200 } ]
>
> ctx.subst("a")
{ a: 100 }
> ctx.subst("b")
{ b: 200 }
>
METHODS
ctx._subst ctx.brek ctx.cntn ctx.constructor
ctx.is_brek ctx.is_cntn ctx.is_exec ctx.is_rtrn
ctx.is_thrw ctx.pair ctx.rtrn ctx.should_leave_bloc
ctx.should_leave_func ctx.subst ctx.three ctx.thrw
API
{
_tool: {
_un: undefined,
_nu: null,
_t: true,
_f: false,
typof: [Function: typof],
instof: [Function: instof],
_Y: [Function: Symbol],
_S: [Function: String],
'LEN$S': 'length',
_A: [Function: Array],
_creat_ary: [Function: _creat_ary],
creat_ary: [Function: creat_ary],
ary_incld: [Function: ary_incld],
_O: [Function: Object],
hasop: [Function: hasop],
oks: [Function: oks],
ovs: [Function: ovs],
oes: [Function: oes],
_dsubst: [Function: _dsubst],
dsubst: [Function: dsubst],
oasgn: [Function: oasgn],
_F: [Function: Function],
_is_acallable: [Function: _is_acallable]
},
_cls: {
PROPS: [
'exec', 'rtrn',
'thrw', 'brek',
'cntn', 'is_exec',
'is_rtrn', 'is_thrw',
'is_brek', 'is_cntn',
'should_leave_func', 'should_leave_bloc',
'_subst', 'subst',
'pair', 'three'
],
is_valid_lex_key: [Function: is_valid_lex_key],
creat_ctx: [Function: creat_ctx]
},
is_valid_lex_key: [Function: is_valid_lex_key],
creat_ctx: [Function: creat_ctx]
}
LICENSE
- ISC