@eleven-am/faker
    Preparing search index...

    Variable transformersConst

    transformers: {
        capitalize: () => TransformerFn<string, string>;
        formatDate: (format?: string) => TransformerFn<Date, string | Date>;
        lowercase: () => TransformerFn<string, string>;
        round: (precision?: number) => TransformerFn<number, number>;
        trim: () => TransformerFn<string, string>;
        truncate: (
            maxLength: number,
            ellipsis?: string,
        ) => TransformerFn<string, string>;
        uppercase: () => TransformerFn<string, string>;
    } = ...

    Type declaration

    • capitalize: () => TransformerFn<string, string>

      Capitalizes the first letter of a string. No-op if not a string.

    • formatDate: (format?: string) => TransformerFn<Date, string | Date>

      Formats a Date object into a string. No-op if not a valid Date.

    • lowercase: () => TransformerFn<string, string>

      Converts a string to lowercase. No-op if not a string.

    • round: (precision?: number) => TransformerFn<number, number>

      Rounds a number to a specified precision. No-op if not a number.

    • trim: () => TransformerFn<string, string>

      Trims whitespace from the start and end of a string. No-op if not a string.

    • truncate: (maxLength: number, ellipsis?: string) => TransformerFn<string, string>

      Truncates a string if it exceeds maxLength. No-op if not a string.

    • uppercase: () => TransformerFn<string, string>

      Converts a string to uppercase. No-op if not a string.