src/utils.js
function getTemplatesList(customPath = null) {
  const predefined = getDirectories(DEFAULT_PATH_TEMPLATES).reduce(createListOfDirectories, {})
  try {
    const custom = customPath ? getDirectories(customPath).reduce(createListOfDirectories, {}) : []

    return { ...predefined, ...custom }
  } catch (error) {
    Logger.warn('The custom templates path that you supply is unreachable')
    Logger.warn('falling back to defaults templates')
    return predefined
  }
}
function getTemplatesList(customPath = null) {
  const predefined = getDirectories(DEFAULT_PATH_TEMPLATES).reduce(createListOfDirectories, {})
  try {
    const custom = customPath ? getDirectories(customPath).reduce(createListOfDirectories, {}) : []

    return { ...predefined, ...custom }
  } catch (error) {
    Logger.warn('The custom templates path that you supply is unreachable')
    Logger.warn('falling back to defaults templates')
    return predefined
  }
}
function getTemplatesList ( customPath = null ) { const predefined = getDirectories ( DEFAULT_PATH_TEMPLATES ) . reduce ( createListOfDirectories , { } ) try { const custom = customPath ? getDirectories ( customPath ) . reduce ( createListOfDirectories , { } ) : [ ] return { ... predefined , ... custom } } catch ( error ) { Logger . warn ( 'The custom templates path that you supply is unreachable' ) Logger . warn ( 'falling back to defaults templates' ) return predefined } }
Returns the list of templates available
@param {any} customPath
Returns the list of templates available