@jsvision/core / isAsciiSafe
Function: isAsciiSafe()
isAsciiSafe(
caps):boolean
Defined in: host/width-probe.ts:373
Whether a capability profile already renders as pure ASCII, so the width probe can be skipped with nothing to learn or swap. Pure.
True when UTF-8 output is off (every glyph above U+007F already becomes ?, and probing would only write raw UTF-8 to a non-UTF-8 terminal), or when the glyph flags are already fully degraded (box/half off, ambiguous-wide on).
Parameters
caps
The capability profile to test.
Returns
boolean
True when the probe can be skipped with no loss of fidelity.
Example
ts
import { resolveCapabilities, isAsciiSafe, degradeCapsFully } from '@jsvision/core';
isAsciiSafe(resolveCapabilities().profile); // typically false on a UTF-8 terminal
isAsciiSafe(degradeCapsFully(resolveCapabilities().profile)); // => true