function copyDir(src, destination, options = {}) {
    const fileCopier = new FileCopier(options.isUseHardLink, options.transformer);
    if ((_util || _load_util()).debug.enabled) {
        (0, (_util || _load_util()).debug)(`Copying ${src} to ${destination}${fileCopier.isUseHardLink ? " using hard links" : ""}`);
    }
    const createdSourceDirs = new Set();
    const links = [];
    return walk(src, options.filter, {
        consume: (() => {
            var _ref4 = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (file, stat, parent) {
                if (!stat.isFile() && !stat.isSymbolicLink()) {
                    return;
                }
                if (!createdSourceDirs.has(parent)) {
                    yield (0, (_fsExtraP || _load_fsExtraP()).ensureDir)(parent.replace(src, destination));
                    createdSourceDirs.add(parent);
                }
                const destFile = file.replace(src, destination);
                if (stat.isFile()) {
                    yield fileCopier.copy(file, destFile, stat);
                } else {
                    links.push({ file: destFile, link: yield (0, (_fsExtraP || _load_fsExtraP()).readlink)(file) });
                }
            });

            return function consume(_x6, _x7, _x8) {
                return _ref4.apply(this, arguments);
            };
        })()
    }).then(() => (_bluebirdLst2 || _load_bluebirdLst2()).default.map(links, it => (0, (_fsExtraP || _load_fsExtraP()).symlink)(it.link, it.file), CONCURRENCY));
}
Empty directories is never created.
Hard links is used if supported and allowed.