Skip to content

Commit

Permalink
feat(json): init; move types/json -> json/types
Browse files Browse the repository at this point in the history
  • Loading branch information
pskfyi committed May 8, 2023
1 parent c67c2be commit d277aa8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
1 change: 1 addition & 0 deletions json/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./types.ts";
File renamed without changes.
38 changes: 19 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ 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)
- [`os`](#os)
- [`path`](#path)
- [`string`](#string)
- [`ts`](#ts)
- [`types`](#types)

## `array`

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
```
1 change: 0 additions & 1 deletion types/mod.ts

This file was deleted.

0 comments on commit d277aa8

Please sign in to comment.