RunKit + npm: ajv

node v10.24.1
endpointsharetweet
var Ajv = require('ajv'); var ajv = new Ajv({allErrors: true}); var schema = { "format": "date-time" , }; var validate = ajv.compile(schema); test("2019-08-26T12:32:42.503+0000"); test("2019-08-26T12:32:42.503+00:00"); function test(data) { var valid = validate(data); if (valid) console.log('Valid!'); else console.log('Invalid: ' + ajv.errorsText(validate.errors)); }
Created from: https://npm.runkit.com/ajv
Loading…