diff --git a/json/mod.ts b/json/mod.ts new file mode 100644 index 0000000..7ad3e93 --- /dev/null +++ b/json/mod.ts @@ -0,0 +1 @@ +export * from "./types.ts"; diff --git a/types/json.ts b/json/types.ts similarity index 100% rename from types/json.ts rename to json/types.ts diff --git a/readme.md b/readme.md index aae861b..3727d70 100644 --- a/readme.md +++ b/readme.md @@ -12,6 +12,7 @@ Utility functions, classes, types, and scripts in uncompiled TS, for Deno. - [`script/makeReleaseNotes`](#scriptmakereleasenotes) - [`graph`](#graph) - [`io`](#io) +- [`json`](#json) - [`md`](#md) - [`script/evalCodeBlocks`](#scriptevalcodeblocks) - [`object`](#object) @@ -19,7 +20,6 @@ Utility functions, classes, types, and scripts in uncompiled TS, for Deno. - [`path`](#path) - [`string`](#string) - [`ts`](#ts) -- [`types`](#types) ## `array` @@ -157,6 +157,24 @@ clipboard.copy("foo").catch(console.log); clipboard.paste().catch(console.log); // "foo" ``` +## `json` + +Utility types. + +```ts +import { + JsonArray, + JsonObject, + JsonPrimitive, + JsonValue, +} from "https://deno.land/x/handy/json/types.ts"; + +const a: JsonPrimitive = "some string"; // or number, boolean, null +const b: JsonArray = [1, ["2", true], { a: null }]; +const c: JsonObject = { a: 1, b: ["2", true], d: { e: null } }; +// JsonValue = any of the above +``` + ## `md` Markdown-related utilities. @@ -269,21 +287,3 @@ import { evaluate } from "https://deno.land/x/handy/ts/utils.ts"; await evaluate("console.log('Hello!')") .then((res) => res.stdout); // "Hello!" ``` - -## `types` - -Utility types. - -```ts -import { - JsonArray, - JsonObject, - JsonPrimitive, - JsonValue, -} from "https://deno.land/x/handy/types/json.ts"; - -const a: JsonPrimitive = "some string"; // or number, boolean, null -const b: JsonArray = [1, ["2", true], { a: null }]; -const c: JsonObject = { a: 1, b: ["2", true], d: { e: null } }; -// JsonValue = any of the above -``` diff --git a/types/mod.ts b/types/mod.ts deleted file mode 100644 index 0600fe3..0000000 --- a/types/mod.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./json.ts";