outputLimits.ts
utils/shell/outputLimits.ts
15
Lines
416
Bytes
3
Exports
1
Imports
9
Keywords
What this is
This page documents one file from the repository and includes its full source so you can read it without leaving the docs site.
Beginner explanation
This file is one piece of the larger system. Its name, directory, imports, and exports show where it fits. Start by reading the exports and related files first.
How it is used
Start from the exports list and related files. Those are the easiest clues for where this file fits into the system.
Expert explanation
Architecturally, this file intersects with shell-safety. It contains 15 lines, 1 detected imports, and 3 detected exports.
Important relationships
Detected exports
BASH_MAX_OUTPUT_UPPER_LIMITBASH_MAX_OUTPUT_DEFAULTgetMaxOutputLength
Keywords
validateboundedintenvvarbash_max_output_upper_limitbash_max_output_defaultresultbash_max_output_lengthenvvalidationgetmaxoutputlengthprocesseffective
Detected imports
../envValidation.js
Source notes
This page embeds the full file contents. Small or leaf files are still indexed honestly instead of being over-explained.
Full source
import { validateBoundedIntEnvVar } from '../envValidation.js'
export const BASH_MAX_OUTPUT_UPPER_LIMIT = 150_000
export const BASH_MAX_OUTPUT_DEFAULT = 30_000
export function getMaxOutputLength(): number {
const result = validateBoundedIntEnvVar(
'BASH_MAX_OUTPUT_LENGTH',
process.env.BASH_MAX_OUTPUT_LENGTH,
BASH_MAX_OUTPUT_DEFAULT,
BASH_MAX_OUTPUT_UPPER_LIMIT,
)
return result.effective
}