processor.js
function(type, factory) {
            var key_parameters = {},
                __type = parse_type(type, key_parameters) .toLowerCase();

            // normalize prop name, remove lead '/'
            for(var prop in key_parameters)
            if (prop[0] === '/') {
                key_parameters[prop.slice(1)] = key_parameters[prop];
                delete key_parameters[prop];
            }

            if (__type.length < type.length || Object.keys(key_parameters).length) {
                // type is subtype with parameters, register to processor.subtypes
                key_parameters.__ctr = factory;
                var subtypes_array = this.subtypes[__type] || (this.subtypes[__type] = []);
                subtypes_array.push(key_parameters);
            } else {
                // register as standalone type
                // check name conflict
                if (this[__type])
                    throw new TypeError('Type ' + type + ' already registered!');

                this[__type] = factory;
            }
        }
function(type, factory) {
            var key_parameters = {},
                __type = parse_type(type, key_parameters) .toLowerCase();

            // normalize prop name, remove lead '/'
            for(var prop in key_parameters)
            if (prop[0] === '/') {
                key_parameters[prop.slice(1)] = key_parameters[prop];
                delete key_parameters[prop];
            }

            if (__type.length < type.length || Object.keys(key_parameters).length) {
                // type is subtype with parameters, register to processor.subtypes
                key_parameters.__ctr = factory;
                var subtypes_array = this.subtypes[__type] || (this.subtypes[__type] = []);
                subtypes_array.push(key_parameters);
            } else {
                // register as standalone type
                // check name conflict
                if (this[__type])
                    throw new TypeError('Type ' + type + ' already registered!');

                this[__type] = factory;
            }
        }
function ( type , factory ) { var key_parameters = { } , __type = parse_type ( type , key_parameters ) . toLowerCase ( ) ; // normalize prop name, remove lead '/' for ( var prop in key_parameters ) if ( prop [ 0 ] === '/' ) { key_parameters [ prop . slice ( 1 ) ] = key_parameters [ prop ] ; delete key_parameters [ prop ] ; } if ( __type . length < type . length || Object . keys ( key_parameters ) . length ) { // type is subtype with parameters, register to processor.subtypes key_parameters . __ctr = factory ; var subtypes_array = this . subtypes [ __type ] || ( this . subtypes [ __type ] = [ ] ) ; subtypes_array . push ( key_parameters ) ; } else { // register as standalone type // check name conflict if ( this [ __type ] ) throw new TypeError ( 'Type ' + type + ' already registered!' ) ; this [ __type ] = factory ; } }
Register factory function in the processor library

@param {string} type Type string can include namespace, type and optional parameters.
@param {function} factory Object or value factory function
@returns {undefined} no returns value
Register factory function in the processor library