Skip to content

Commit 0dd5629

Browse files
committed
And Json type
1 parent 3925e70 commit 0dd5629

File tree

10 files changed

+6
-11
lines changed

10 files changed

+6
-11
lines changed

src/hyperjump/hyperjump.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { JsonCompatible } from "../json/jsonast.d.ts";
22
import type { JrefNode } from "../jref/jref-ast.d.ts";
33
import type { UriSchemePlugin } from "./uri-schemes/uri-scheme-plugin.d.ts";
44
import type { DocumentNode, MediaTypePlugin } from "./media-types/media-type-plugin.d.ts";
5-
import { jsonObjectHas, jsonObjectKeys, jsonTypeOf, jsonValue } from "../json/jsonast-util.js";
5+
import type { jsonObjectHas, jsonObjectKeys, jsonTypeOf, jsonValue } from "../json/jsonast-util.js";
66

77

88
export type HyperjumpConfig = object;

src/hyperjump/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
*/
44

55
export * from "./hyperjump.js";
6-
export * from "./uri-schemes/uri-scheme-plugin.js"; // eslint-disable-line import/export
76
export * from "./uri-schemes/file-scheme-plugin.js";
87
export * from "./uri-schemes/http-scheme-plugin.js";
9-
export * from "./media-types/media-type-plugin.js"; // eslint-disable-line import/export
108
export * from "./media-types/json-media-type-plugin.js";
119
export * from "./media-types/jref-media-type-plugin.js";

src/hyperjump/media-types/media-type-plugin.js

-1
This file was deleted.

src/hyperjump/uri-schemes/uri-scheme-plugin.js

-1
This file was deleted.

src/jref/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from "./jref-ast.js"; // eslint-disable-line import/export
21
export * from "./jref-util.js";
32
export * from "./jref-parse.js";
43
export * from "./jref-stringify.js";

src/jref/jref-ast.js

-1
This file was deleted.

src/json/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from "./jsonast.js"; // eslint-disable-line import/export
21
export * from "./jsonast-util.js";
32
export * from "./rejson-parse.js";
43
export * from "./rejson-stringify.js";

src/json/jsonast-util.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
Json,
23
JsonArrayNode,
34
JsonBooleanNode,
45
JsonCompatible,
@@ -45,8 +46,8 @@ export const jsonValue: (
4546
(<_A>(node: JsonBooleanNode) => boolean) &
4647
(<_A>(node: JsonNumberNode) => number) &
4748
(<_A>(node: JsonStringNode) => string) &
48-
(<A>(node: JsonArrayNode<A>) => unknown[]) &
49-
(<A>(node: JsonObjectNode<A>) => Record<string, unknown>) &
49+
(<A>(node: JsonArrayNode<A>) => Json[]) &
50+
(<A>(node: JsonObjectNode<A>) => Record<string, Json>) &
5051
(<A>(node: JsonCompatible<A>) => unknown)
5152
);
5253

src/json/jsonast.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,5 @@ export type JsonDocumentNode = {
8787
children: JsonNode[];
8888
data?: Data;
8989
};
90+
91+
export type Json = null | boolean | number | string | Json[] | { [property: string]: Json };

src/json/jsonast.js

-1
This file was deleted.

0 commit comments

Comments
 (0)