lib/bench-rest.js
function bindSubtituteFnsWithTokens(actions, tokens) {
  return actions.map(function (action) {
    return Object.keys(action).reduce(function (accum, key) {
      // if it is list of sub keys, and is a fn, then bind with tokens
      if (SUBSTITUTED_KEYS.indexOf(key) !== -1 && typeof action[key] === 'function') {
        accum[key] = action[key].bind(null, tokens);
      } else {
        accum[key] = action[key];
      }
      return accum;
    }, {});
  });
}
function bindSubtituteFnsWithTokens(actions, tokens) {
  return actions.map(function (action) {
    return Object.keys(action).reduce(function (accum, key) {
      // if it is list of sub keys, and is a fn, then bind with tokens
      if (SUBSTITUTED_KEYS.indexOf(key) !== -1 && typeof action[key] === 'function') {
        accum[key] = action[key].bind(null, tokens);
      } else {
        accum[key] = action[key];
      }
      return accum;
    }, {});
  });
}
function bindSubtituteFnsWithTokens ( actions , tokens ) { return actions . map ( function ( action ) { return Object . keys ( action ) . reduce ( function ( accum , key ) { // if it is list of sub keys, and is a fn, then bind with tokens if ( SUBSTITUTED_KEYS . indexOf ( key ) !== - 1 && typeof action [ key ] === 'function' ) { accum [ key ] = action [ key ] . bind ( null , tokens ) ; } else { accum [ key ] = action [ key ] ; } return accum ; } , { } ) ; } ) ; }
if any of the action properties that allow substitution are fns, then
bind the tokens to the fn, so when executed it will have proper value
@returns actions with fns bound
if any of the action properties that allow substitution are fns then bind the tokens to the fn so when executed it will have proper value