Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
553 B

  1. var JSONStream = require('../')
  2. var data = [
  3. {ID: 1, optional: null},
  4. {ID: 2, optional: null},
  5. {ID: 3, optional: 20},
  6. {ID: 4, optional: null},
  7. {ID: 5, optional: 'hello'},
  8. {ID: 6, optional: null}
  9. ]
  10. var test = require('tape')
  11. test ('null properties', function (t) {
  12. var actual = []
  13. var stream =
  14. JSONStream.parse('*.optional')
  15. .on('data', function (v) { actual.push(v) })
  16. .on('end', function () {
  17. t.deepEqual(actual, [20, 'hello'])
  18. t.end()
  19. })
  20. stream.write(JSON.stringify(data, null, 2))
  21. stream.end()
  22. })