This commit is contained in:
Raven Scott
2026-04-03 20:46:09 -04:00
parent e58a9f99d6
commit 2655fe6a7d
293 changed files with 16784 additions and 7960 deletions
+3 -3
View File
@@ -6,8 +6,7 @@ function bareStdin(ctx) {
/** @param {number} mode @param {'file' | 'directory' | 'symlink'} type */
function bareFormatModeString(mode, type) {
const typeChar =
type === 'directory' ? 'd' : type === 'symlink' ? 'l' : '-'
const typeChar = type === 'directory' ? 'd' : type === 'symlink' ? 'l' : '-'
const perm = mode & 0o777
const r = (bit) => (perm & bit ? 'r' : '-')
const w = (bit) => (perm & bit ? 'w' : '-')
@@ -82,7 +81,8 @@ function barePrintfFormat(fmt, args) {
else if (spec === 'd' || spec === 'i') o += String(Math.trunc(Number(arg)))
else if (spec === 'u') o += String(Math.trunc(Number(arg)) >>> 0)
else if (spec === 'x') o += (Math.trunc(Number(arg)) >>> 0).toString(16)
else if (spec === 'X') o += (Math.trunc(Number(arg)) >>> 0).toString(16).toUpperCase()
else if (spec === 'X')
o += (Math.trunc(Number(arg)) >>> 0).toString(16).toUpperCase()
else if (spec === 'o') o += (Math.trunc(Number(arg)) >>> 0).toString(8)
else if (spec === 'c') o += String.fromCharCode(Number(arg) || 0)
else if (spec === 'f') o += String(Number(arg))