MCPcopy
hub / github.com/faker-js/faker / uuid

Method uuid

src/modules/string/index.ts:778–794  ·  view source on GitHub ↗
(
    options: {
      version?: 4 | 7;
      refDate?: string | Date | number;
    } = {}
  )

Source from the content-addressed store, hash-verified

776 refDate?: string | Date | number;
777 }): string;
778 uuid(
779 options: {
780 version?: 4 | 7;
781 refDate?: string | Date | number;
782 } = {}
783 ): string {
784 const { version = 4, refDate = this.faker.defaultRefDate() } = options;
785 switch (version) {
786 case 7: {
787 return uuidV7(this.faker, toDate(refDate));
788 }
789
790 default: {
791 return uuidV4(this.faker);
792 }
793 }
794 }
795
796 /**
797 * Returns a ULID ([Universally Unique Lexicographically Sortable Identifier](https://github.com/ulid/spec)).

Callers 3

string.spec.tsFile · 0.80
jwtMethod · 0.80

Calls 4

uuidV7Function · 0.90
toDateFunction · 0.90
uuidV4Function · 0.90
defaultRefDateMethod · 0.80

Tested by

no test coverage detected