Table of Contents

Documentation / Guid

Guid

Classes

Guid

Represents a Guid according to the http://www.ietf.org/rfc/rfc4122.txt

Export

Guid

Implements

Constructors

new Guid()

new Guid(bytes): Guid

Initializes a new instance of the {Guid} class.

Parameters
bytes

The 16 bytes that represents a {Guid}.

number[] | Uint8Array<ArrayBufferLike>

Returns

Guid

Defined in

Guid.ts:38

Properties

bytes

readonly bytes: number[] | Uint8Array<ArrayBufferLike>

The 16 bytes that represents a {Guid}.

Defined in

Guid.ts:38

empty

readonly static empty: Guid

Gets an empty {Guid}

Defined in

Guid.ts:29

Methods

equals()

equals(other): boolean

Check whether this is equal to other.

Parameters
other

object

Returns

boolean

Implementation of

IEquatable.equals

Defined in

Guid.ts:122

toJSON()

toJSON(): string

Converts the {Guid} to a string that works in JSON serialization.

Returns

string

Defined in

Guid.ts:143

toString()

toString(): string

Return a string representation of the {Guid} in the format: 00000000-0000-0000-0000-000000000000

Returns

string

Defined in

Guid.ts:135

as()

static as<T>(input): T

Parses if the type is a string parse, otherwise pass through the input as desired output type.

Type Parameters

T extends Guid = Guid

Type to handle for

Parameters
input

String or the generic type.

string | T

Returns

T

identifier Parsed or passed through

Defined in

Guid.ts:112

create()

static create(): Guid

Create a new {Guid}

Returns

Guid

Defined in

Guid.ts:55

isGuid()

static isGuid(value): boolean

Check if a string is a valid {Guid}

Parameters
value

string

Value to check.

Returns

boolean

True if it is, false if not.

Defined in

Guid.ts:102

parse()

static parse(guid): Guid

Parses a string and turns it into a {Guid}.

Parameters
guid

string

String representation of guid.

Returns

Guid

Defined in

Guid.ts:87