提交 078e7ccc 编写于 作者: fxy060608's avatar fxy060608

fix: 修复 generateCodeFrame

上级 ceaa5035
......@@ -133,10 +133,10 @@ export function locToStartAndEnd(
export function generateCodeFrame(
source: string,
start: number | { line: number; column: number } = 0,
end = source.length
end?: number
): string {
start = posToNumber(source, start)
end = end || start
// Split the content into individual lines but capture the newline sequence
// that separated each line. This is important because the actual sequence is
// needed to properly take into account the full line length for offset
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册