Skip to content

Add modern ESM Support #74

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
48 changes: 24 additions & 24 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
export { compileSchema } from "./src/compileSchema";
export type { CompileOptions } from "./src/compileSchema";
export type { Context, SchemaNode, GetNodeOptions, ValidateReturnType } from "./src/SchemaNode";
export type { DataNode } from "./src/methods/toDataNodes";
export type { Draft, DraftVersion } from "./src/Draft";
export type { JsonError, JsonPointer, JsonSchema, OptionalNodeOrError, NodeOrError } from "./src/types";
export type { Keyword, ValidationPath, JsonSchemaReducerParams, JsonSchemaReducer, JsonSchemaResolverParams, JsonSchemaResolver, JsonSchemaValidatorParams, JsonSchemaValidator } from "./src/Keyword";
export { draft04 } from "./src/draft04";
export { draft06 } from "./src/draft06";
export { draft07 } from "./src/draft07";
export { draft2019 } from "./src/draft2019";
export { draft2020 } from "./src/draft2020";
export { draftEditor } from "./src/draftEditor";
export { oneOfFuzzyKeyword, oneOfKeyword } from "./src/keywords/oneOf";
export { render } from "./src/errors/render";
export type { ErrorData, ErrorConfig } from "./src/types";
export { getTypeOf } from "./src/utils/getTypeOf";
export { isReduceable } from "./src/SchemaNode";
export { isJsonError, isSchemaNode } from "./src/types";
export { extendDraft, addKeywords } from "./src/Draft";
export { mergeNode } from "./src/mergeNode";
export { mergeSchema } from "./src/utils/mergeSchema";
export { getSchemaType } from "./src/utils/getSchemaType";
export { remotes } from "./remotes";
export { compileSchema } from "./src/compileSchema.js";
export type { CompileOptions } from "./src/compileSchema.js";
export type { Context, SchemaNode, GetNodeOptions, ValidateReturnType } from "./src/SchemaNode.js";
export type { DataNode } from "./src/methods/toDataNodes.js";
export type { Draft, DraftVersion } from "./src/Draft.js";
export type { JsonError, JsonPointer, JsonSchema, OptionalNodeOrError, NodeOrError } from "./src/types.js";
export type { Keyword, ValidationPath, JsonSchemaReducerParams, JsonSchemaReducer, JsonSchemaResolverParams, JsonSchemaResolver, JsonSchemaValidatorParams, JsonSchemaValidator } from "./src/Keyword.js";
export { draft04 } from "./src/draft04.js";
export { draft06 } from "./src/draft06.js";
export { draft07 } from "./src/draft07.js";
export { draft2019 } from "./src/draft2019.js";
export { draft2020 } from "./src/draft2020.js";
export { draftEditor } from "./src/draftEditor.js";
export { oneOfFuzzyKeyword, oneOfKeyword } from "./src/keywords/oneOf.js";
export { render } from "./src/errors/render.js";
export type { ErrorData, ErrorConfig } from "./src/types.js";
export { getTypeOf } from "./src/utils/getTypeOf.js";
export { isReduceable } from "./src/SchemaNode.js";
export { isJsonError, isSchemaNode } from "./src/types.js";
export { extendDraft, addKeywords } from "./src/Draft.js";
export { mergeNode } from "./src/mergeNode.js";
export { mergeSchema } from "./src/utils/mergeSchema.js";
export { getSchemaType } from "./src/utils/getSchemaType.js";
export { remotes } from "./remotes/index.js";
2 changes: 1 addition & 1 deletion dist/jsonSchemaLibrary.js

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions dist/module/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
export { compileSchema } from "./src/compileSchema";
export { compileSchema } from "./src/compileSchema.js";
// drafts
export { draft04 } from "./src/draft04";
export { draft06 } from "./src/draft06";
export { draft07 } from "./src/draft07";
export { draft2019 } from "./src/draft2019";
export { draft2020 } from "./src/draft2020";
export { draftEditor } from "./src/draftEditor";
export { draft04 } from "./src/draft04.js";
export { draft06 } from "./src/draft06.js";
export { draft07 } from "./src/draft07.js";
export { draft2019 } from "./src/draft2019.js";
export { draft2020 } from "./src/draft2020.js";
export { draftEditor } from "./src/draftEditor.js";
// keywords
export { oneOfFuzzyKeyword, oneOfKeyword } from "./src/keywords/oneOf";
export { oneOfFuzzyKeyword, oneOfKeyword } from "./src/keywords/oneOf.js";
// errors
export { render } from "./src/errors/render";
export { render } from "./src/errors/render.js";
// utilities
export { getTypeOf } from "./src/utils/getTypeOf";
export { isReduceable } from "./src/SchemaNode";
export { isJsonError, isSchemaNode } from "./src/types";
export { extendDraft, addKeywords } from "./src/Draft";
export { mergeNode } from "./src/mergeNode";
export { mergeSchema } from "./src/utils/mergeSchema";
export { getSchemaType } from "./src/utils/getSchemaType";
export { getTypeOf } from "./src/utils/getTypeOf.js";
export { isReduceable } from "./src/SchemaNode.js";
export { isJsonError, isSchemaNode } from "./src/types.js";
export { extendDraft, addKeywords } from "./src/Draft.js";
export { mergeNode } from "./src/mergeNode.js";
export { mergeSchema } from "./src/utils/mergeSchema.js";
export { getSchemaType } from "./src/utils/getSchemaType.js";
// remotes
export { remotes } from "./remotes";
export { remotes } from "./remotes/index.js";
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"id": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Core schema meta-schema",
Expand Down Expand Up @@ -147,4 +147,4 @@
"exclusiveMinimum": ["minimum"]
},
"default": {}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "http://json-schema.org/draft-06/schema#",
"title": "Core schema meta-schema",
Expand Down Expand Up @@ -152,4 +152,4 @@
"not": { "$ref": "#" }
},
"default": {}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://json-schema.org/draft-07/schema#",
"title": "Core schema meta-schema",
Expand Down Expand Up @@ -152,4 +152,4 @@
"not": { "$ref": "#" }
},
"default": true
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/schema",
"$vocabulary": {
Expand Down Expand Up @@ -38,4 +38,4 @@
}
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/applicator",
"$recursiveAnchor": true,
Expand Down Expand Up @@ -49,4 +49,4 @@
"items": { "$recursiveRef": "#" }
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/content",
"$recursiveAnchor": true,
Expand All @@ -9,4 +9,4 @@
"contentEncoding": { "type": "string" },
"contentSchema": { "$recursiveRef": "#" }
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/core",
"$recursiveAnchor": true,
Expand Down Expand Up @@ -50,4 +50,4 @@
"default": {}
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/format",
"$recursiveAnchor": true,
Expand All @@ -7,4 +7,4 @@
"properties": {
"format": { "type": "string" }
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/meta-data",
"$recursiveAnchor": true,
Expand Down Expand Up @@ -29,4 +29,4 @@
"items": true
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/validation",
"$recursiveAnchor": true,
Expand Down Expand Up @@ -91,4 +91,4 @@
"default": []
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/schema",
"$vocabulary": {
Expand Down Expand Up @@ -51,4 +51,4 @@
"deprecated": true
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/applicator",
"$dynamicAnchor": "meta",
Expand Down Expand Up @@ -41,4 +41,4 @@
"items": { "$dynamicRef": "#meta" }
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/content",
"$dynamicAnchor": "meta",
Expand All @@ -9,4 +9,4 @@
"contentMediaType": { "type": "string" },
"contentSchema": { "$dynamicRef": "#meta" }
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/core",
"$dynamicAnchor": "meta",
Expand Down Expand Up @@ -44,4 +44,4 @@
"format": "uri-reference"
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
"$dynamicAnchor": "meta",
Expand All @@ -7,4 +7,4 @@
"properties": {
"format": { "type": "string" }
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
"$dynamicAnchor": "meta",
Expand All @@ -7,4 +7,4 @@
"properties": {
"format": { "type": "string" }
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
"$dynamicAnchor": "meta",
Expand Down Expand Up @@ -29,4 +29,4 @@
"items": true
}
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
"$dynamicAnchor": "meta",
Expand All @@ -8,4 +8,4 @@
"unevaluatedItems": { "$dynamicRef": "#meta" },
"unevaluatedProperties": { "$dynamicRef": "#meta" }
}
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/validation",
"$dynamicAnchor": "meta",
Expand Down Expand Up @@ -83,4 +83,4 @@
"default": []
}
}
}
};
38 changes: 19 additions & 19 deletions dist/module/remotes/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import draft04Meta from "./draft04.json";
import draft06Meta from "./draft06.json";
import draft07Meta from "./draft07.json";
import draft2019Meta from "./draft2019-09.json";
import draft2019MetaApplicator from "./draft2019-09_meta_applicator.json";
import draft2019MetaContent from "./draft2019-09_meta_content.json";
import draft2019MetaCore from "./draft2019-09_meta_core.json";
import draft2019MetaFormat from "./draft2019-09_meta_format.json";
import draft2019MetaMetaData from "./draft2019-09_meta_meta-data.json";
import draft2019MetaValidation from "./draft2019-09_meta_validation.json";
import draft2020Meta from "./draft2020-12.json";
import draft2020MetaApplicator from "./draft2020-12_meta_applicator.json";
import draft2020MetaContent from "./draft2020-12_meta_content.json";
import draft2020MetaCore from "./draft2020-12_meta_core.json";
import draft2020MetaFormatAnnotation from "./draft2020-12_meta_format_annotation.json";
import draft2020MetaFormatAssertion from "./draft2020-12_meta_format_assertion.json";
import draft2020MetaMetaData from "./draft2020-12_meta_meta_data.json";
import draft2020MetaUnevaluated from "./draft2020-12_meta_unevaluated.json";
import draft2020MetaValidation from "./draft2020-12_meta_validation.json";
import draft04Meta from "./draft04.js";
import draft06Meta from "./draft06.js";
import draft07Meta from "./draft07.js";
import draft2019Meta from "./draft2019-09.js";
import draft2019MetaApplicator from "./draft2019-09_meta_applicator.js";
import draft2019MetaContent from "./draft2019-09_meta_content.js";
import draft2019MetaCore from "./draft2019-09_meta_core.js";
import draft2019MetaFormat from "./draft2019-09_meta_format.js";
import draft2019MetaMetaData from "./draft2019-09_meta_meta-data.js";
import draft2019MetaValidation from "./draft2019-09_meta_validation.js";
import draft2020Meta from "./draft2020-12.js";
import draft2020MetaApplicator from "./draft2020-12_meta_applicator.js";
import draft2020MetaContent from "./draft2020-12_meta_content.js";
import draft2020MetaCore from "./draft2020-12_meta_core.js";
import draft2020MetaFormatAnnotation from "./draft2020-12_meta_format_annotation.js";
import draft2020MetaFormatAssertion from "./draft2020-12_meta_format_assertion.js";
import draft2020MetaMetaData from "./draft2020-12_meta_meta_data.js";
import draft2020MetaUnevaluated from "./draft2020-12_meta_unevaluated.js";
import draft2020MetaValidation from "./draft2020-12_meta_validation.js";
/** remote meta-schema stored by schema $id */
const remotes = {};
[
Expand Down
2 changes: 1 addition & 1 deletion dist/module/src/Draft.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { copyDraft } from "./utils/copyDraft";
import { copyDraft } from "./utils/copyDraft.js";
export function extendDraft(draft, extension) {
var _a, _b, _c;
const { keywords } = addKeywords(draft, ...((_a = extension.keywords) !== null && _a !== void 0 ? _a : []));
Expand Down
Loading