PHP 8.2.30
Preview: utils.js Size: 712 B
/home/byroehnu/.trash/node_modules11/update-browserslist-db/utils.js

const { EOL } = require('os')

const getFirstRegexpMatchOrDefault = (text, regexp, defaultValue) => {
  regexp.lastIndex = 0 // https://stackoverflow.com/a/11477448/4536543
  let match = regexp.exec(text)
  if (match !== null) {
    return match[1]
  } else {
    return defaultValue
  }
}

const DEFAULT_INDENT = '  '
const INDENT_REGEXP = /^([ \t]+)[^\s]/m

module.exports.detectIndent = text =>
  getFirstRegexpMatchOrDefault(text, INDENT_REGEXP, DEFAULT_INDENT)
module.exports.DEFAULT_INDENT = DEFAULT_INDENT

const DEFAULT_EOL = EOL
const EOL_REGEXP = /(\r\n|\n|\r)/g

module.exports.detectEOL = text =>
  getFirstRegexpMatchOrDefault(text, EOL_REGEXP, DEFAULT_EOL)
module.exports.DEFAULT_EOL = DEFAULT_EOL

Directory Contents

Dirs: 0 × Files: 8

Name Size Perms Modified Actions
401 B lrw-r--r-- 2026-02-28 00:26:42
Edit Download
912 B lrw-r--r-- 2026-02-28 00:26:52
Edit Download
134 B lrw-r--r-- 2026-02-28 00:27:36
Edit Download
9.92 KB lrw-r--r-- 2026-02-28 00:27:02
Edit Download
1.09 KB lrw-r--r-- 2026-02-28 00:26:32
Edit Download
916 B lrw-r--r-- 2026-02-28 00:27:24
Edit Download
856 B lrw-r--r-- 2026-02-28 00:27:32
Edit Download
712 B lrw-r--r-- 2026-02-28 00:27:14
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).