MCPcopy Create free account
hub / github.com/firebase/firebase-tools / extractJSON

Function extractJSON

src/profileReport.ts:28–39  ·  view source on GitHub ↗
(line: string, input: any)

Source from the content-addressed store, hash-verified

26// 'static' helper methods
27
28export function extractJSON(line: string, input: any): string | null {
29 if (!input && !DATA_LINE_REGEX.test(line)) {
30 return null;
31 } else if (!input) {
32 line = line.substring(5);
33 }
34 try {
35 return JSON.parse(line);
36 } catch (e) {
37 return null;
38 }
39}
40
41export function pathString(path: string[]): string {
42 return `/${path ? path.join("/") : ""}`;

Callers 1

parseMethod · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…