package.src.style-spec.validate.validate_string.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mapbox-gl Show documentation
Show all versions of mapbox-gl Show documentation
A WebGL interactive maps library
The newest version!
import getType from '../util/get_type';
import ValidationError from '../error/validation_error';
export default function validateString(options) {
const value = options.value;
const key = options.key;
const type = getType(value);
if (type !== 'string') {
return [new ValidationError(key, value, `string expected, ${type} found`)];
}
return [];
}