"use strict";
/*
 * Copyright (c) 2022-2022.
 * Author Peter Placzek (tada5hi)
 * For the full copyright and license information,
 * view the LICENSE file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPathCoveredByParseAllowedOption = exports.flattenParseAllowedOption = void 0;
const utils_1 = require("../../../utils");
function flattenParseAllowedOption(input) {
    return (0, utils_1.flattenToKeyPathArray)(input);
}
exports.flattenParseAllowedOption = flattenParseAllowedOption;
function isPathCoveredByParseAllowedOption(input, path) {
    const paths = Array.isArray(path) ? path : [path];
    const items = (0, utils_1.flattenToKeyPathArray)(input);
    for (let i = 0; i < items.length; i++) {
        if (paths.indexOf(items[i]) !== -1) {
            return true;
        }
    }
    return false;
}
exports.isPathCoveredByParseAllowedOption = isPathCoveredByParseAllowedOption;
//# sourceMappingURL=allowed-option.js.map