All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.style-spec.validate.validate_boolean.js Maven / Gradle / Ivy

The newest version!

import getType from '../util/get_type';
import ValidationError from '../error/validation_error';

export default 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 [];
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy