MCPcopy Index your code
hub / github.com/cncjs/gcode-parser / parseStringSync

Function parseStringSync

src/index.js:299–313  ·  view source on GitHub ↗
(str, options)

Source from the content-addressed store, hash-verified

297};
298
299const parseStringSync = (str, options) => {
300 const results = [];
301 const lines = str.split('\n');
302
303 for (let i = 0; i < lines.length; ++i) {
304 const line = lines[i].trim();
305 if (line.length === 0) {
306 continue;
307 }
308 const result = parseLine(line, options);
309 results.push(result);
310 }
311
312 return results;
313};
314
315const parseFileSync = (file, options) => {
316 return parseStringSync(fs.readFileSync(file, 'utf8'), options);

Callers 2

parseFileSyncFunction · 0.85
index.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected