typedsv
Version:
Parse and map delimiter-separated values (csv, tsv, etc.) to TypeScript/ES6+ classes.
34 lines • 872 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var NotParsableError_1 = require("../error/NotParsableError");
var Store = /** @class */ (function () {
function Store() {
this.parsed = new Map();
}
Store.prototype.getParsed = function (type) {
var md = this.parsed.get(type);
if (!md) {
throw new NotParsableError_1.NotParsableError(type);
}
return md;
};
Store.prototype.putParsed = function (target, arg) {
var o = this.parsed.get(target);
if (!o) {
this.parsed.set(target, [arg]);
}
else {
o.push(arg);
}
};
return Store;
}());
var store;
function getStore() {
if (!store) {
store = new Store();
}
return store;
}
exports.getStore = getStore;
//# sourceMappingURL=Store.js.map