const conditionValueFactories = { } ; export class Registration { type : string ; constructor ( type , factory ) { conditionValueFactories [ type ] = factory ; this . type = type ; } static register ( type , factory ) { return new Registration ( type , factory ) ; } static conditionValueFrom ( obj ) { return conditionValueFactories [ obj . type ] ( obj ) ; } }