nl_tokens: Load a configuration returning and object with prefilters postfilters and providers middlewares ready to be used .
pl_tokens: function load ( config ) { var configuration = { prefilters : [ ] , providers : [ ] , postfilters : [ ] } ; // Check a valid object if ( typeof config !== "object" ) { throw <mask> InvalidConfiguration ( InvalidConfiguration . EMPTY_MESSAGE ) ; } // Check at least one provider if ( ! config . providers || ! config . providers . length ) { throw new InvalidConfiguration ( InvalidConfiguration . NO_PROVIDER_MESSAGE ) ; } // Load prefilters if ( config . prefilters ) { configuration . prefilters = loadMiddlewareFilters ( config . prefilters ) ; } // Load postfilters if ( config . postfilters ) { configuration . postfilters = loadMiddlewareFilters ( config . postfilters ) ; } // Load providers configuration . providers = loadProviders ( config . providers ) ; return configuration ; }