MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / read

Function read

src/lib/command/input-processor.ts:39–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 const ioFormat: IOFormat = filename ? formatFromFilename(filename) : 'json'
38
39 const hasInput = (): boolean => !!filename
40
41 const read = async (): Promise<T> => {
42 if (!filename) {
43 throw ReferenceError('read called when hasInput returns false')
44 }
45
46 return parseJSONOrYAML(await readFile(filename, 'utf-8'), filename)
47 }
48

Callers

nothing calls this directly

Calls 1

parseJSONOrYAMLFunction · 0.85

Tested by

no test coverage detected