From ac2347f364fdb7a18616a1ee7c9bacf938ac9a1f Mon Sep 17 00:00:00 2001 From: Ben Asher Date: Thu, 29 Feb 2024 19:29:48 -0800 Subject: [PATCH] Add named exports for main classes --- lib/2019.ts | 3 ++- lib/2020.ts | 3 ++- lib/ajv.ts | 3 ++- lib/jtd.ts | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/2019.ts b/lib/2019.ts index 45a3fa535..3f7194f1b 100644 --- a/lib/2019.ts +++ b/lib/2019.ts @@ -10,7 +10,7 @@ import addMetaSchema2019 from "./refs/json-schema-2019-09" const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema" -class Ajv2019 extends AjvCore { +export class Ajv2019 extends AjvCore { constructor(opts: Options = {}) { super({ ...opts, @@ -44,6 +44,7 @@ class Ajv2019 extends AjvCore { } module.exports = exports = Ajv2019 +module.exports.Ajv2019 = Ajv2019 Object.defineProperty(exports, "__esModule", {value: true}) export default Ajv2019 diff --git a/lib/2020.ts b/lib/2020.ts index afbdda200..cfb36af9d 100644 --- a/lib/2020.ts +++ b/lib/2020.ts @@ -7,7 +7,7 @@ import addMetaSchema2020 from "./refs/json-schema-2020-12" const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema" -class Ajv2020 extends AjvCore { +export class Ajv2020 extends AjvCore { constructor(opts: Options = {}) { super({ ...opts, @@ -38,6 +38,7 @@ class Ajv2020 extends AjvCore { } module.exports = exports = Ajv2020 +module.exports.Ajv2020 = Ajv2020 Object.defineProperty(exports, "__esModule", {value: true}) export default Ajv2020 diff --git a/lib/ajv.ts b/lib/ajv.ts index 7f87c8aea..8275b93a8 100644 --- a/lib/ajv.ts +++ b/lib/ajv.ts @@ -8,7 +8,7 @@ const META_SUPPORT_DATA = ["/properties"] const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema" -class Ajv extends AjvCore { +export class Ajv extends AjvCore { _addVocabularies(): void { super._addVocabularies() draft7Vocabularies.forEach((v) => this.addVocabulary(v)) @@ -32,6 +32,7 @@ class Ajv extends AjvCore { } module.exports = exports = Ajv +module.exports.Ajv = Ajv Object.defineProperty(exports, "__esModule", {value: true}) export default Ajv diff --git a/lib/jtd.ts b/lib/jtd.ts index 96eb7b9dc..a7e7bce3b 100644 --- a/lib/jtd.ts +++ b/lib/jtd.ts @@ -35,7 +35,7 @@ type JTDOptions = CurrentOptions & { multipleOfPrecision?: never } -class Ajv extends AjvCore { +export class Ajv extends AjvCore { constructor(opts: JTDOptions = {}) { super({ ...opts, @@ -93,6 +93,7 @@ class Ajv extends AjvCore { } module.exports = exports = Ajv +module.exports.Ajv = Ajv Object.defineProperty(exports, "__esModule", {value: true}) export default Ajv