<commit_before>var replace = require("gulp-replace")
,   forEach = require("gulp-foreach")
,   loggerSpec = require("react-server-module-tagger")

// This pattern matches either of these:
//   - "__LOGGER__"
//   - "__LOGGER__({ /* options */ })"
var isWindows = ('win32' === process.platform)
,   REPLACE_TOKEN = /(?:__LOGGER__|__CHANNEL__|__CACHE__)(?:\(\s*(\{[\s\S]*?\})\s*\))?/g
,   THIS_MODULE   = isWindows
	? /(?:[^\\]+\\node_modules\\)?react-server-gulp-module-tagger\\index\.js$/
	: /(?:[^\/]+\/node_modules\/)?react-server-gulp-module-tagger\/index\.js$/

module.exports = function(config) {
	config || (config = {});
	config.basePath = module.filename.replace(THIS_MODULE,'');
	return forEach(function(stream, file){
		return stream.pipe(replace(REPLACE_TOKEN, loggerSpec.bind({file, config})));
	});
}<commit_msg>Update react-server-gulp-module-tagger to use new interface<commit_after>var replace = require("gulp-replace")
,   forEach = require("gulp-foreach")
,   loggerSpec = require("react-server-module-tagger")

// This pattern matches either of these:
//   - "__LOGGER__"
//   - "__LOGGER__({ /* options */ })"
var isWindows = ('win32' === process.platform)
,   REPLACE_TOKEN = /(?:__LOGGER__|__CHANNEL__|__CACHE__)(?:\(\s*(\{[\s\S]*?\})\s*\))?/g
,   THIS_MODULE   = isWindows
	? /(?:[^\\]+\\node_modules\\)?react-server-gulp-module-tagger\\index\.js$/
	: /(?:[^\/]+\/node_modules\/)?react-server-gulp-module-tagger\/index\.js$/

module.exports = function(config) {
	config || (config = {});
	config.basePath = module.filename.replace(THIS_MODULE,'');
	return forEach(function(stream, file){
		return stream.pipe(replace(REPLACE_TOKEN, (match, optString) => {
			return loggerSpec({
				filePath: file.path,
				basePath: config.basePath,
				trim: config.trim, optString,
			});
		}));
	});
}
{'fraction_non_alphanumeric': 0.22185430463576158, 'fraction_numerical': 0.002207505518763797, 'mean_word_length': 4.107042253521127, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '928479', 'n_tokens_mistral': 671, 'n_tokens_neox': 651, 'n_words': 92}