code: function splitByReplacement(before, after) {
    return function eachElement(value, i, array) {
      ['\'', '"']
        .forEach(function eachStringTerminator(terminator) {
          var description = {
            before: 'require(' + terminator + before + terminator,
            after : 'require(' + terminator + after  + terminator
          };
          var interleaver = interleave(description);
          for (var i = 0; i < array.length; i += 2) {
            var split = array[i].split(description.before);
            if (split.length > 1) {
              var interleaved = split.reduce(interleaver, []);
              array.splice.apply(array, [i, 1].concat(interleaved));
              i += interleaved.length - 1;  // skip the newly added items
            }
          }
        });
    }
  }
docs: Get a reduce method for the given text replacement.
  Every 2N element is unmatched, and 2N+1 element is a key. Keep splitting the 2N elements until all the keys are
  processed. 2N+1 elements are replaced with an object <code>{before:string, after:string}</code>.
  Replacements should be non-intersecting so long as we quote them. Consider either string terminator style.
  @param {string} before The value to search for
  @param {string} after The value after replacement with
  @returns {function} A method that reduces the split array and returns the array