molstar
Version:
A comprehensive macromolecular library.
45 lines • 1.47 kB
JavaScript
/*
* Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* from https://github.com/dsehnal/CIFTools.js
* @author David Sehnal <david.sehnal@gmail.com>
*/
var ReaderResult;
(function (ReaderResult) {
function error(message, line) {
if (line === void 0) { line = -1; }
return new Error(message, line);
}
ReaderResult.error = error;
function success(result, warnings) {
if (warnings === void 0) { warnings = []; }
return new Success(result, warnings);
}
ReaderResult.success = success;
var Error = /** @class */ (function () {
function Error(message, line) {
this.message = message;
this.line = line;
this.isError = true;
}
Error.prototype.toString = function () {
if (this.line >= 0) {
return "[Line " + this.line + "] " + this.message;
}
return this.message;
};
return Error;
}());
ReaderResult.Error = Error;
var Success = /** @class */ (function () {
function Success(result, warnings) {
this.result = result;
this.warnings = warnings;
this.isError = false;
}
return Success;
}());
ReaderResult.Success = Success;
})(ReaderResult || (ReaderResult = {}));
export { ReaderResult };
//# sourceMappingURL=result.js.map