test schmest
This commit is contained in:
		
							
								
								
									
										2
									
								
								dist/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -7,7 +7,7 @@ export default class Flummpress {
 | 
			
		||||
    private middleware;
 | 
			
		||||
    router: Router;
 | 
			
		||||
    constructor();
 | 
			
		||||
    use<T>(nameOrRouter: string | Router, factory?: () => T): this;
 | 
			
		||||
    use<T>(plugin: string | Router | Handler, factory?: () => T): this;
 | 
			
		||||
    resolve<T>(name: string): T;
 | 
			
		||||
    private processPipeline;
 | 
			
		||||
    listen(...args: any[]): this;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							@@ -20,11 +20,13 @@ export default class Flummpress {
 | 
			
		||||
        this.router = new Router();
 | 
			
		||||
        this.middleware = [];
 | 
			
		||||
    }
 | 
			
		||||
    use(nameOrRouter, factory) {
 | 
			
		||||
        if (typeof nameOrRouter === "string" && factory)
 | 
			
		||||
            this.container.register(nameOrRouter, factory);
 | 
			
		||||
        else if (nameOrRouter instanceof Router)
 | 
			
		||||
            this.router.use(nameOrRouter);
 | 
			
		||||
    use(plugin, factory) {
 | 
			
		||||
        if (typeof plugin === "string" && factory)
 | 
			
		||||
            this.container.register(plugin, factory);
 | 
			
		||||
        else if (plugin instanceof Router)
 | 
			
		||||
            this.router.use(plugin);
 | 
			
		||||
        else if (typeof plugin === "function")
 | 
			
		||||
            this.middleware.push(plugin);
 | 
			
		||||
        else
 | 
			
		||||
            throw new TypeError("Invalid arguments provided to use()");
 | 
			
		||||
        return this;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								src/index.ts
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/index.ts
									
									
									
									
									
								
							@@ -20,19 +20,13 @@ export default class Flummpress {
 | 
			
		||||
    this.middleware = [];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /*public use(plugin: Router | Handler): this {
 | 
			
		||||
    if(plugin instanceof Router)
 | 
			
		||||
  public use<T>(plugin: string | Router | Handler, factory?: () => T): this {
 | 
			
		||||
    if(typeof plugin === "string" && factory)
 | 
			
		||||
      this.container.register(plugin, factory);
 | 
			
		||||
    else if(plugin instanceof Router)
 | 
			
		||||
      this.router.use(plugin);
 | 
			
		||||
    else if(typeof plugin === "function")
 | 
			
		||||
      this.middleware.push(plugin);
 | 
			
		||||
    return this;
 | 
			
		||||
  }*/
 | 
			
		||||
 | 
			
		||||
  public use<T>(nameOrRouter: string | Router, factory?: () => T): this {
 | 
			
		||||
    if(typeof nameOrRouter === "string" && factory)
 | 
			
		||||
      this.container.register(nameOrRouter, factory);
 | 
			
		||||
    else if(nameOrRouter instanceof Router)
 | 
			
		||||
      this.router.use(nameOrRouter);
 | 
			
		||||
    else
 | 
			
		||||
      throw new TypeError("Invalid arguments provided to use()");
 | 
			
		||||
    return this;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user