2020-10-01 05:40:40 -04:00
|
|
|
// Based on https://github.com/kelektiv/node-uuid -> https://www.ietf.org/rfc/rfc4122.txt
|
|
|
|
// Supporting Support for RFC4122 version 1, 4, and 5 UUIDs
|
2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2020-04-15 10:38:05 -04:00
|
|
|
import * as v1 from "./v1.ts";
|
2019-12-23 04:36:25 -05:00
|
|
|
import * as v4 from "./v4.ts";
|
2020-04-27 08:49:34 -04:00
|
|
|
import * as v5 from "./v5.ts";
|
2019-07-03 11:13:22 -04:00
|
|
|
|
|
|
|
export const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
|
|
|
2020-10-01 05:40:40 -04:00
|
|
|
/**
|
|
|
|
* Checks if UUID is nil
|
|
|
|
* @param val UUID value
|
|
|
|
*/
|
2019-07-03 11:13:22 -04:00
|
|
|
export function isNil(val: string): boolean {
|
|
|
|
return val === NIL_UUID;
|
|
|
|
}
|
|
|
|
|
2020-04-27 08:49:34 -04:00
|
|
|
export { v1, v4, v5 };
|