Closed chungang-li closed 1 year ago
Yes, the reviver parameter is currently not supported. I'll make time to implement it if it's a much needed feature.
btw. You can always change "JSON.parse(data.toString())" to "JSON.decode(data)" safely and get a performance boost due to the unnecessary string conversion by toString().
@chungang-li The reviver parameter is now implemented for JSON.parse() and JSON.decode() since commit 3911ed68ccda425950270ea566c11c8d8095ac49. You can use it in the latest nightly build or wait until the next major release.
@chungang-li Hello, could you please help verify if it resolves your issue? Thanks!
I've solved it in other ways,i will try it in the Next Major release . tks
.pipeline('notify-pipeline') // .onStart(()=> void(console.log('module====>(pipeline)[notify-pipeline]'))) .branch( () => Boolean(serviceObj.notify_services && __serviceObj.notify_services?.length > 0), ( $=>$.fork(() => serviceObj.notify_services).to( $=>$.onStart(r => void(console.log('on-start-invoked', r) , _nextService = r)) .replaceMessage( e => ( (route, path, headers, body) => ( _target = _services[_nextService].select(), path = e.head.path, body = JSON.parse(e.body.toString(), (k,v)=>( console.log(v), // not work v )), new Message({ ...e.head, path: path, headers }, JSON.stringify(body? body : '') ) ) )() ).link( 'forward', () => Boolean(_target), 'bypass' ) ) ), )