function parseAt
parseAt(at: string | null): { file: string; line: number; col: number; } | null

Splits an at string (path:line:col) into parts; returns null when it isn't a location.

parseAt('lib/math.ts:4:12'); // { file: 'lib/math.ts', line: 4, col: 12 }
parseAt('not a location'); // null

Parameters

at: string | null

Return Type

{ file: string; line: number; col: number; } | null

Usage

import { parseAt } from "lib/reporters/failure.ts";