- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스) - Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포 - 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
526 B
JavaScript
25 lines
526 B
JavaScript
/**
|
|
* Represents a location in a Source.
|
|
*/
|
|
|
|
/**
|
|
* Takes a Source and a UTF-8 character offset, and returns the corresponding
|
|
* line and column as a SourceLocation.
|
|
*/
|
|
export function getLocation(source, position) {
|
|
var lineRegexp = /\r\n|[\n\r]/g;
|
|
var line = 1;
|
|
var column = position + 1;
|
|
var match;
|
|
|
|
while ((match = lineRegexp.exec(source.body)) && match.index < position) {
|
|
line += 1;
|
|
column = position + 1 - (match.index + match[0].length);
|
|
}
|
|
|
|
return {
|
|
line: line,
|
|
column: column
|
|
};
|
|
}
|