diff --git a/uuid/deno.json b/uuid/deno.json index 6851ad333..637e5eeda 100644 --- a/uuid/deno.json +++ b/uuid/deno.json @@ -9,6 +9,6 @@ "./v3": "./v3.ts", "./v4": "./v4.ts", "./v5": "./v5.ts", - "./v7": "./v7.ts" + "./unstable-v7": "./unstable_v7.ts" } } diff --git a/uuid/mod.ts b/uuid/mod.ts index 4dcb3006d..286207dfe 100644 --- a/uuid/mod.ts +++ b/uuid/mod.ts @@ -33,11 +33,6 @@ import { generate as generateV1, validate as validateV1 } from "./v1.ts"; import { generate as generateV3, validate as validateV3 } from "./v3.ts"; import { validate as validateV4 } from "./v4.ts"; import { generate as generateV5, validate as validateV5 } from "./v5.ts"; -import { - extractTimestamp as extractTimestampV7, - generate as generateV7, - validate as validateV7, -} from "./v7.ts"; /** * Generator and validator for @@ -111,24 +106,3 @@ export const v5 = { generate: generateV5, validate: validateV5, }; - -/** - * Generator and validator for - * {@link https://www.rfc-editor.org/rfc/rfc9562.html#section-5.7 | UUIDv7}. - * - * @experimental **UNSTABLE**: New API, yet to be vetted. - * - * @example Usage - * ```ts - * import { v7 } from "@std/uuid"; - * import { assert } from "@std/assert"; - * - * const uuid = v7.generate(); - * assert(v7.validate(uuid)); - * ``` - */ -export const v7 = { - generate: generateV7, - validate: validateV7, - extractTimestamp: extractTimestampV7, -}; diff --git a/uuid/v7.ts b/uuid/unstable_v7.ts similarity index 94% rename from uuid/v7.ts rename to uuid/unstable_v7.ts index b773e48f1..475bd3358 100644 --- a/uuid/v7.ts +++ b/uuid/unstable_v7.ts @@ -10,7 +10,7 @@ * * @example * ```ts - * import { generate, validate, extractTimestamp } from "@std/uuid/v7"; + * import { generate, validate, extractTimestamp } from "@std/uuid/unstable-v7"; * import { assert, assertEquals } from "@std/assert"; * * const uuid = generate(); @@ -37,7 +37,7 @@ const UUID_RE = * * @example Usage * ```ts - * import { validate } from "@std/uuid/v7"; + * import { validate } from "@std/uuid/unstable-v7"; * import { assert, assertFalse } from "@std/assert"; * * assert(validate("017f22e2-79b0-7cc3-98c4-dc0c0c07398f")); @@ -61,7 +61,7 @@ export function validate(id: string): boolean { * * @example Usage * ```ts - * import { generate, validate } from "@std/uuid/v7"; + * import { generate, validate } from "@std/uuid/unstable-v7"; * import { assert } from "@std/assert"; * * const uuid = generate(); @@ -98,7 +98,7 @@ export function generate(timestamp: number = Date.now()): string { * * @example Usage * ```ts - * import { extractTimestamp } from "@std/uuid/v7"; + * import { extractTimestamp } from "@std/uuid/unstable-v7"; * import { assertEquals } from "@std/assert"; * * const uuid = "017f22e2-79b0-7cc3-98c4-dc0c0c07398f"; diff --git a/uuid/v7_test.ts b/uuid/unstable_v7_test.ts similarity index 97% rename from uuid/v7_test.ts rename to uuid/unstable_v7_test.ts index 964395b8b..65adf044a 100644 --- a/uuid/v7_test.ts +++ b/uuid/unstable_v7_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assert, assertEquals, assertThrows } from "@std/assert"; -import { extractTimestamp, generate, validate } from "./v7.ts"; +import { extractTimestamp, generate, validate } from "./unstable_v7.ts"; import { stub } from "../testing/mock.ts"; Deno.test("generate() generates a non-empty string", () => {