nl_tokens: Replace variables like $ { var } in string
pl_tokens: function ( str , vars ) { vars = vars || { } ; var resolver = _ . isFunction ( vars ) ? vars : function ( str , p1 ) { return p1 in vars ? vars [ p1 ] : null ; } ; var res = require ( 'resources' ) ; return <mask> ( 'tabStops' ) . processText ( str , { variable : function ( data ) { var newValue = resolver ( data . token , data . name , data ) ; if ( newValue === null ) { // try to find variable in resources newValue = res . getVariable ( data . name ) ; } if ( newValue === null || _ . isUndefined ( newValue ) ) // nothing found, return token itself newValue = data . token ; return newValue ; } } ) ; }