2019-05-14 18:48:48 -04:00
|
|
|
'use strict';
|
|
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
|
|
};
|
|
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
var result = {};
|
|
|
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
|
|
result["default"] = mod;
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
var path_1 = __importDefault(require("path"));
|
|
|
|
var browserify_zlib_1 = __importDefault(require("browserify-zlib"));
|
2019-11-23 21:38:13 +09:00
|
|
|
var random_1 = require("./random");
|
|
|
|
exports.randomBytes = random_1.randomBytes;
|
|
|
|
exports.randomHexString = random_1.randomHexString;
|
|
|
|
exports.randomNumber = random_1.randomNumber;
|
2019-05-14 18:48:48 -04:00
|
|
|
var data = __importStar(require("./browser-fs.json"));
|
2019-11-23 21:38:13 +09:00
|
|
|
var Cache = {};
|
2019-05-14 18:48:48 -04:00
|
|
|
function loadTests(tag) {
|
|
|
|
var filename = 'testcases/' + tag + ".json.gz";
|
2019-11-23 21:38:13 +09:00
|
|
|
if (Cache[filename] == null) {
|
|
|
|
console.log("loading:", filename);
|
|
|
|
Cache[filename] = JSON.parse(browserify_zlib_1.default.gunzipSync(new Buffer(data[filename], "base64")).toString());
|
|
|
|
}
|
|
|
|
return Cache[filename];
|
2019-05-14 18:48:48 -04:00
|
|
|
}
|
|
|
|
exports.loadTests = loadTests;
|
|
|
|
function loadData(filename) {
|
|
|
|
// Strip any leading relative paths (e.g. "./foo" => "foo")
|
|
|
|
filename = path_1.default.join(filename);
|
|
|
|
console.log("loading:", filename);
|
|
|
|
return new Buffer(data[filename], "base64");
|
|
|
|
}
|
|
|
|
exports.loadData = loadData;
|
2020-07-13 08:03:56 -04:00
|
|
|
//# sourceMappingURL=browser.js.map
|