All files / lib/core/tooling avenxTemplateParser.js

100% Statements 33/33
66.66% Branches 2/3
100% Functions 1/1
100% Lines 33/33

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 32 336x 6x 6x 6x 6x 6x 6x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 15x 6x 6x 6x 6x
const parser = {
  meta: {
    name: 'avenx-template-parser',
    version: '0.4.3',
  },
 
  parse(text, options = {}) {
    const lines = text.split(/\r\n|\r|\n/);
    const lastLine = lines.length;
    const lastColumn = lines[lastLine - 1].length;
 
    return {
      type: 'Program',
      body: [],
      sourceType: options.sourceType || 'module',
      comments: [],
      tokens: [],
      range: [0, text.length],
      loc: {
        start: {
          line: 1,
          column: 0,
        },
        end: {
          line: lastLine,
          column: lastColumn,
        },
      },
    };
  },
};
 
export default parser;