You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
732 B
25 lines
732 B
// @flow
|
|
|
|
import ValidationError from '../error/validation_error.js';
|
|
import validateString from './validate_string.js';
|
|
|
|
import type {ValidationOptions} from './validate.js';
|
|
|
|
export default function(options: ValidationOptions): Array<ValidationError> {
|
|
const value = options.value;
|
|
const key = options.key;
|
|
|
|
const errors = validateString(options);
|
|
if (errors.length) return errors;
|
|
|
|
if (value.indexOf('{fontstack}') === -1) {
|
|
errors.push(new ValidationError(key, value, '"glyphs" url must include a "{fontstack}" token'));
|
|
}
|
|
|
|
if (value.indexOf('{range}') === -1) {
|
|
errors.push(new ValidationError(key, value, '"glyphs" url must include a "{range}" token'));
|
|
}
|
|
|
|
return errors;
|
|
}
|