diff --git a/src/types/IdentifierType.ts b/src/types/IdentifierType.ts new file mode 100644 index 0000000..cac5a97 --- /dev/null +++ b/src/types/IdentifierType.ts @@ -0,0 +1,4 @@ +export enum IdentifierType { + DISCORD = "DISCORD", + EMAIL = "EMAIL" +} \ No newline at end of file diff --git a/src/utils/IdentifierConstructor.ts b/src/utils/IdentifierConstructor.ts new file mode 100644 index 0000000..aaed9a7 --- /dev/null +++ b/src/utils/IdentifierConstructor.ts @@ -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}`; + } +} \ No newline at end of file