nl_tokens: @arg { string } assetSymbol - 4 SYM @arg { number } [ precision = null ] - expected precision or mismatch AssertionError
pl_tokens: function parseAssetSymbol ( assetSymbol ) { var precision = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ; assert . equal ( typeof assetSymbol === 'undefined' ? 'undefined' : ( 0 , _typeof3 . default ) ( assetSymbol ) , "string" , "Asset symbol should be string" ) ; if ( assetSymbol . indexOf ( "," ) === - 1 ) { assetSymbol = ',' + assetSymbol ; // null precision } var v = assetSymbol . split ( "," ) ; assert ( v . length === 2 , 'Asset symbol "' + assetSymbol + '" may have a precision like this: 4,SYM' ) ; var symbolPrecision = v [ 0 ] == "" ? null : parseInt ( v [ 0 ] ) ; var symbol = v [ 1 ] ; if ( precision != null ) { assert . equal ( precision , symbolPrecision , "Asset symbol precision mismatch" ) ; } else { precision = symbolPrecision ; } if ( precision != null ) { assert . equal ( typeof precision === 'undefined' ? 'undefined' : ( 0 , _typeof3 . default ) ( precision ) , "number" , "precision" ) ; assert ( precision > - 1 , "precision must be positive" ) ; } if ( ! / ^[0-9]+$ / . test ( symbol ) ) { if ( / ^S#[0-9]+$ / . test ( symbol ) ) { symbol = symbol . <mask> ( "S#" , "" ) ; } else { throw new Error ( 'Asset symbol should looks like \'S#{num}\', but got ' + symbol + '.' ) ; } } assert ( precision <= 18 , "Precision should be 18 characters or less" ) ; assert ( symbol . length <= 7 , "Asset symbol is 7 characters or less" ) ; return { precision : precision , symbol : symbol } ; }