Options
All
  • Public
  • Public/Protected
  • All
Menu

randomator

Index

Type aliases

GenerateFunction<T>: () => T

Type parameters

  • T

Type declaration

    • (): T
    • Returns T

MaybeRandomator<T>: T | Randomator<MaybeRandomator<T>>

Type parameters

  • T = unknown

Functions

  • booleans(options?: BooleanOptions): Randomator<boolean>
  • object<T>(obj: MaybeRandomatorRecord<T>): Randomator<T>
  • paragraphs(options?: ParagraphOptions): Randomator<string>
  • pattern(pat: string, mapper?: Record<string, unknown>): Randomator<string>
  • randomator(strings: TemplateStringsArray | string[], ...args: unknown[]): Randomator<string>
  • A template tag function for creating a random string from the given sequence

    Parameters

    • strings: TemplateStringsArray | string[]
    • Rest ...args: unknown[]

    Returns Randomator<string>

  • record<T>(obj: MaybeRandomatorRecord<T>): Randomator<T>
  • sentences(options?: SentenceOptions): Randomator<string>
  • seq<T>(args: MaybeRandomatorTuple<T>, opts?: { separator: string }): Randomator<string>
  • Generates a random string like from the given sequence

    Type parameters

    • T: unknown[]

    Parameters

    • args: MaybeRandomatorTuple<T>
    • opts: { separator: string } = ...
      • separator: string

    Returns Randomator<string>

  • strings(options?: StringOptions): Randomator<string>
  • unixTimestamp(options?: DateOptions): Randomator<number>
  • Generates a random unix timestamp between -2147483647 and 2147483647

    Parameters

    • options: DateOptions = {}

      (defaults between -2147483647 and 2147483647)

    Returns Randomator<number>

Generated using TypeDoc