HEX
Server: nginx/1.18.0
System: Linux vcwordpress 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/thread-self/root/lib/node_modules/npm/node_modules/libnpmdiff/lib/should-print-patch.js
const { basename, extname } = require('node:path')

// we should try to print patches as long as the
// extension is not identified as binary files
const shouldPrintPatch = async (path, opts = {}) => {
  if (opts.diffText) {
    return true
  }

  const { default: binaryExtensions } = await import('binary-extensions')

  const filename = basename(path)
  const extension = (
    filename.startsWith('.')
      ? filename
      : extname(filename)
  ).slice(1)

  return !binaryExtensions.includes(extension)
}

module.exports = shouldPrintPatch