MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / safeReadText

Function safeReadText

packages/core/inspector_modules.ts:34–41  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

32}
33
34function safeReadText(path: string): string | null {
35 try {
36 if (File.exists(path)) {
37 return File.fromPath(path).readTextSync();
38 }
39 } catch (_) {}
40 return null;
41}
42
43function findInlineOrLinkedMapFromJs(jsPath: string): { key: string; text: string } | null {
44 const jsText = safeReadText(jsPath);

Callers 1

Calls 3

readTextSyncMethod · 0.65
existsMethod · 0.45
fromPathMethod · 0.45

Tested by

no test coverage detected