Browse Source

Wrap parser in gen() relying on the function list facility.

Eugene Lazutkin 3 years ago
parent
commit
081f78aabf
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/jsonl/parser.js

+ 2 - 1
src/jsonl/parser.js

@@ -1,11 +1,12 @@
 'use strict';
 
+const gen = require('../gen.js');
 const fixUtf8Stream = require('../utils/fixUtf8Stream');
 const lines = require('../utils/lines');
 
 const parser = reviver => {
   let counter = 0;
-  return [fixUtf8Stream(), lines(), string => ({key: counter++, value: JSON.parse(string, reviver)})];
+  return gen(fixUtf8Stream(), lines(), string => ({key: counter++, value: JSON.parse(string, reviver)}));
 };
 
 module.exports = parser;