• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Haixing-Hu / js-common-validator / d68634be-aa47-48ea-adda-8c76cd3e8d2b

21 Dec 2023 07:32AM UTC coverage: 84.435% (+8.0%) from 76.419%
d68634be-aa47-48ea-adda-8c76cd3e8d2b

push

circleci

Haixing-Hu
refactor: merge old codes from other projects and refactor

194 of 237 branches covered (0.0%)

Branch coverage included in aggregate %.

112 of 117 new or added lines in 13 files covered. (95.73%)

202 of 232 relevant lines covered (87.07%)

22.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/validators/validate-url-field.js
1
////////////////////////////////////////////////////////////////////////////////
2
//
3
//    Copyright (c) 2022 - 2023.
4
//    Haixing Hu, Qubit Co. Ltd.
5
//
6
//    All rights reserved.
7
//
8
////////////////////////////////////////////////////////////////////////////////
9
import Url from '../rules/url';
10
import validateStringFieldByRule from './impl/validate-string-field-by-rule';
11

12
/**
13
 * Verify whether a field value of an object is a string representation of a
14
 * valid URL.
15
 *
16
 * @param {string} value
17
 *     The field value to be verified must be of string type; for other types,
18
 *     an error will be reported in the returned verification result.
19
 * @param {object} context
20
 *     The validation context.
21
 * @return {ValidationResult}
22
 *     The validation result.
23
 * @author Haixing Hu
24
 */
25
export default function validateUrlField(value, context = {}) {
×
NEW
26
  context.label = context.label || '网址';
×
NEW
27
  return validateStringFieldByRule(value, Url, context);
×
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc