UNPKG

@sasjs/lint

Version:

Linting and formatting for SAS code

23 lines 747 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getHeaderLinesCount = void 0; const splitText_1 = require("./splitText"); /** * This function returns the number of lines the header spans upon. * The file must start with "/*" and the header will finish with ⇙ */ const getHeaderLinesCount = (text, config) => { let count = 0; if (text.trimStart().startsWith('/*')) { const lines = (0, splitText_1.splitText)(text, config); for (const line of lines) { count++; if (line.match(/\*\//)) { break; } } } return count; }; exports.getHeaderLinesCount = getHeaderLinesCount; //# sourceMappingURL=getHeaderLinesCount.js.map