function collapseLeadingSlashes (str) {
	  for (var i = 0; i < str.length; i++) {
	    if (str.charCodeAt(i) !== 0x2f /* / */) {
	      break
	    }
	  }

	  return i > 1
	    ? '/' + str.substr(i)
	    : str
	}
Build RegExp object from an array
of multiple/multi-line regexp parts

@param {string[]} parts
@param {string} flags
@return {object} - RegExp object