Aggiunto supporto per i nuovi identifier
This commit is contained in:
parent
a1dd37d444
commit
efbf2e4084
2 changed files with 23 additions and 0 deletions
4
src/types/IdentifierType.ts
Normal file
4
src/types/IdentifierType.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export enum IdentifierType {
|
||||
DISCORD = "DISCORD",
|
||||
EMAIL = "EMAIL"
|
||||
}
|
19
src/utils/IdentifierConstructor.ts
Normal file
19
src/utils/IdentifierConstructor.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { IdentifierType } from "../types/IdentifierType";
|
||||
|
||||
export class Identifier {
|
||||
type: IdentifierType;
|
||||
value: string;
|
||||
constructor(type: IdentifierType, value: string) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
}
|
||||
/**
|
||||
* Concatenates the type and value of the Identifier.
|
||||
* This make the Identifier readable from the API parser
|
||||
*
|
||||
* @return {string} The concatenated type and value.
|
||||
*/
|
||||
asString () {
|
||||
return `${this.type}:${this.value}`;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue