1.0.11 • Published 2 years ago

@incidentiq/guid-typescript v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Guid Typescript

Guid Typescript is a library that lets you generate guid code

Installation and usage

Installation

npm i guid-typescript --save

Basic usage

import { Guid } from "guid-typescript";

export class Example {
    public id: Guid;
    constructor() {
        this.id = Guid.create(); // ==> b77d409a-10cd-4a47-8e94-b0cd0ab50aa1
    }
}

Props and Methods

Method/PropDescriptionTestStatus
static isGuid (guid: any): booleanCheck if value is a guid codeOKReady
static create ( ): GuidCreate a new guidOKReady
static createEmpty ( ): GuidCreate an empty guidOKReady
static parse (guid: string): GuidCreates a guid instance from a given guid as stringOKReady
static raw ( ): stringCreate a guid code in string formatOKReady
equals (other: Guid): booleanCompare a guid codeOKReady
isEmpty ( ): booleanValidate if a guid is emptyOKReady
toString ( ): stringParse a guid instance to string formatOKReady
toJSON ( ): anyParse to JSON formatOKReady