Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 1001 Bytes

readme.md

File metadata and controls

43 lines (27 loc) · 1001 Bytes

$mol_state_arg

State of arguments.

NodeJS

When command line arguments like foo=bar xxx:

$mol_state_arg.value( 'foo' ) // 'bar'
$mol_state_arg.value( 'xxx' ) // ''
$mol_state_arg.value( 'help' ) // null

Web

When document location like #foo=bar/xxx or ?foo=bar&xxx:

$mol_state_arg.value( 'foo' ) // 'bar'
$mol_state_arg.value( 'xxx' ) // ''
$mol_state_arg.value( 'help' ) // null
$mol_state_arg.value( 'xxx' , null ) // Location is '#foo=bar' now
$mol_state_arg.link({ xxx : '' , abc : 'hello' }) // '#foo=bar/xxx/abc=hello'

Properties

value( key : string , next? : string ) : string

Returns and sets value by key without history position changing.

dict( next? : { [ ket : string ] : string } ) : { [ ket : string ] : string }

Returns and sets dictionary of all arguments.

link( next : { [ key : string ] : string } ) : string

Returns link with overridden arguments.

Real world usage