PHP 7.4.33
Preview: utils.js Size: 613 B
/var/www/receipt-app-backend-bitkit.dk/httpdocs/node_modules/jsonfile/utils.js
function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) {
  const EOF = finalEOL ? EOL : ''
  const str = JSON.stringify(obj, replacer, spaces)

  if (str === undefined) {
    throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`)
  }

  return str.replace(/\n/g, EOL) + EOF
}

function stripBom (content) {
  // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
  if (Buffer.isBuffer(content)) content = content.toString('utf8')
  return content.replace(/^\uFEFF/, '')
}

module.exports = { stringify, stripBom }

Directory Contents

Dirs: 0 × Files: 5
Name Size Perms Modified Actions
1.97 KB lrw-r--r-- 2026-05-06 08:23:45
Edit Download
1.08 KB lrw-r--r-- 2026-05-06 08:23:45
Edit Download
762 B lrw-r--r-- 2026-05-06 08:23:45
Edit Download
6.29 KB lrw-r--r-- 2026-05-06 08:23:45
Edit Download
613 B lrw-r--r-- 2026-05-06 08:23:45
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).