Files
animate/webGl/my-threejs-test/node_modules/@parcel/utils/src/countLines.js
2024-06-24 21:24:00 +12:00

16 lines
266 B
JavaScript

// @flow strict-local
export default function countLines(
string: string,
startIndex: number = 0,
): number {
let lines = 1;
for (let i = startIndex; i < string.length; i++) {
if (string.charAt(i) === '\n') {
lines++;
}
}
return lines;
}