maplibre-gl
Version:
BSD licensed community fork of mapbox-gl, a WebGL interactive maps library
16 lines (11 loc) • 382 B
text/typescript
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 [];
}