diff --git a/_tools/check_docs.ts b/_tools/check_docs.ts index 4e4c8ad1fe12..cb9e376f916c 100644 --- a/_tools/check_docs.ts +++ b/_tools/check_docs.ts @@ -48,6 +48,7 @@ const ENTRY_POINTS = [ "../encoding/unstable_base64_stream.ts", "../encoding/unstable_base32hex_stream.ts", "../encoding/unstable_base32_stream.ts", + "../encoding/unstable_base64url_stream.ts", "../encoding/unstable_base32hex_stream.ts", "../encoding/unstable_hex_stream.ts", "../expect/mod.ts", diff --git a/encoding/deno.json b/encoding/deno.json index 20105f69777e..c54a1a92b173 100644 --- a/encoding/deno.json +++ b/encoding/deno.json @@ -12,7 +12,7 @@ "./base64": "./base64.ts", "./unstable-base64-stream": "./unstable_base64_stream.ts", "./base64url": "./base64url.ts", - "./base64url-stream": "./base64url_stream.ts", + "./unstable-base64url-stream": "./unstable_base64url_stream.ts", "./hex": "./hex.ts", "./unstable-hex-stream": "./unstable_hex_stream.ts", "./varint": "./varint.ts" diff --git a/encoding/mod.ts b/encoding/mod.ts index a7bc712f4ea3..2aa739c609e2 100644 --- a/encoding/mod.ts +++ b/encoding/mod.ts @@ -20,6 +20,5 @@ export * from "./base32.ts"; export * from "./base58.ts"; export * from "./base64.ts"; export * from "./base64url.ts"; -export * from "./base64url_stream.ts"; export * from "./hex.ts"; export * from "./varint.ts"; diff --git a/encoding/base64url_stream.ts b/encoding/unstable_base64url_stream.ts similarity index 83% rename from encoding/base64url_stream.ts rename to encoding/unstable_base64url_stream.ts index a4d1945a9227..83328382bffe 100644 --- a/encoding/base64url_stream.ts +++ b/encoding/unstable_base64url_stream.ts @@ -4,6 +4,18 @@ /** * Utilities for encoding and decoding to and from base64url in a streaming manner. * + * ```ts + * import { assertEquals } from "@std/assert"; + * import { Base64UrlDecoderStream } from "@std/encoding/unstable-base64url-stream"; + * import { toText } from "@std/streams/to-text"; + * + * const stream = ReadableStream.from(["SGVsbG8s", "IHdvcmxkIQ"]) + * .pipeThrough(new Base64UrlDecoderStream()) + * .pipeThrough(new TextDecoderStream()); + * + * assertEquals(await toText(stream), "Hello, world!"); + * ``` + * * @experimental **UNSTABLE**: New API, yet to be vetted. * * @module @@ -22,7 +34,7 @@ import { decodeBase64Url, encodeBase64Url } from "./base64url.ts"; * ```ts * import { assertEquals } from "@std/assert"; * import { encodeBase64Url } from "@std/encoding/base64url"; - * import { Base64UrlEncoderStream } from "@std/encoding/base64url-stream"; + * import { Base64UrlEncoderStream } from "@std/encoding/unstable-base64url-stream"; * import { toText } from "@std/streams/to-text"; * * const stream = ReadableStream.from(["Hello,", " world!"]) @@ -68,7 +80,7 @@ export class Base64UrlEncoderStream * ```ts * import { assertEquals } from "@std/assert"; * import { encodeBase64Url } from "@std/encoding/base64url"; - * import { Base64UrlDecoderStream } from "@std/encoding/base64url-stream"; + * import { Base64UrlDecoderStream } from "@std/encoding/unstable-base64url-stream"; * import { toText } from "@std/streams/to-text"; * * const stream = ReadableStream.from(["SGVsbG8s", "IHdvcmxkIQ"]) diff --git a/encoding/base64url_stream_test.ts b/encoding/unstable_base64url_stream_test.ts similarity index 96% rename from encoding/base64url_stream_test.ts rename to encoding/unstable_base64url_stream_test.ts index 9a9e90723be5..32e0b9321089 100644 --- a/encoding/base64url_stream_test.ts +++ b/encoding/unstable_base64url_stream_test.ts @@ -5,7 +5,7 @@ import { encodeBase64Url } from "./base64url.ts"; import { Base64UrlDecoderStream, Base64UrlEncoderStream, -} from "./base64url_stream.ts"; +} from "./unstable_base64url_stream.ts"; import { RandomSliceStream } from "./_random_slice_stream.ts"; import { toText } from "@std/streams/to-text"; import { concat } from "@std/bytes/concat";