Skip to content

Commit

Permalink
chore: typos (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm authored Oct 21, 2023
1 parent 2f10f64 commit 33db77f
Showing 1 changed file with 22 additions and 22 deletions.
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
```

0 comments on commit 33db77f

Please sign in to comment.