UNPKG

@chartshq/datamodel

Version:

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

1 lines 806 B
import{DSVStringConverter,DSVArrayConverter,JSONConverter,AutoDataConverter}from"./index";var DataConverterStore=function(){function t(){this.store=new Map,this.converters(this._getDefaultConverters())}return t.prototype._getDefaultConverters=function(){return[new DSVStringConverter,new DSVArrayConverter,new JSONConverter,new AutoDataConverter]},t.prototype.converters=function(t){var e=this;return t.forEach(function(t){return e.store.set(t._type,t)}),this.store},t.prototype.register=function(t){return this.store.set(t._type,t),this},t.prototype.unregister=function(t){return this.store.delete(t._type),this},t.prototype.get=function(t){return t&&this.store.has(t)?this.store.get(t):null},t}(),converterStore=function(){var t=null;return t||(t=new DataConverterStore)}();export default converterStore;