recursive-copy-cli
Version:
CLI for [recursive-copy](https://github.com/timkendrick/recursive-copy)
30 lines (29 loc) • 1.42 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
exports.transformParamsToFunction = void 0;
var highland_1 = __importDefault(require("highland"));
var requireTryAll_1 = require("./requireTryAll");
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
function transformParamsToFunction(argv) {
var transform = undefined;
if (argv.transformModule) {
var transformFnList_1 = argv.transformModule.map(function (module) { return requireTryAll_1.requireTryAll(module); });
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
transform = function (src, dest, stats) {
var _a;
// pipeline declaration in highland is missing
/* istanbul ignore next */
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
return (_a = highland_1["default"]).pipeline.apply(_a, transformFnList_1.map(function (transformFn) {
return transformFn(src, dest, stats);
}));
};
}
if (transform) {
argv.transform = transform;
}
}
exports.transformParamsToFunction = transformParamsToFunction;
;