UNPKG

@graphql-codegen/cli

Version:

<p align="center"> <img src="https://github.com/dotansimha/graphql-code-generator/blob/master/logo.png?raw=true" /> </p>

25 lines (24 loc) 621 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isListrError = isListrError; exports.cliError = cliError; function isListrError(err) { return err.name === 'ListrError' && Array.isArray(err.errors) && err.errors.length > 0; } function cliError(err, exitOnError = true) { let msg; if (err instanceof Error) { msg = err; } else if (typeof err === 'string') { msg = err; } else { msg = JSON.stringify(err); } // eslint-disable-next-line no-console console.error(msg); if (exitOnError) { process.exit(1); } }