Updates
This commit is contained in:
+3
-3
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user