CoolFace
Apppublic

strong-tie/inbound-calls

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
build-error-serializer.js36 linesDownload Raw Back to build
1/* istanbul ignore file */2'use strict'3 4const FJS = require('fast-json-stringify')5const path = require('node:path')6const fs = require('node:fs')7 8const code = FJS({9  type: 'object',10  properties: {11    statusCode: { type: 'number' },12    code: { type: 'string' },13    error: { type: 'string' },14    message: { type: 'string' }15  }16}, { mode: 'standalone' })17 18const file = path.join(__dirname, '..', 'lib', 'error-serializer.js')19 20const moduleCode = `// This file is autogenerated by build/build-error-serializer.js, do not edit21/* c8 ignore start */22${code}23/* c8 ignore stop */24`25 26/* c8 ignore start */27if (require.main === module) {28  fs.writeFileSync(file, moduleCode)29  console.log(`Saved ${file} file successfully`)30} else {31  module.exports = {32    code: moduleCode33  }34}35/* c8 ignore stop */36