MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / stripBom

Function stripBom

src/commands/test.ts:907–909  ·  view source on GitHub ↗

* Drop a leading UTF-8 BOM (U+FEFF) from a freshly-read file. PowerShell 5.1's * default `Set-Content -Encoding utf8` writes a BOM; without this strip, * `JSON.parse` fails with an invisible "Unexpected token" error that renders * as a blank character on most consoles. Most JSON parsers strip BOM

(raw: string)

Source from the content-addressed store, hash-verified

905 * boundary — we just bring this one in line.
906 */
907function stripBom(raw: string): string {
908 return raw.charCodeAt(0) === 0xfeff ? raw.slice(1) : raw;
909}
910
911function requireNonEmpty(flagName: string, value: string): void {
912 if (typeof value !== 'string' || value.trim().length === 0) {

Callers 4

readPlanStepsFileGuardedFunction · 0.85
readPlanFromGuardedFunction · 0.85
readPlansJsonlGuardedFunction · 0.85
readPlansFromDirGuardedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected