UNPKG

@sasjs/lint

Version:

Linting and formatting for SAS code

21 lines 668 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIndicesOf = void 0; const getIndicesOf = (searchStr, str, caseSensitive = true) => { const searchStrLen = searchStr.length; if (searchStrLen === 0) { return []; } let startIndex = 0, index, indices = []; if (!caseSensitive) { str = str.toLowerCase(); searchStr = searchStr.toLowerCase(); } while ((index = str.indexOf(searchStr, startIndex)) > -1) { indices.push(index); startIndex = index + searchStrLen; } return indices; }; exports.getIndicesOf = getIndicesOf; //# sourceMappingURL=getIndicesOf.js.map