<commit_before>'use strict';

var path = require('path');
var url = require('url');
var Uri = require('./lib/Uri').default;

Uri.setParseFn(function(urlStr) {
	var parsed = url.parse(urlStr);
	parsed.pathname = path.normalize(parsed.pathname);
	return parsed;
});

module.exports = Uri;<commit_msg>Stops using nodejs url code when running on browser<commit_after>'use strict';

var Uri = require('./lib/Uri').default;

if (typeof document === 'undefined') {
	// If there's no document, then this should be running in NodeJS, and so
	// we should use the "url" node module as the parse function.

	var path = require('path');
	var url = require('url');
	Uri.setParseFn(function(urlStr) {
		var parsed = url.parse(urlStr);
		parsed.pathname = path.normalize(parsed.pathname);
		return parsed;
	});
}

module.exports = Uri;
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.0, 'mean_word_length': 4.662068965517242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1573484', 'n_tokens_mistral': 269, 'n_tokens_neox': 262, 'n_words': 77}