/usr/lib/nodejs/ltx/lib/parse.js is in node-ltx 2.6.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 'use strict'
var Parser = require('./Parser')
module.exports = function parse (data, options) {
var p
if (typeof options === 'function') {
p = new options() // eslint-disable-line
} else {
p = new Parser(options)
}
var result = null
var error = null
p.on('tree', function (tree) {
result = tree
})
p.on('error', function (e) {
error = e
})
p.write(data)
p.end()
if (error) {
throw error
} else {
return result
}
}
|