refactor(♻️ Add defaults everywhere (+ settings page)):
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import { TypingEmulationSettings } from 'models'
|
||||
import { TypingEmulation } from 'models'
|
||||
|
||||
export const computeTypingTimeout = (
|
||||
bubbleContent: string,
|
||||
typingSettings: TypingEmulationSettings
|
||||
typingSettings: TypingEmulation
|
||||
) => {
|
||||
const wordCount = bubbleContent.match(/(\w+)/g)?.length ?? 0
|
||||
const typedWordsPerMinute = typingSettings.speed
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ChoiceInputStep, ChoiceItem, Table, Target } from 'models'
|
||||
import { ChoiceInputStep, ChoiceItem, Table } from 'models'
|
||||
|
||||
export const getSingleChoiceTargetId = (
|
||||
currentStep: ChoiceInputStep,
|
||||
|
@ -10,7 +10,6 @@ import {
|
||||
Cell,
|
||||
GoogleSheetsGetOptions,
|
||||
GoogleAnalyticsStep,
|
||||
Webhook,
|
||||
WebhookStep,
|
||||
} from 'models'
|
||||
import { stringify } from 'qs'
|
||||
|
@ -28,7 +28,7 @@ export const isMathFormula = (str?: string) =>
|
||||
['*', '/', '+', '-'].some((val) => str && str.includes(val))
|
||||
|
||||
export const evaluateExpression = (str: string) => {
|
||||
let result = replaceCommasWithDots(str)
|
||||
const result = replaceCommasWithDots(str)
|
||||
try {
|
||||
const evaluatedNumber = safeEval(result) as number
|
||||
if (countDecimals(evaluatedNumber) > 2) {
|
||||
|
Reference in New Issue
Block a user