FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/ant-design / transferValue

Function: transferValue()

transferValue(type, value): any

Coerce a raw value into the expected JavaScript type for a given FaasItemType.

Falsy scalar values (including the strings "null" and "undefined") are normalised to null. Array-typed values are coerced element-by-element. Date/time values are parsed into Dayjs objects and unix timestamps are auto-detected.

Parameters

type

FaasItemType | null | undefined

Target item type (defaults to "string" when falsy).

value

any

Raw value to normalise.

Returns

any

Normalised value matching the expected type.