Closed mengshang918 closed 2 years ago
ajv string校验format添加https校验
Y
test('https', () => { addFormats(ajv) const validate = ajv.compile({ type: 'string', format: 'https' }) expect( validate('https://www.example.com/foo/?bar=baz&inga=42&quux') ).toEqual(true) expect(validate('https://www.example.com')).toEqual(true) expect(validate('http://www.example.com')).toEqual(false) expect(validate('//www.example.com')).toEqual(false) })
N
Motivation
ajv string校验format添加https校验
Have you read the Contributing Guidelines on pull requests?
Y
Test Plan
Related PRs
N