@maplibre/maplibre-gl-style-spec
Version:
a specification for maplibre styles
16 lines (11 loc) • 381 B
text/typescript
import {getType} from '../util/get_type';
import {ValidationError} from '../error/validation_error';
export function validateBoolean(options) {
const value = options.value;
const key = options.key;
const type = getType(value);
if (type !== 'boolean') {
return [new ValidationError(key, value, `boolean expected, ${type} found`)];
}
return [];
}