UNPKG

@chartshq/datamodel

Version:

An environment with `node`, `rustup` and `wasm-pack` set up.

1 lines 747 B
import{CategoricalParser,ContinuousParser,TemporalParser}from"../fieldParsers";var DataParserStore=function(){function r(){this.store=new Map,this.parsers(this._getDefaultParsers())}return r.prototype._getDefaultParsers=function(){return[new CategoricalParser,new ContinuousParser,new TemporalParser]},r.prototype.parsers=function(r){var t=this;return r.forEach(function(r){return t.register(r)}),this.store},r.prototype.register=function(r){return this.store.set(r._type,r),this},r.prototype.unregister=function(r){return this.store.delete(r._type),this},r.prototype.get=function(r){return r&&this.store.has(r)?this.store.get(r):null},r}(),dataParserStore=function(){var r=null;return r||(r=new DataParserStore)}();export default dataParserStore;