isTwimlResponse
function isTwimlResponse(value): value is TwimlResponse;Defined in: lib/twiml/twiml.interceptor.ts:156
Type guard identifying Twilio TwiML builder instances: VoiceResponse,
MessagingResponse or FaxResponse.
Checked against the three concrete builders exported from the twilio
package root rather than their shared base class, which is reachable only
through a deep import that breaks under ESM.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
unknown |
The controller return value to inspect. |
Returns
Section titled “Returns”value is TwimlResponse
Example
Section titled “Example”if (isTwimlResponse(value)) { response.header('Content-Type', 'text/xml'); return value.toString();}