MCPcopy
hub / github.com/evanw/esbuild / validateStringValue

Function validateStringValue

lib/shared/common.ts:138–143  ·  view source on GitHub ↗
(value: unknown, what: string, key?: string)

Source from the content-addressed store, hash-verified

136}
137
138function validateStringValue(value: unknown, what: string, key?: string): string {
139 if (typeof value !== 'string') {
140 throw new Error(`Expected value for ${what}${key !== void 0 ? ' ' + quote(key) : ''} to be a string, got ${typeof value} instead`)
141 }
142 return value
143}
144
145function pushCommonFlags(flags: string[], options: CommonOptions, keys: OptionKeys): void {
146 let legalComments = getFlag(options, keys, 'legalComments', mustBeString)

Callers 3

pushCommonFlagsFunction · 0.85
flagsForBuildOptionsFunction · 0.85

Calls 1

quoteFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…