Skip to content

Variable: json

ts
const json: Validator<string>;

JSON string validation / JSON 字符串验证

Example

ts
json('{"key":"value"}') // => { isValid: true, message: undefined }
json('{bad json}') // => { isValid: false, message: 'Invalid JSON string / JSON格式无效' }

Since

1.0.0

Released under the MIT License.