Skip to content

Commit 8376e94

Browse files
authored
fix(index): spelling and grammar in error messages (#24)
1 parent 76d2e3c commit 8376e94

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class RefResolver {
230230
if (sourceSchema[key] !== undefined) {
231231
if (deepEqual(sourceSchema[key], targetSchema[key])) continue
232232
throw new Error(
233-
`Cannot resolve ref "${ref.ref}". Property "${key}" is already exist in schema "${ref.sourceSchemaId}".`
233+
`Cannot resolve ref "${ref.ref}". Property "${key}" already exists in schema "${ref.sourceSchemaId}".`
234234
)
235235
}
236236
sourceSchema[key] = targetSchema[key]
@@ -250,7 +250,7 @@ class RefResolver {
250250
#insertSchemaByAnchor (schema, schemaId, anchor) {
251251
const { anchors } = this.#schemas[schemaId]
252252
if (anchors[anchor] !== undefined) {
253-
throw new Error(`There is already another anchor "${anchor}" in a schema "${schemaId}".`)
253+
throw new Error(`There is already another anchor "${anchor}" in schema "${schemaId}".`)
254254
}
255255
anchors[anchor] = schema
256256
}

test/collisions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,6 @@ test('should throw if there is the same anchor in the same schema', () => {
194194
refResolver.addSchema(schema)
195195
assert.fail('should throw')
196196
} catch (err) {
197-
assert.equal(err.message, 'There is already another anchor "#subSchemaId" in a schema "schemaId1".')
197+
assert.equal(err.message, 'There is already another anchor "#subSchemaId" in schema "schemaId1".')
198198
}
199199
})

test/deref-schema.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ test('should throw id source schema has a key with a same key as ref schema, but
4545
} catch (err) {
4646
assert.strictEqual(
4747
err.message,
48-
'Cannot resolve ref "schemaId2". Property "properties" is already exist in schema "schemaId1".'
48+
'Cannot resolve ref "schemaId2". Property "properties" already exists in schema "schemaId1".'
4949
)
5050
}
5151
})

0 commit comments

Comments
 (0)