TS-Scribe - v0.6.2
    Preparing search index...

    Type Alias MaskObjectOptions

    Options for masking sensitive properties in objects.

    type MaskObjectOptions = {
        char?: string;
        isSensitive?: (
            key: string,
            value: unknown,
            path: string,
            depth: number,
        ) => boolean;
        keys?: string[];
        maskArrays?: boolean;
        maskFn?: (value: unknown, key: string, path: string) => string;
        maxDepth?: number;
        shouldSkip?: (value: unknown, path: string, depth: number) => boolean;
    }
    Index

    Properties

    char?: string

    Character used for masking (default: '*')

    isSensitive?: (
        key: string,
        value: unknown,
        path: string,
        depth: number,
    ) => boolean

    Custom function to determine if a property is sensitive. If returns true, the property value will be masked.

    Type Declaration

      • (key: string, value: unknown, path: string, depth: number): boolean
      • Parameters

        • key: string

          The property name

        • value: unknown

          The property value

        • path: string

          Dot-notation path (e.g. "user.payment.card")

        • depth: number

          Current nesting level

        Returns boolean

        true if the property should be masked

    keys?: string[]

    List of property keys to mask (checked at any depth). These keys will be masked wherever they appear in the object tree.

    maskArrays?: boolean

    Whether to mask array elements (default: true). When false, arrays are traversed but individual array items are not masked.

    maskFn?: (value: unknown, key: string, path: string) => string

    Custom function to mask a property value. If provided, this function is called for masked properties instead of using default masking.

    Type Declaration

      • (value: unknown, key: string, path: string): string
      • Parameters

        • value: unknown

          The value to mask

        • key: string

          The property name

        • path: string

          Dot-notation path

        Returns string

        The masked value (typically a string)

    maxDepth?: number

    Maximum nesting depth (default: 100, Infinity for unlimited). Beyond this depth, objects are not traversed further.

    shouldSkip?: (value: unknown, path: string, depth: number) => boolean

    Custom function to determine if traversal should skip descending into an object. Useful for skipping special objects like GeoJSON geometries, DOM nodes, etc.

    Type Declaration

      • (value: unknown, path: string, depth: number): boolean
      • Parameters

        • value: unknown

          The object/array to potentially skip

        • path: string

          Dot-notation path

        • depth: number

          Current nesting level

        Returns boolean

        true to skip descending into this object