{"size": 1070, "ext": "js", "max_stars_repo_path": "node_modules/intern/node_modules/dojo/text.js", "max_stars_repo_name": "amdharness/AmdHarness-amd-xml-test-Intern", "max_stars_repo_stars_event_min_datetime": "2018-12-17T09:58:44.000Z", "max_stars_repo_stars_event_max_datetime": "2018-12-17T09:58:44.000Z", "max_issues_repo_path": "node_modules/intern/node_modules/dojo/text.js", "max_issues_repo_name": "amdharness/AmdHarness-amd-xml-test-Intern", "max_issues_repo_issues_event_min_datetime": "2016-02-08T11:45:00.000Z", "max_issues_repo_issues_event_max_datetime": "2016-02-08T11:45:00.000Z", "max_forks_repo_path": "node_modules/intern/node_modules/dojo/text.js", "max_forks_repo_name": "amdharness/AmdHarness-amd-xml-test-Intern", "max_forks_repo_forks_event_min_datetime": "2018-01-11T18:49:27.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-17T09:58:46.000Z"}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 20.9803921569, "max_line_length": 80, "alphanum_fraction": 0.6196261682}
define([ './has' ], function (has) {
	var _getText;

	if (has('host-browser')) {
		_getText = function (url, callback) {
			var xhr = new XMLHttpRequest();

			xhr.onload = function () {
				callback(xhr.responseText);
			};

			xhr.open('GET', url, true);
			xhr.send(null);
		};
	}
	else if (has('host-node')) {
		var fs = require.nodeRequire('fs');
		_getText = function (url, callback) {
			fs.readFile(url, { encoding: 'utf8' }, function (error, data) {
				if (error) {
					throw error;
				}

				callback(data);
			});
		};
	}
	else {
		_getText = function () {
			throw new Error('dojo/text not supported on this platform');
		};
	}

	function getText(resourceId, load, moduleRequire) {
		var cacheId = 'url:' + resourceId;
		if (require.cache && require.cache[cacheId] != null) {
			load(require.cache[cacheId]);
		}
		else {
			_getText(moduleRequire ? moduleRequire.toUrl(resourceId) : resourceId, load);
		}
	}

	getText.dynamic = true;
	getText.load = function (resourceId, require, load) {
		getText(resourceId, load, require);
	};

	return getText;
});
