Skip to content

Commit

Permalink
fix: 修复 URL 规则无法校验完整 URL 问题
Browse files Browse the repository at this point in the history
  • Loading branch information
D-xuanmo committed Jul 8, 2023
1 parent e21cb29 commit 363cfa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/url.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SingleRuleType } from '../types'

const rule: SingleRuleType = {
validator: (value: unknown) => /^https?:\/\/(\w+\.)+\w+(:\d+)?(\/|\?.*)?$/i.test(value as string)
validator: (value: unknown) => /^https?:\/\/(\w+\.)+\w+(:\d+)?([?\/]\S*)?$/i.test(value as string)
}

export default rule

0 comments on commit 363cfa9

Please sign in to comment.