arrow-express
Advanced tools
Comparing version 2.1.6 to 2.1.7
@@ -45,3 +45,4 @@ import { RouteConfigurator } from "../route/route"; | ||
export declare function Controller<C = unknown, R = unknown>(): ControllerConfiguration<GetFinalControllerContext<C, R>, R>; | ||
type GetFinalControllerContext<Context, RootContext> = Context extends unknown ? RootContext : Context; | ||
type GetFinalControllerContext<Context, RootContext> = IsUnknown<Context> extends true ? RootContext : Context; | ||
type IsUnknown<T> = unknown extends T ? (T extends unknown ? true : false) : false; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { User } from '../entities/user.entity'; | ||
import { User } from "../entities/user.entity"; | ||
@@ -6,23 +6,20 @@ /** | ||
*/ | ||
let stubUser: User = { | ||
id: 1, mail: "example@example.com", password_hash: "hash", role: "admin", user_name: "administrator" | ||
} | ||
const stubUser: User = { | ||
id: 1, | ||
mail: "example@example.com", | ||
password_hash: "hash", | ||
role: "admin", | ||
user_name: "administrator", | ||
}; | ||
export class UserService { | ||
constructor () { | ||
} | ||
async getUserById(id: number): Promise<User> { | ||
if (id === stubUser.id) return stubUser; | ||
else return null; | ||
} | ||
async getUserById(id: number): Promise<User> { | ||
if (id === stubUser.id) | ||
return stubUser; | ||
else | ||
return null; | ||
} | ||
async getUserByEmail(mail: string): Promise<User> { | ||
if (mail === stubUser.mail) | ||
return stubUser; | ||
else | ||
return null; | ||
} | ||
async getUserByEmail(mail: string): Promise<User> { | ||
if (mail === stubUser.mail) return stubUser; | ||
else return null; | ||
} | ||
} |
@@ -89,2 +89,3 @@ import { RouteConfigurator } from "../route/route"; | ||
type GetFinalControllerContext<Context, RootContext> = Context extends unknown ? RootContext : Context; | ||
type GetFinalControllerContext<Context, RootContext> = IsUnknown<Context> extends true ? RootContext : Context; | ||
type IsUnknown<T> = unknown extends T ? (T extends unknown ? true : false) : false; |
{ | ||
"name": "arrow-express", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"description": "Library to bootstrap express applications with zero configuration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
800012