lib/core_modules/module/events.js
function prepArgs(args, name, event, defaults) {
  args = Array.from(args);

  var namespace = [name];
  if (!Array.isArray(event)) {
    event = event.split(delimiter);
  }

  namespace = namespace.concat(event);

  args.shift();//remove the event

  args.unshift(namespace);
  if (defaults) {
    args.push(defaults);
  }
  return args;
}
function prepArgs(args, name, event, defaults) {
  args = Array.from(args);

  var namespace = [name];
  if (!Array.isArray(event)) {
    event = event.split(delimiter);
  }

  namespace = namespace.concat(event);

  args.shift();//remove the event

  args.unshift(namespace);
  if (defaults) {
    args.push(defaults);
  }
  return args;
}
function prepArgs ( args , name , event , defaults ) { args = Array . from ( args ) ; var namespace = [ name ] ; if ( ! Array . isArray ( event ) ) { event = event . split ( delimiter ) ; } namespace = namespace . concat ( event ) ; args . shift ( ) ; //remove the event args . unshift ( namespace ) ; if ( defaults ) { args . push ( defaults ) ; } return args ; }
Helps in preparing our arguments for passing to emit and emitAsync
@param args
@param name
@param defaults
@returns {*}
Helps in preparing our arguments for passing to emit and emitAsync