2
0

♻️ Add shared eslint config

This commit is contained in:
Baptiste Arnaud
2022-11-21 11:12:43 +01:00
parent e09adf5c64
commit 451ffbcacf
123 changed files with 1151 additions and 1523 deletions

View File

@ -7,6 +7,7 @@ import {
Answer,
VariableWithValue,
Typebot,
ResultWithAnswersInput,
} from 'models'
import { isInputBlock, isDefined, byId } from './utils'
@ -177,14 +178,16 @@ export const parseAnswers =
createdAt,
answers,
variables: resultVariables,
}: Pick<ResultWithAnswers, 'answers' | 'variables'> & {
createdAt: string
}: Pick<ResultWithAnswersInput, 'answers' | 'variables'> & {
// TODO: remove once we are using 100% tRPC
createdAt: Date | string
}): {
[key: string]: string
} => {
const header = parseResultHeader(typebot, linkedTypebots)
return {
submittedAt: createdAt,
submittedAt:
typeof createdAt === 'string' ? createdAt : createdAt.toISOString(),
...[...answers, ...resultVariables].reduce<{
[key: string]: string
}>((o, answerOrVariable) => {