MCPcopy Create free account
hub / github.com/NativeScript/android / readLinesFromFile

Function readLinesFromFile

test-app/build-tools/jsparser/js_parser.js:113–130  ·  view source on GitHub ↗
(filePath, outArr, resolveParameter)

Source from the content-addressed store, hash-verified

111 * Get's the javascript files that need traversing
112 */
113function readLinesFromFile(filePath, outArr, resolveParameter) {
114 return new Promise(function (resolve, reject) {
115 fs.createReadStream(filePath)
116 .pipe(split())
117 .on("data", function (line) {
118 // skip empty lines
119 if (/\S/.test(line)) {
120 outArr.push(line.toString().trim());
121 }
122 })
123 .on("error", function (err) {
124 return reject(err);
125 })
126 .on("close", function (e) {
127 return resolve(resolveParameter);
128 });
129 });
130}
131
132/*
133 * Get line and column of the __extends function from ts_helpers file

Callers 1

js_parser.jsFile · 0.85

Calls 2

testMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected