This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Description
In the file "lib/ndjson.js" the tryJSONStringify function is declared below your call, this causes an "Expected to return a value at the end of function 'tryJSONStringify' indentation conflict" and this function still has nothing defined in its catch scope.
I suggest implementing the following code:
'use strict'
const stringify = require('fast-safe-stringify')
function tryJSONStringify (obj) {
try {
return JSON.stringify(obj)
} catch (e) {
throw new Error('Error when running tryJSONStringify')
}
}
exports.serialize = function serialize (obj) {
const str = tryJSONStringify(obj) || stringify(obj)
return str + '\n'
}