mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 04:11:57 +00:00
chore: Add something
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
export class Origin {
|
||||
constructor(readonly protocol: string, readonly address: string) {}
|
||||
constructor(readonly protocol: string, readonly host: string) {}
|
||||
|
||||
withAuth(
|
||||
origin?:
|
||||
| {
|
||||
password: string;
|
||||
username: string;
|
||||
}
|
||||
| null
|
||||
| undefined
|
||||
) {
|
||||
// prettier-ignore
|
||||
const urlAuth = !!(origin) ? `${origin.username}:${origin.password}@` :
|
||||
'';
|
||||
return `${this.protocol}://${urlAuth}${this.host}`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user