Represents a collection of utility methods.

interface ToolsInterface {
    CalculateGuid: (() => string);
    Clone: ((src: any, _visited?: any[]) => any);
    Compare: ((a: any, b: any) => boolean);
    CompareArray: ((a: any[], b: any[]) => boolean);
    CompareObjects: ((a: any, b: any) => boolean);
    CSV: {
        has: ((csv: any[][], column: string) => number | boolean);
        parse: ((csv: string, options?: CSVOptions) => any[][]);
        stringify: ((table: any[][], options?: CSVOptions) => string);
        toCsv: ((objects: any[], options?: CSVOptions) => string);
    };
    IsArray: ((a: any) => boolean);
    IsNumber: ((a: any) => boolean);
    IsObject: ((a: any) => boolean);
    IsString: ((a: any) => boolean);
    MergeObject: ((target: any, source: any) => void);
    XML: {
        parse: ((xml: string) => any);
    };
}

Properties

CalculateGuid: (() => string)

Calculates and returns a GUID (Globally Unique Identifier).

Type declaration

    • (): string
    • Returns string

      A string representing the generated GUID.

Clone: ((src: any, _visited?: any[]) => any)

Creates a deep copy of an object.

Type declaration

    • (src, _visited?): any
    • Parameters

      • src: any

        The source object to clone.

      • Optional_visited: any[]

        Optional internal parameter to track visited objects during cloning.

      Returns any

      A deep copy of the source object.

Compare: ((a: any, b: any) => boolean)

Compares two values for equality.

Type declaration

    • (a, b): boolean
    • Parameters

      • a: any

        The first value to compare.

      • b: any

        The second value to compare.

      Returns boolean

      true if a is equal to b, otherwise false.

CompareArray: ((a: any[], b: any[]) => boolean)

Compares two arrays for equality.

Type declaration

    • (a, b): boolean
    • Parameters

      • a: any[]

        The first array to compare.

      • b: any[]

        The second array to compare.

      Returns boolean

      true if a is equal to b, otherwise false.

CompareObjects: ((a: any, b: any) => boolean)

Compares two objects for equality.

Type declaration

    • (a, b): boolean
    • Parameters

      • a: any

        The first object to compare.

      • b: any

        The second object to compare.

      Returns boolean

      true if a is equal to b, otherwise false.

CSV: {
    has: ((csv: any[][], column: string) => number | boolean);
    parse: ((csv: string, options?: CSVOptions) => any[][]);
    stringify: ((table: any[][], options?: CSVOptions) => string);
    toCsv: ((objects: any[], options?: CSVOptions) => string);
}

Provides methods for CSV manipulation.

Type declaration

  • has: ((csv: any[][], column: string) => number | boolean)

    Checks if a CSV table contains a specific column.

      • (csv, column): number | boolean
      • Parameters

        • csv: any[][]

          The CSV table to check.

        • column: string

          The name of the column to search for.

        Returns number | boolean

        true if the column exists, otherwise false.

  • parse: ((csv: string, options?: CSVOptions) => any[][])

    Parses CSV content into a two-dimensional array of values.

      • (csv, options?): any[][]
      • Parameters

        • csv: string

          The CSV content to parse.

        • Optionaloptions: CSVOptions

          Optional parsing options.

        Returns any[][]

        A two-dimensional array representing the parsed CSV data.

  • stringify: ((table: any[][], options?: CSVOptions) => string)

    Converts a two-dimensional array of values into CSV format.

      • (table, options?): string
      • Parameters

        • table: any[][]

          The table of data to stringify.

        • Optionaloptions: CSVOptions

          Optional stringification options.

        Returns string

        A string representing the CSV data.

  • toCsv: ((objects: any[], options?: CSVOptions) => string)

    Converts an array of objects into CSV format.

      • (objects, options?): string
      • Parameters

        • objects: any[]

          The array of objects to convert.

        • Optionaloptions: CSVOptions

          Optional conversion options.

        Returns string

        A string representing the CSV data.

IsArray: ((a: any) => boolean)

Checks if the provided value is an array.

Type declaration

    • (a): boolean
    • Parameters

      • a: any

        The value to check.

      Returns boolean

      true if a is an array, otherwise false.

IsNumber: ((a: any) => boolean)

Checks if the provided value is a number.

Type declaration

    • (a): boolean
    • Parameters

      • a: any

        The value to check.

      Returns boolean

      true if a is a number, otherwise false.

IsObject: ((a: any) => boolean)

Checks if the provided value is an object.

Type declaration

    • (a): boolean
    • Parameters

      • a: any

        The value to check.

      Returns boolean

      true if a is an object, otherwise false.

IsString: ((a: any) => boolean)

Checks if the provided value is a string.

Type declaration

    • (a): boolean
    • Parameters

      • a: any

        The value to check.

      Returns boolean

      true if a is a string, otherwise false.

MergeObject: ((target: any, source: any) => void)

Merges properties from a source object into a target object.

Type declaration

    • (target, source): void
    • Parameters

      • target: any

        The target object to merge into.

      • source: any

        The source object whose properties will be merged.

      Returns void

XML: {
    parse: ((xml: string) => any);
}

Provides methods for XML manipulation.

Type declaration

  • parse: ((xml: string) => any)

    Parses XML content into a JavaScript object.

      • (xml): any
      • Parameters

        • xml: string

          The XML content to parse.

        Returns any

        The parsed JavaScript object representing the XML structure.