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

chore: typos #2

Merged
merged 1 commit into from
Oct 21, 2023
Merged
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
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ npm install json-schema-ref-resolver

```javascript
const assert = require('node:assert')
const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const sourceSchema = {
$id: 'sourceSchema',
Expand All @@ -49,7 +49,7 @@ const targetSchema = {
}
}

const resolver = new RefResolver()
const refResolver = new RefResolver()

refResolver.addSchema(sourceSchema)
refResolver.addSchema(targetSchema)
Expand Down Expand Up @@ -105,7 +105,7 @@ _Example:_

```javascript
const assert = require('node:assert')
const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const schema = {
$id: 'schema',
Expand All @@ -115,13 +115,13 @@ const schema = {
}
}

const resolver = new RefResolver()
resolver.addSchema(schema)
const refResolver = new RefResolver()
refResolver.addSchema(schema)

const rootSchema = resolver.getSchema(schema.$id)
const rootSchema = refResolver.getSchema(schema.$id)
assert.deepStrictEqual(rootSchema, schema)

const subSchema = resolver.getSchema(schema.$id, '#/properties/foo')
const subSchema = refResolver.getSchema(schema.$id, '#/properties/foo')
assert.deepStrictEqual(subSchema, { type: 'string' })
```

Expand All @@ -131,7 +131,7 @@ _Example:_

```javascript
const assert = require('node:assert')
const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const schema = {
$id: 'schema',
Expand All @@ -143,10 +143,10 @@ const schema = {
}
}

const resolver = new RefResolver()
resolver.addSchema(schema)
const refResolver = new RefResolver()
refResolver.addSchema(schema)

const anchorSchema = resolver.getSchema(schema.$id, '#bar')
const anchorSchema = refResolver.getSchema(schema.$id, '#bar')
assert.deepStrictEqual(subSchema, {
$id: '#bar',
type: 'string'
Expand All @@ -171,7 +171,7 @@ _Example:_
```javascript
const assert = require('node:assert')

const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const sourceSchema = {
$id: 'sourceSchema',
Expand Down Expand Up @@ -216,7 +216,7 @@ _Example:_
```javascript
const assert = require('node:assert')

const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const targetSchema1 = {
$id: 'targetSchema1',
Expand Down Expand Up @@ -265,7 +265,7 @@ _Example_

```javascript
const assert = require('node:assert')
const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const sourceSchema = {
$id: 'sourceSchema',
Expand All @@ -286,7 +286,7 @@ const targetSchema = {
}
}

const resolver = new RefResolver()
const refResolver = new RefResolver()

refResolver.addSchema(sourceSchema)
refResolver.addSchema(targetSchema)
Expand Down Expand Up @@ -321,7 +321,7 @@ _Example:_

```javascript
const assert = require('node:assert')
const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const sourceSchema = {
$id: 'sourceSchema',
Expand All @@ -342,7 +342,7 @@ const targetSchema = {
}
}

const resolver = new RefResolver()
const refResolver = new RefResolver()

refResolver.addSchema(sourceSchema)
refResolver.addSchema(targetSchema)
Expand All @@ -367,7 +367,7 @@ _Example:_

```javascript
const assert = require('node:assert')
const { RefResolver } = require('@fastify/json-schema-ref-resolver')
const { RefResolver } = require('json-schema-ref-resolver')

const targetSchema = {
$id: 'targetSchema',
Expand All @@ -390,9 +390,9 @@ const sourceSchema = {
}
}

const resolver = new RefResolver()
resolver.addSchema(targetSchema)
resolver.addSchema(sourceSchema)
const refResolver = new RefResolver()
refResolver.addSchema(targetSchema)
refResolver.addSchema(sourceSchema)

resolver.derefSchema('sourceSchema') // Throws an error
refResolver.derefSchema('sourceSchema') // Throws an error
```