REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.21 KB
Close
/opt/alt/alt-nodejs24/root/lib/node_modules/npm/node_modules/@npmcli/redact/lib/deep-map.js
Text
Base64
const { serializeError } = require('./error') const deepMap = (input, handler = v => v, path = ['$'], seen = new Set([input])) => { // this is in an effort to maintain bole's error logging behavior if (path.join('.') === '$' && input instanceof Error) { return deepMap({ err: serializeError(input) }, handler, path, seen) } if (input instanceof Error) { return deepMap(serializeError(input), handler, path, seen) } // allows for non-node js environments, sush as workers if (typeof Buffer !== 'undefined' && input instanceof Buffer) { return `[unable to log instanceof buffer]` } if (input instanceof Uint8Array) { return `[unable to log instanceof Uint8Array]` } if (Array.isArray(input)) { const result = [] for (let i = 0; i < input.length; i++) { const element = input[i] const elementPath = [...path, i] if (element instanceof Object) { if (!seen.has(element)) { // avoid getting stuck in circular reference seen.add(element) result.push(deepMap(handler(element, elementPath), handler, elementPath, seen)) } } else { result.push(handler(element, elementPath)) } } return result } if (input === null) { return null } else if (typeof input === 'object' || typeof input === 'function') { const result = {} for (const propertyName of Object.getOwnPropertyNames(input)) { // skip logging internal properties if (propertyName.startsWith('_')) { continue } try { const property = input[propertyName] const propertyPath = [...path, propertyName] if (property instanceof Object) { if (!seen.has(property)) { // avoid getting stuck in circular reference seen.add(property) result[propertyName] = deepMap( handler(property, propertyPath), handler, propertyPath, seen ) } } else { result[propertyName] = handler(property, propertyPath) } } catch (err) { // a getter may throw an error result[propertyName] = `[error getting value: ${err.message}]` } } return result } return handler(input, path) } module.exports = { deepMap }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
deep-map.js
2.21 KB
lrw-r--r--
2026-02-23 07:38:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
error.js
1.06 KB
lrw-r--r--
2026-02-23 07:38:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.07 KB
lrw-r--r--
2026-02-23 07:38:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
matchers.js
1.96 KB
lrw-r--r--
2026-02-23 07:38:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
server.js
1.34 KB
lrw-r--r--
2026-02-23 07:38:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js
5.61 KB
lrw-r--r--
2026-02-23 07:38:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).