1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Remove now-unused makePollContent from its old location (#2078)

This commit is contained in:
Andy Balaam
2021-12-15 17:08:21 +00:00
committed by GitHub
parent d6980cb8fa
commit 72643026a3

View File

@@ -66,25 +66,3 @@ export interface IPollEndContent extends IContent {
"rel_type": string;
};
}
export function makePollContent(
question: string,
answers: string[],
kind: string,
): IPollContent {
question = question.trim();
answers = answers.map(a => a.trim()).filter(a => !!a);
return {
[TEXT_NODE_TYPE.name]:
`${question}\n${answers.map((a, i) => `${i + 1}. ${a}`).join('\n')}`,
[POLL_START_EVENT_TYPE.name]: {
kind: kind,
question: {
[TEXT_NODE_TYPE.name]: question,
},
answers: answers.map(
(a, i) => ({ id: `${i}-${a}`, [TEXT_NODE_TYPE.name]: a }),
),
},
};
}