Skip to content

@pgege/kaboo-react


Function: toFormQuestion()

toFormQuestion(raw): FormQuestion

Defined in: src/formatters/askUser.ts:27

Read one question as the card renders it. Missing options become an empty list, a free-text question answered through Other alone.

Parameters

raw

multiple?

boolean

options?

string[]

question?

string

Returns

FormQuestion

Example

import { toFormQuestion } from "@pgege/kaboo-react";

toFormQuestion({ question: "Which sectors?", options: ["B2B", "B2C"], multiple: true });
// { question: "Which sectors?", options: ["B2B", "B2C"], multiple: true }