Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(json): init; move types/json -> json/types #51

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.