mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Type check safe-chain package
This commit is contained in:
parent
d5dc801c00
commit
c88b1a624f
60 changed files with 1179 additions and 33 deletions
|
|
@ -14,12 +14,22 @@ function emptyLine() {
|
|||
writeInformation("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {...any} optionalParams
|
||||
* @returns {void}
|
||||
*/
|
||||
function writeInformation(message, ...optionalParams) {
|
||||
if (isSilentMode()) return;
|
||||
|
||||
console.log(message, ...optionalParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {...any} optionalParams
|
||||
* @returns {void}
|
||||
*/
|
||||
function writeWarning(message, ...optionalParams) {
|
||||
if (isSilentMode()) return;
|
||||
|
||||
|
|
@ -29,6 +39,11 @@ function writeWarning(message, ...optionalParams) {
|
|||
console.warn(message, ...optionalParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {...any} optionalParams
|
||||
* @returns {void}
|
||||
*/
|
||||
function writeError(message, ...optionalParams) {
|
||||
if (!isCi()) {
|
||||
message = chalk.red(message);
|
||||
|
|
@ -44,6 +59,19 @@ function writeExitWithoutInstallingMaliciousPackages() {
|
|||
console.error(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef Spinner
|
||||
* @property {(message: string) => void} succeed
|
||||
* @property {(message: string) => void} fail
|
||||
* @property {() => void} stop
|
||||
* @property {(message: string) => void} setText
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
*
|
||||
* @returns {Spinner}
|
||||
*/
|
||||
function startProcess(message) {
|
||||
if (isSilentMode()) {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue