;
@@ -498,7 +548,7 @@ describe("Users Map", () => {
### `assertEquals` + `AssertionError`
```ts
-import "https://deno.land/x/this@0.160.0/testing/asserts.ts";
+import "https://deno.land/x/this@0.160.1/testing/asserts.ts";
Deno.test("Global Assertions", async ({ step }) => {
@@ -516,44 +566,44 @@ Deno.test("Global Assertions", async ({ step }) => {
### **`chai`** (chai.js)
```ts
-import "https://deno.land/x/this@0.160.0/testing/chai.ts";
+import "https://deno.land/x/this@0.160.1/testing/chai.ts";
```
-### **`fc`** (fastcheck)
+### **`fc`**
```ts
-import "https://deno.land/x/this@0.160.0/testing/fc.ts";
+import "https://deno.land/x/this@0.160.1/testing/fc.ts";
```
---
## Contributing
-### ⚠️ Fixing a bug? Create an Issue first
+### ⚠️ Fixing a bug? Create an Issue first
> Unless you're fixing a bug for which an issue already exists!
-This allows the issue to be connected to your Pull Request, creating a permanent record of your contribution to the project. It also makes it easier for maintainers to track project progression.
+This allows the issue to be connected to your Pull Request, creating a permanent record of your contribution to the project. It also helps maintainers with tracking project progression.
Creating an issue also ensures you're given credit for fixing that bug. 😁
---
-### Fork + clone the repository
+### Fork + clone the repository
-> This section assumes you have [**the GitHub CLI**][gh] (you ***really* should**).
+> **Note**: This section assumes you have [**the GitHub CLI**][gh]. You should get it.
```sh
gh repo fork deno911/this --clone
```
-### Create a new branch for your changes
+### Create a new branch for your changes
```sh
git checkout -b fix/typo-in-readme
```
-### Make small changes and concise commits
+### Make small changes and concise commits
```sh
# hack hack hack...
@@ -563,7 +613,7 @@ git commit README.md -m "fix: typos in README.md" && git push
> **Note**: keep the scope of your changes relevant and concise.
-### Open a Pull Request
+### Open a Pull Request
```sh
gh pr create --title "fix: typos in README.md"
@@ -579,14 +629,14 @@ gh pr create --title "fix: typos in README.md"
-The foundation of this module was inspired by [ije/global](https://github.com/ije/global).
+## [🅓🅔🅝🅞⑨①①][deno911]
-### [🅓🅔🅝🅞⑨①①][deno911]
+###### The foundation of this module was inspired by [ije/global][ije].
-[deno.land]: https://deno.land "Deno.land - Official Module Registry"
-[nest.land]: https://nest.land "Nest.land - Immutable Module Registry"
-[Arweave blockchain]: https://arweave.org "Arweave Blockchain"
+[ije]: https://github.com/ije/global "The foundation of this module was inspired by ije/global"
[deno911]: https://github.com/deno911 "Projects by deno911 on GitHub"
[gh]: https://cli.github.com
+[this]: https://deno.land/x/this "View deno911/this on deno.land/x"
+[banner-img]: https://raw.githubusercontent.com/deno911/.github/main/static/this/banner.png "deno911/this - Extend Deno's globals with std/encoding & std/testing tools"
\ No newline at end of file
diff --git a/deps.ts b/deps.ts
index d589d52..17c37c3 100644
--- a/deps.ts
+++ b/deps.ts
@@ -28,11 +28,11 @@ export * as snapshot from "https://deno.land/std@0.160.0/testing/snapshot.ts";
/* ./testing/mock.ts */
export * as mock from "https://deno.land/std@0.160.0/testing/mock.ts";
-/* third-party testing tools */
+/* ./testing/chai.ts - chai@4.3.4 */
export { default as chai } from "https://cdn.skypack.dev/chai@4.3.4?dts";
-export { default as fc } from "https://cdn.skypack.dev/fast-check@v3.1.1?dts";
-/* encoding */
+/* ./testing/fc.ts - fast-check@v3.2.0 */
+export { default as fc } from "https://cdn.skypack.dev/fast-check@v3.2.0?dts";
/* ./encoding/ascii.ts */
export * as ascii85 from "https://deno.land/std@0.160.0/encoding/ascii85.ts";
@@ -64,15 +64,16 @@ export * as FrontMatter from "https://deno.land/std@0.160.0/encoding/front_matte
/* ./encoding/jsonc.ts */
export * as JSONC from "https://deno.land/std@0.160.0/encoding/jsonc.ts";
-/* ./encoding/json5.ts */
+/* ./encoding/json5.ts - json5@1.0.0 */
export { default as JSON5 } from "https://deno.land/x/json5@v1.0.0/mod.ts";
/* ./encoding/jsonstream.ts */
export {
- ConcatenatedJsonParseStream as ConcatenatedJSONParseStream,
- JsonParseStream as JSONParseStream,
- JsonStringifyStream as JSONStringifyStream,
+ ConcatenatedJsonParseStream,
+ JsonParseStream,
+ JsonStringifyStream,
type JsonValue as JSONValue,
+ type JsonValue,
type ParseStreamOptions,
type StringifyStreamOptions,
} from "https://deno.land/std@0.160.0/encoding/json/stream.ts";
diff --git a/encoding/jsonstream.ts b/encoding/jsonstream.ts
index f78e181..be8ada7 100644
--- a/encoding/jsonstream.ts
+++ b/encoding/jsonstream.ts
@@ -3,48 +3,48 @@
///
import {
- ConcatenatedJSONParseStream,
- JSONParseStream,
- JSONStringifyStream,
+ ConcatenatedJsonParseStream,
+ JsonParseStream,
+ JsonStringifyStream,
type ParseStreamOptions,
type StringifyStreamOptions,
} from "../deps.ts";
-type JSONStream = {
- Parse: typeof JSONParseStream;
- Stringify: typeof JSONStringifyStream;
- Concatenated: typeof ConcatenatedJSONParseStream;
+type JsonStream = {
+ Parse: typeof JsonParseStream;
+ Stringify: typeof JsonStringifyStream;
+ Concatenated: typeof ConcatenatedJsonParseStream;
useParse(
{ writableStrategy, readableStrategy }: ParseStreamOptions,
- ): JSONParseStream;
+ ): JsonParseStream;
useStringify({
writableStrategy,
readableStrategy,
prefix,
suffix,
- }: StringifyStreamOptions): JSONStringifyStream;
+ }: StringifyStreamOptions): JsonStringifyStream;
useConcat(
{ writableStrategy, readableStrategy }: ParseStreamOptions,
- ): ConcatenatedJSONParseStream;
+ ): ConcatenatedJsonParseStream;
};
-const JSONStream: JSONStream = {
- Parse: JSONParseStream,
- Stringify: JSONStringifyStream,
- Concatenated: ConcatenatedJSONParseStream,
+const JsonStream: JsonStream = {
+ Parse: JsonParseStream,
+ Stringify: JsonStringifyStream,
+ Concatenated: ConcatenatedJsonParseStream,
useParse({
writableStrategy,
readableStrategy,
- }: ParseStreamOptions = {}): JSONParseStream {
- return new JSONParseStream({ writableStrategy, readableStrategy });
+ }: ParseStreamOptions = {}): JsonParseStream {
+ return new JsonParseStream({ writableStrategy, readableStrategy });
},
useStringify({
writableStrategy,
readableStrategy,
prefix,
suffix,
- }: StringifyStreamOptions = {}): JSONStringifyStream {
- return new JSONStringifyStream({
+ }: StringifyStreamOptions = {}): JsonStringifyStream {
+ return new JsonStringifyStream({
writableStrategy,
readableStrategy,
prefix,
@@ -54,23 +54,20 @@ const JSONStream: JSONStream = {
useConcat({
writableStrategy,
readableStrategy,
- }: ParseStreamOptions = {}): ConcatenatedJSONParseStream {
- return new ConcatenatedJSONParseStream({
+ }: ParseStreamOptions = {}): ConcatenatedJsonParseStream {
+ return new ConcatenatedJsonParseStream({
writableStrategy,
readableStrategy,
});
},
};
+Object.defineProperty(JsonStream, Symbol.toStringTag, { value: "JsonStream" });
+
declare global {
- const JSONStream: JSONStream;
+ const JsonStream: JsonStream;
+ /** @deprecated use {@linkcode JsonStream} instead */
+ const JSONStream: JsonStream;
}
-Object.assign(globalThis, {
- JSONStream: Object.defineProperty(JSONStream, Symbol.toStringTag, {
- value: "JSONStream",
- writable: false,
- enumerable: false,
- configurable: false,
- }),
-});
+Object.assign(globalThis, { JsonStream, JSONStream: JsonStream });