0.1.2 • Published 8 years ago

commonform-treeify-annotations v0.1.2

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
8 years ago
var treeify = require('commonform-treeify-annotations')
var assert = require('assert')

var shallow = {
  message: 'The heading "Payment" is referenced, but not used.',
  path: ['content', 0],
  source: "commonform-lint",
  url: null
}

var deep = {
  message: 'The heading "Indemnity" is referenced, but not used.',
  path: ['content', 0, 'form', 'content', 7],
  source: "commonform-lint",
  url: null
}

assert.deepEqual(
  treeify([shallow, deep]),
  {
    content: {
      0: {
        annotations: [shallow],
        form: {
          content: {
            7: {
              annotations: [deep]
            }
          }
        }
      }
    }
  }
)
0.1.2

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago