function getFileMatchers(config, name, defaultSrc, defaultDestination, macroExpander, customBuildOptions) {
    const globalPatterns = config[name];
    const platformSpecificPatterns = customBuildOptions[name];
    const defaultMatcher = new FileMatcher(defaultSrc, defaultDestination, macroExpander);
    const fileMatchers = [];
    function addPatterns(patterns) {
        if (patterns == null) {
            return;
        } else if (!Array.isArray(patterns)) {
            if (typeof patterns === "string") {
                defaultMatcher.addPattern(patterns);
                return;
            }
            patterns = [patterns];
        }
        for (const pattern of patterns) {
            if (typeof pattern === "string") {
                // use normalize to transform ./foo to foo
                defaultMatcher.addPattern(pattern);
            } else if (name === "asarUnpack") {
                throw new Error(`Advanced file copying not supported for "${name}"`);
            } else {
                const from = pattern.from == null ? defaultSrc : _path.resolve(defaultSrc, pattern.from);
                const to = pattern.to == null ? defaultDestination : _path.resolve(defaultDestination, pattern.to);
                fileMatchers.push(new FileMatcher(from, to, macroExpander, pattern.filter));
            }
        }
    }
    addPatterns(globalPatterns);
    addPatterns(platformSpecificPatterns);
    if (!defaultMatcher.isEmpty()) {
        // default matcher should be first in the array
        fileMatchers.unshift(defaultMatcher);
    }
    return fileMatchers.length === 0 ? null : fileMatchers;
}
/*}");
    }
    // https://github.com/electron-userland/electron-builder/issues/1969
    // exclude ony for app root, use .yarnclean to clean node_modules
    patterns.push("!.editorconfig");
    const debugLogger = packager.info.debugLogger;
    if (debugLogger.enabled) {
        //tslint:disable-next-line:no-invalid-template-strings
        debugLogger.add(`${macroExpander("${arch}")}.firstOrDefaultFilePatterns`, patterns);
    }
    return matchers;
}
/** @internal