<commit_before>'use strict';

const Wrapper = class CheckWrapper {
    constructor(type, validator) {
        this.type = type;
        this.run = validator;
    }
};

let run = function(value, validator) {
    if (!validator) {
        return false;
    }

    if (typeof validator === 'object') {
        if (validator instanceof Wrapper) {
            return validator.run(value);
        }

        return Object.keys(validator).every((key) => {
            return run(value[key], validator[key]);
        });
    }

    if (typeof validator !== 'function') {
        return false;
    }

    switch (validator) {
        case String:
            return typeof value === 'string';
        case Boolean:
            return typeof value === 'boolean';
        case Number:
            return typeof value === 'number';
        case Object:
            return value && typeof value === 'object' && !Array.isArray(value);
        case Array:<commit_msg>feat(arrayliteral): add support for array literal syntax: powercheck(['foo', 'bar'], [String])<commit_after>'use strict';

const Wrapper = class CheckWrapper {
    constructor(type, validator) {
        this.type = type;
        this.run = validator;
    }
};

let run = function(value, validator) {
    if (!validator) {
        return false;
    }

    if (typeof validator === 'object') {
        if (validator instanceof Wrapper) {
            return validator.run(value);
        }

        if (Array.isArray(validator)) {
            const arrayItemValidator = validator[0];
            if (!arrayItemValidator) {
                return false;
            }

            return run(value, Array) && value.every((val) => {
                return run(val, arrayItemValidator);
            });
        }

        return Object.keys(validator).every((key) => {
            return run(value[key], validator[key]);
        });
    }

    if (typeof validator !== 'function') {
        return false;
    }

    switch (validator) {
        case String:
            return typeof value === 'string';
        case Boolean:
            return typeof value === 'boolean';
        case Number:
            return typeof value === 'number';
        case Object:
            return value && typeof value === 'object' && !Array.isArray(value);
        case Array:
{'fraction_non_alphanumeric': 0.12657130472475075, 'fraction_numerical': 0.00043346337234503684, 'mean_word_length': 1.91046658259773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3544289', 'n_tokens_mistral': 608, 'n_tokens_neox': 607, 'n_words': 166}