nl_tokens: Reads in the given config and fills in the Sources Macros
pl_tokens: function processSources ( cfg ) { if ( typeof cfg [ 'Sources' ] === 'undefined' ) { log . e ( 'You must defined a Sources object.\n' ) ; rejectSetup ( 'You must defined a Sources object.' ) ; return ; } let val , sources , subval ; for ( let key in cfg ) { val = cfg [ key ] ; if ( key == 'Sources' ) { Config . Sources = { } ; sources = cfg [ 'Sources' ] ; for ( let subkey in sources ) { subval = sources [ subkey ] ; switch ( typeof subval ) { case 'string' : { Config . Sources [ subkey ] = Macro ( subval ) ; break ; } case 'object' : { Config . Sources [ subkey ] = { } ; for ( let <mask> in subval ) { Config . Sources [ subkey ] [ id . toLowerCase ( ) ] = ( typeof subval [ id ] == 'string' ) ? Macro ( subval [ id ] ) : subval [ id ] ; } if ( ! ( 'port' in Config . Sources [ subkey ] ) ) { Config . Sources [ subkey ] [ 'port' ] = 27000 ; } break ; } default : { log . e ( ` ${ subkey } ${ typeof subval } ` + 'Must be of type string or object' ) ; } } } } else { Config [ key ] = val ; } } }