为什么要输入检查?

问题描述 投票:0回答:1

这个对我来说没有意义:

import axios from 'axios'
import * as TE from 'fp-ts/lib/TaskEither'

export const getIntent = (sessionId: string, input: string) => process.env.INTENT_URL
  ? TE.tryCatch(
      () => axios.post(`${process.env.INTENT_URL}`,{sessionId, input}),
      reason => String(reason))
  : TE.left(Error("No INTENT_URL")
)

LeftString和/或Error,显然不相等。这种类型怎么检查???

[这对我来说没有意义:从'axios'导入axios导入*从'fp-ts / lib / TaskEither'作为TE导出const getIntent =(sessionId:字符串,输入:字符串)=> process.env .INTENT_URL? ...

typescript typescript-typings typechecking fp-ts
1个回答
1
投票

此类型检查的相同原因:

© www.soinside.com 2019 - 2024. All rights reserved.