From efbf2e4084d01f3b63938ccab3d3d147376c0bed Mon Sep 17 00:00:00 2001 From: KillerBossOriginal Date: Wed, 3 Jul 2024 16:38:18 +0200 Subject: [PATCH] Aggiunto supporto per i nuovi identifier --- src/types/IdentifierType.ts | 4 ++++ src/utils/IdentifierConstructor.ts | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/types/IdentifierType.ts create mode 100644 src/utils/IdentifierConstructor.ts 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