Tag: stream式input

你应该发布你的stream式文件夹到NPM吗?

我想知道是否和在什么条件下,你应该发布你的包flow-typed文件夹NPM。 也许(和我一直在想的)答案从来没有,应用程序开发人员自己使用streamtypes,但flow-typed install可能只是为自己声明的依赖关系提供定义,而不是包内的依赖关系。 所以简而言之,如果你的软件包有非对等streamtypes的依赖关系,我应该发布我的flow-typed文件夹,或者我应该npmignore它?

扩展Flow中的快速请求类

我正在使用Flow构buildnodeJS应用程序,而且我需要扩展Express Request的默认快速注释以适应其他字段,例如.user和.session。 不幸的是,当我尝试这样做,并创build接受这个新的请求types的中间件时,Flow吓了一跳,我不知道我做错了什么。 从stream式inputexpression的原始代码是: declare class express$Request extends http$IncomingMessage mixins express$RequestResponseBase { …. } declare type express$Middleware = ((req: express$Request, res: express$Response, next: express$NextFunction) => mixed) | ((error: ?Error, req: express$Request, res: express$Response, next: express$NextFunction) => mixed); 所以我想我只是扩展快速请求,然后我所有的中间件都应该与新的属性,对不对? declare class web$Request extends express$Request { user: any, isAuthenticated(): boolean, session: { loginForwardUrl: ?string, }, } const […]