Skip to content
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

fix(index): spelling and grammar in error messages #24

Merged
merged 1 commit into from
Jan 15, 2025
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class RefResolver {
if (sourceSchema[key] !== undefined) {
if (deepEqual(sourceSchema[key], targetSchema[key])) continue
throw new Error(
`Cannot resolve ref "${ref.ref}". Property "${key}" is already exist in schema "${ref.sourceSchemaId}".`
`Cannot resolve ref "${ref.ref}". Property "${key}" already exists in schema "${ref.sourceSchemaId}".`
)
}
sourceSchema[key] = targetSchema[key]
Expand All @@ -250,7 +250,7 @@ class RefResolver {
#insertSchemaByAnchor (schema, schemaId, anchor) {
const { anchors } = this.#schemas[schemaId]
if (anchors[anchor] !== undefined) {
throw new Error(`There is already another anchor "${anchor}" in a schema "${schemaId}".`)
throw new Error(`There is already another anchor "${anchor}" in schema "${schemaId}".`)
}
anchors[anchor] = schema
}
Expand Down
2 changes: 1 addition & 1 deletion test/collisions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,6 @@ test('should throw if there is the same anchor in the same schema', () => {
refResolver.addSchema(schema)
assert.fail('should throw')
} catch (err) {
assert.equal(err.message, 'There is already another anchor "#subSchemaId" in a schema "schemaId1".')
assert.equal(err.message, 'There is already another anchor "#subSchemaId" in schema "schemaId1".')
}
})
2 changes: 1 addition & 1 deletion test/deref-schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test('should throw id source schema has a key with a same key as ref schema, but
} catch (err) {
assert.strictEqual(
err.message,
'Cannot resolve ref "schemaId2". Property "properties" is already exist in schema "schemaId1".'
'Cannot resolve ref "schemaId2". Property "properties" already exists in schema "schemaId1".'
)
}
})
Expand Down
Loading