MCPcopy
hub / github.com/YMFE/yapi / convertString

Function convertString

server/utils/commons.js:514–526  ·  view source on GitHub ↗
(variable)

Source from the content-addressed store, hash-verified

512};
513
514function convertString(variable) {
515 if (variable instanceof Error) {
516 return variable.name + ': ' + variable.message;
517 }
518 try {
519 if (variable && typeof variable === 'string') {
520 return variable;
521 }
522 return JSON.stringify(variable, null, ' ');
523 } catch (err) {
524 return variable || '';
525 }
526}
527
528
529exports.runCaseScript = async function runCaseScript(params, colId, interfaceId) {

Callers 1

commons.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected