MCPcopy Create free account
hub / github.com/PicoCreator/smol-dev-js / normalizeObject

Function normalizeObject

src/cli/OutputHandler.js:64–72  ·  view source on GitHub ↗

* Ensure an object output, and if the input is a function, execute it expecting an object output

(input)

Source from the content-addressed store, hash-verified

62 * Ensure an object output, and if the input is a function, execute it expecting an object output
63 */
64function normalizeObject(input) {
65 // Unwrap the functions
66 if( input && isFunction(input) ) {
67 return normalizeObject( input() );
68 }
69
70 // the object as it is
71 return input;
72}
73
74/**
75 * Clamp the string for CLI output

Callers 1

standardTableMethod · 0.85

Calls 1

isFunctionFunction · 0.85

Tested by

no test coverage detected