MCPcopy Create free account
hub / github.com/Noumena-Network/code / inputToString

Function inputToString

src/ink/parse-keypress.ts:200–215  ·  view source on GitHub ↗
(input: Buffer | string)

Source from the content-addressed store, hash-verified

198}
199
200function inputToString(input: Buffer | string): string {
201 if (Buffer.isBuffer(input)) {
202 if (input[0]! > 127 && input[1] === undefined) {
203 ;(input[0] as unknown as number) -= 128
204 return '\x1b' + String(input)
205 } else {
206 return String(input)
207 }
208 } else if (input !== undefined && typeof input !== 'string') {
209 return String(input)
210 } else if (!input) {
211 return ''
212 } else {
213 return input
214 }
215}
216
217export function parseMultipleKeypresses(
218 prevState: KeyParseState,

Callers 1

parseMultipleKeypressesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected