domon-validator

0.1.1 • Public • Published

domon-validator

A validator for the DOMON format

The DOMON format is just a lightweight DOM representation with no circular references, making it suitable for JSON etc.

Install

npm install domon-validator

Usage

The validator is just an instance of tv4 prepopulated with the DOMON schema

const validator = require( 'domon-validator' )
 
const domon = [ 'div', { id: 'myDiv' }, [ 'Hello World' ] ]
 
console.log( validator.validate( domon, 'domon-element' ) )

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    2
  • 0.1.0
    0

Package Sidebar

Install

npm i domon-validator

Weekly Downloads

2

Version

0.1.1

License

MIT

Last publish

Collaborators

  • nrkn