Message parser

This commit is contained in:
Casper Warden
2017-11-24 01:00:56 +00:00
parent e529b3c993
commit d2ea9ce40b
38 changed files with 15208 additions and 3103 deletions

34
lib/classes/UUID.ts Normal file
View File

@@ -0,0 +1,34 @@
import * as validator from 'validator';
export class UUID
{
private mUUID = '00000000-0000-0000-0000-000000000000';
static zero(): UUID
{
return new UUID();
}
constructor(val?: string)
{
if (val !== undefined)
{
this.setUUID(val);
}
}
public setUUID(val: string): boolean
{
if (validator.isUUID(val, 4))
{
this.mUUID = val;
return true;
}
return false;
}
public toString = (): string =>
{
return this.mUUID;
}
}