diff --git a/src/quicktype-core/input/Inputs.ts b/src/quicktype-core/input/Inputs.ts index 50518ee6..d5c398bf 100644 --- a/src/quicktype-core/input/Inputs.ts +++ b/src/quicktype-core/input/Inputs.ts @@ -1,5 +1,5 @@ import * as URI from "urijs"; -import { OrderedMap, OrderedSet, Map, List, Set } from "immutable"; +import { OrderedMap, OrderedSet, List, Set } from "immutable"; import { Ref, @@ -195,7 +195,7 @@ export class JSONSchemaInput implements Input { private _schemaStore: JSONSchemaStore | undefined = undefined; private readonly _attributeProducers: JSONSchemaAttributeProducer[]; - private _schemaInputs: Map = Map(); + private readonly _schemaInputs: Map = new Map(); private _schemaSources: List<[uri.URI, JSONSchemaSourceData]> = List(); private _topLevels: OrderedMap = OrderedMap(); @@ -254,7 +254,7 @@ export class JSONSchemaInput implements Input { assert(uris !== undefined, "URIs must be given if schema source is not specified"); } else { for (const normalizedURI of normalizedURIs) { - this._schemaInputs = this._schemaInputs.set( + this._schemaInputs.set( normalizedURI .clone() .hash("") @@ -273,7 +273,7 @@ export class JSONSchemaInput implements Input { if (this._schemaSources.isEmpty()) return; let maybeSchemaStore = this._schemaStore; - if (this._schemaInputs.isEmpty()) { + if (this._schemaInputs.size === 0) { if (maybeSchemaStore === undefined) { return panic("Must have a schema store to process JSON Schema"); }