1.0.0 • Published 7 years ago

@mojule/schema-tree v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

schema-tree

Use tree API over JSON Schema

Install

npm install @mojule/schema-tree

Example

const SchemaTree = require( '@mojule/schema-tree' )
const jsonSchema = require( './test.schema.json' )

const tree = SchemaTree.fromSchema( jsonSchema )

const integerNodes = tree.subNodes.filter( n =>
  n.nodeType === SchemaTree.INTEGER_NODE
)

integerNodes.forEach( n => n.value.minimum = 1 )

const newSchema = tree.toSchema()

console.log( JSON.stringify( newSchema, null, 2 ) )
1.0.0

7 years ago

0.4.7

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago