MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / handleReturn

Function handleReturn

bin/script-util.js:145–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143
144 // Return handler
145 const handleReturn = val => {
146 if (val != null) {
147 if (val === true) return;
148 if (val === false) {
149 process.exit(1);
150 }
151 if (typeof val === 'object' && typeof val.exitCode === 'number') {
152 process.exit(val.exitCode);
153 } else {
154 console.log(val);
155 }
156 }
157 };
158 let valueOrPromise;
159 try {
160 valueOrPromise = fn(...args);

Callers 1

runMainFunction · 0.85

Calls 2

exitMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected