jd-opensource / drip-form

基于React和JSONSchema的动态表单解决方案
https://jd-opensource.github.io/drip-form/
MIT License
613 stars 73 forks source link

feat: ajv format添加https校验 #113

Closed mengshang918 closed 2 years ago

mengshang918 commented 2 years ago

Motivation

ajv string校验format添加https校验

Have you read the Contributing Guidelines on pull requests?

Y

Test Plan

  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)
  })

Related PRs

N