All files / gulpfile.ts/lib configure.ts

100% Statements 11/11
100% Branches 0/0
100% Functions 1/1
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291x 1x 1x 1x                     1x 2x   1x   2x         2x 2x 2x    
import chalk from 'chalk'
import * as deepmerge from 'deepmerge'
import * as os from 'os'
import {
  arrayMerge,
  devLogger,
  devLoggerTitle,
  IFullTimplaConfig,
  ITimplaConfig,
  logTitle,
  resolveConfig,
  TIMPLA_DEFAULTS,
} from '../internal'
 
export const configure: (timplaConfig?: ITimplaConfig) => IFullTimplaConfig = timplaConfig => {
  let conf = TIMPLA_DEFAULTS
  if (timplaConfig) {
    conf = deepmerge(TIMPLA_DEFAULTS, timplaConfig, { arrayMerge })
  }
  logTitle(
    chalk.green(`Timpla config used:`),
    chalk.blue(resolveConfig()),
    chalk.yellow(`Set the TIMPLA_CONFIG_PATH environment to point to a different config.`)
  )
  devLoggerTitle(`Config dump`)
  devLogger('%O', conf, os.EOL, os.EOL)
  return conf
}