Options
All
  • Public
  • Public/Protected
  • All
Menu

mockaroni

Index

Type aliases

ArrayElementsType<T>: T extends ArrayLike<infer ArrayElementsType> ? ArrayElementsType : never

Type parameters

  • T: ArrayLike<unknown>

DateConfig: { max: Date; min: Date }

Type declaration

  • max: Date

    End point of date

  • min: Date

    Start point of date

ListOfConfig<T>: { list: ArrayLike<T>; size: number }

Type parameters

  • T

Type declaration

  • list: ArrayLike<T>

    List of values which resulting array will contain

  • size: number

    The size of resulting array

ListOfReturnValue<T>: ArrayElementsType<ArrayLike<T>>[]

Type parameters

  • T

MockaroniConfig: { random: any }

Type declaration

  • random:function
    • random(): number
Nullable<T, N>: T & { nullable?: N }

Type parameters

  • T: Record<any, any>

  • N: boolean = true

NumConfig: { max: number; min: number; type?: "float" | "int" }

Type declaration

  • max: number

    High border of numbers

  • min: number

    Low border of numbers

  • Optional type?: "float" | "int"

    Would a result number be an integer or float

    Default: 'int'

OneOfConfig<T>: { list: ArrayLike<T> }

Type parameters

  • T

Type declaration

  • list: ArrayLike<T>

    List of values

OneOfReturnValue<T>: ArrayElementsType<ArrayLike<T>>

Type parameters

  • T

PartialWordsSet: { names?: { female?: string[]; male?: string[]; mixed?: string[] }; words?: string[] }

Type declaration

  • Optional names?: { female?: string[]; male?: string[]; mixed?: string[] }
    • Optional female?: string[]
    • Optional male?: string[]
    • Optional mixed?: string[]
  • Optional words?: string[]
RangeConfig: { from: number; to: number }

Type declaration

  • from: number

    Start point of numbers in the range

  • to: number

    End point of numbers in the range

ReplicateConfig<R>: { size: number; schema: any }

Type parameters

  • R

Type declaration

  • size: number

    The size of resulting array

  • schema:function
    • schema(index: number): R
StringConfig: { format?: "capitalized" | "lowercase" | "uppercase" | "mixed"; locale?: "cyrillic" | "latin"; size: number; type?: "alpha" | "numeric" | "alphanumeric" }

Type declaration

  • Optional format?: "capitalized" | "lowercase" | "uppercase" | "mixed"

    Case of string

    Default: 'lowercase'

  • Optional locale?: "cyrillic" | "latin"

    Alphabet of a string

    Default: 'latin'

  • size: number

    The size of resulting string Required

  • Optional type?: "alpha" | "numeric" | "alphanumeric"

    Which characters would be in a string

    Default: 'alpha'

TextConfig: { capitalized?: boolean; namesGender?: "male" | "female" | "mixed"; randomStringConfig?: StringConfig; size: number; type?: "words" | "random_string" | "names"; wordsSet?: PartialWordsSet }

Type declaration

  • Optional capitalized?: boolean

    Should the text be capitalized (first letter is in upper case)

    Default: false

  • Optional namesGender?: "male" | "female" | "mixed"

    Genders of names if the type is 'names'

    Default: 'mixed'

  • Optional randomStringConfig?: StringConfig

    Config of random string if the type is 'random_string'

    Default: { size: 7 }

  • size: number

    Count of words in resulting text

  • Optional type?: "words" | "random_string" | "names"

    The content of resulting text, would it be a random strings, names or plain words

    Default: 'words'

  • Optional wordsSet?: PartialWordsSet

    Custom list of words and names

    Default: {}

Variables

wordsSet: { names: { female: string[]; male: string[]; mixed: string[] }; words: string[] } = ...

Type declaration

  • names: { female: string[]; male: string[]; mixed: string[] }
    • female: string[]
    • male: string[]
    • mixed: string[]
  • words: string[]

Functions

  • assignSoft<T, U>(target: T, source: U): T & U
  • assignSoft<T, U, V>(target: T, source1: U, source2: V): T & U & V
  • assignSoft<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W
  • assignSoft(target: Record<any, any>, sources: Record<any, any>[]): Record<any, any>
  • Analog of Object.assign. Will write only those values from the source, which is not represented in target Also working for nested object (expect arrays)

    Type parameters

    • T

    • U

    Parameters

    • target: T
    • source: U

    Returns T & U

  • Analog of Object.assign. Will write only those values from the source, which is not represented in target Also working for nested object (expect arrays)

    Type parameters

    • T

    • U

    • V

    Parameters

    • target: T
    • source1: U
    • source2: V

    Returns T & U & V

  • Analog of Object.assign. Will write only those values from the source, which is not represented in target Also working for nested object (expect arrays)

    Type parameters

    • T

    • U

    • V

    • W

    Parameters

    • target: T
    • source1: U
    • source2: V
    • source3: W

    Returns T & U & V & W

  • Analog of Object.assign. Will write only those values from the source, which is not represented in target Also working for nested object (expect arrays)

    Parameters

    • target: Record<any, any>
    • sources: Record<any, any>[]

    Returns Record<any, any>

  • capitalize(str: string): string
  • Parameters

    • str: string

    Returns string

  • nullable<T>(obj: T): obj is Nullable<T, true>
  • trueOrFalse(): boolean

Generated using TypeDoc