src/core.js
function registerValueHandler (handlers, type, handler) {
  let typeofType = typeof type;

  if (typeofType !== 'function' && typeofType !== 'string') {
    throw new Error("type must be a class constructor or string");
  }

  if (typeof handler !== 'function') {
    throw new Error("handler must be a function");
  }

  for (let typeHandler of handlers) {
    if (typeHandler.type === type) {
      typeHandler.handler = handler;

      return;
    }
  }

  handlers.push({
    type: type,
    handler: handler,
  });
}
function registerValueHandler (handlers, type, handler) {
  let typeofType = typeof type;

  if (typeofType !== 'function' && typeofType !== 'string') {
    throw new Error("type must be a class constructor or string");
  }

  if (typeof handler !== 'function') {
    throw new Error("handler must be a function");
  }

  for (let typeHandler of handlers) {
    if (typeHandler.type === type) {
      typeHandler.handler = handler;

      return;
    }
  }

  handlers.push({
    type: type,
    handler: handler,
  });
}
function registerValueHandler ( handlers , type , handler ) { let typeofType = typeof type ; if ( typeofType !== 'function' && typeofType !== 'string' ) { throw new Error ( "type must be a class constructor or string" ) ; } if ( typeof handler !== 'function' ) { throw new Error ( "handler must be a function" ) ; } for ( let typeHandler of handlers ) { if ( typeHandler . type === type ) { typeHandler . handler = handler ; return ; } } handlers . push ( { type : type , handler : handler , } ) ; }
Register a value type handler

Note: this will override any existing handler registered for this value type.
Register a value type handler