r42hbq
Last Updated: June 01, 2017
·
51
· Codi

Validate or check a json string in Javascript

You can use this json validator Javascript component to validate a json string, returning the exception if not (see tests).

Example:

const vaildateJson = require('bit/global/json-validator'); vaildateJson(jsonStr).catch(err => console.log(err))

Test Summary
validate json string validate proper json str - Pass
validate json string when sending number should get exception - Pass
validate json string when sending broken json should get exception - Pass

Say Thanks
Respond