strictcli v0.39.0 /typescript/src/atprefix
On this page

@-prefix resolution for string flag values, mirroring Go resolveAtPrefix (parse.go) and Python _resolve_at_prefix across the three supported @-forms.

#typescript/src/atprefix

#typescript/src/atprefix

@-prefix resolution for string flag values, mirroring Go resolveAtPrefix (parse.go) and Python _resolve_at_prefix across the three supported @-forms. "@path" reads a file, "@-" reads stdin (once per invocation), and "@@literal" strips the leading "@". Content is trimmed of trailing space/tab/CR/LF only (never other whitespace), and capped at 1 MB.

#AT_PREFIX_MAX_SIZE

TS typescript
export const AT_PREFIX_MAX_SIZE = 1024 * 1024

#StdinTracker

TS typescript
export interface StdinTracker

Tracks which flag consumed stdin ("@-" is single-use per invocation).

#newStdinTracker

TS typescript
export function newStdinTracker(): StdinTracker

#StdinReader

TS typescript
export type StdinReader = () => Buffer

Reads all of stdin, returning at most AT_PREFIX_MAX_SIZE + 1 bytes (the +1 lets the caller detect over-limit input, like Go's LimitReader). Injectable for tests.

#resolveAtPrefix

TS typescript
export function resolveAtPrefix(

Resolves the @-prefix for a raw string flag value. Returns the value unchanged when it does not start with "@". Throws ParseError with the sibling-exact messages on failure.

Search