Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "descartes"

Index

Type aliases

DescartesArray

DescartesArray: Array<string | number>

DescartesObject

DescartesObject: Record<string, string | number | unknown>

Functions

toDescartesArray

  • 将二维数组转成笛卡儿积数组

    example

    fromArray([['a', 'b'], ['c']]) // [["a","c"],["b","c"]]

    fromArray([['a', 'b'], ['c', 'd']]) // [["a","c"],["a","d"],["b","c"],["b","d"]]

    Type parameters

    • TResult

    Parameters

    Returns TResult[]

toDescartesData

  • 将对象转成笛卡儿积

    example

    fromObject({ color: ['red', 'blue'], size: ['22#'] }) // [{"color":"red","size":"22#"},{"color":"blue","size":"22#"}]

    Parameters

    • data: Record<string, Array<string | number>>

      原始对象

    • Optional options: Partial<FormObjectOptions>

      可选配置

    Returns DescartesObject[]

    转换后的笛卡尔积数组

Generated using TypeDoc