code: function replace_handler(rule, values) {
    return function (_, n, name) {
      return name ? values[rule.map[name].index + 1] : values[n];
    };
  }
docs: Replace handler for `$n` and `:key` in path
  @param {Object} rule
  @param {Array} values
  @returns {Function}