lib/directives/index.js
function find(params = {}) {
  const name = params.type;

  if (Utils.has(availableDirectives, name)) {
    return new availableDirectives[name](params);
  }

  // Only show warning if someone explicity enters a bad name
  if (name) { Logger.warn(`Directive type '${name}' does not exist. Falling back to 'text'`); }
  /* eslint-disable-next-line new-cap */
  return new availableDirectives.text(params);
}
function find(params = {}) {
  const name = params.type;

  if (Utils.has(availableDirectives, name)) {
    return new availableDirectives[name](params);
  }

  // Only show warning if someone explicity enters a bad name
  if (name) { Logger.warn(`Directive type '${name}' does not exist. Falling back to 'text'`); }
  /* eslint-disable-next-line new-cap */
  return new availableDirectives.text(params);
}
function find ( params = { } ) { const name = params . type ; if ( Utils . has ( availableDirectives , name ) ) { return new availableDirectives [ name ] ( params ) ; } // Only show warning if someone explicity enters a bad name if ( name ) { Logger . warn ( ` ${ name } ` ) ; } /* eslint-disable-next-line new-cap */ return new availableDirectives . text ( params ) ; }
Lookup function for available directives
Falls back to "text" directive if one can't be found.

@params {Object} params - options and attributes
@return {Directive} - an directive instance
Lookup function for available directives Falls back to text directive if one can t be found .