Skip to content

Commit

Permalink
better readme
Browse files Browse the repository at this point in the history
  • Loading branch information
franklevasseur committed Feb 7, 2024
1 parent bd99dfe commit 40dce59
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions jex/readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# Jex

JSON-Extends; JSON Schema type checking library

## Usage

```typescript
import * as jex from '.'

const res1 = jex.jsonSchemaExtends(
{
type: 'object',
properties: {
name: { type: 'string' },
age: { type: 'number' }
}
},
{
type: 'object',
properties: {
name: { type: 'string' }
}
}
)
console.log(res1) // true

const res2 = jex.jsonSchemaExtends(
{
type: 'object',
properties: {
name: { type: 'string' },
age: { type: 'number' }
}
},
{
type: 'object',
properties: {
name: { type: 'string' }
},
required: ['name']
}
)
console.log(res2) // false
```

0 comments on commit 40dce59

Please sign in to comment.