packages/create-react-scripts/compose.js
function compose(...args) {
  // convert pipe to compose by reverse the array
  const crsConfigs = args.slice(0).reverse();
  const crsConfig = {
    env: pipe(crsConfigs.map(c => c.env)),
    paths: pipe(crsConfigs.map(c => c.paths)),
    webpack: pipe(crsConfigs.map(c => c.webpack)),
    devServer: pipe(crsConfigs.map(c => c.devServer)),
    jest: pipe(crsConfigs.map(c => c.jest)),
    scripts: mergeScripts(crsConfigs.map(c => c.scripts)),
  };
  return crsConfig;
}
function compose(...args) {
  // convert pipe to compose by reverse the array
  const crsConfigs = args.slice(0).reverse();
  const crsConfig = {
    env: pipe(crsConfigs.map(c => c.env)),
    paths: pipe(crsConfigs.map(c => c.paths)),
    webpack: pipe(crsConfigs.map(c => c.webpack)),
    devServer: pipe(crsConfigs.map(c => c.devServer)),
    jest: pipe(crsConfigs.map(c => c.jest)),
    scripts: mergeScripts(crsConfigs.map(c => c.scripts)),
  };
  return crsConfig;
}
function compose ( ... args ) { // convert pipe to compose by reverse the array const crsConfigs = args . slice ( 0 ) . reverse ( ) ; const crsConfig = { env : pipe ( crsConfigs . map ( c => c . env ) ) , paths : pipe ( crsConfigs . map ( c => c . paths ) ) , webpack : pipe ( crsConfigs . map ( c => c . webpack ) ) , devServer : pipe ( crsConfigs . map ( c => c . devServer ) ) , jest : pipe ( crsConfigs . map ( c => c . jest ) ) , scripts : mergeScripts ( crsConfigs . map ( c => c . scripts ) ) , } ; return crsConfig ; }
this function is used to compose multiple configs into one config
this function is used to compose multiple configs into one config