"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deriveGlobOptions = deriveGlobOptions;
function deriveGlobOptions(files) {
    const options = {
        source: [],
        onlyFiles: false,
        onlyDirectories: false,
        ignore: [],
    };
    const addToArray = (target, value) => {
        if (typeof value === 'string') {
            target.push(value);
        }
        else if (Array.isArray(value)) {
            target.push(...value);
        }
    };
    if (typeof files === 'string' || Array.isArray(files)) {
        addToArray(options.source, files);
    }
    else {
        addToArray(options.source, files.source);
        addToArray(options.ignore, files.ignore);
        options.onlyFiles = files.only === 'files';
        options.onlyDirectories = files.only === 'directories';
    }
    return options;
}
//# sourceMappingURL=deriveGlobOptions.js.map