Variable IndexSignatureHelpersConst

IndexSignatureHelpers: {
    entriesToArray: (<T, U>(indexSignature, mapper) => U[]);
    filter: (<T>(indexSignature, filter) => {
        [id: string]: T;
    });
    fromArray: (<T>(array, idExtractor) => {
        [id: string]: T;
    });
    fromArrayValues: (<T, U>(array, idExtractor, valueExtractor) => {
        [id: string]: U;
    });
    groupBy: (<T>(array, indexExtractor) => {
        [index: string]: T[];
    });
    groupByAndMap: (<T, U>(array, indexExtractor, mapper) => {
        [index: string]: U[];
    });
    includes: (<T>(indexSignature, indexSignatures) => boolean);
    keysToArray: (<T>(indexSignature) => string[]);
    mapToArray: (<T, U>(indexSignature, mapper, filter?) => U[]);
    mapValues: (<T, U>(indexSignature, mapper, filter?) => {
        [id: string]: U;
    });
    same: (<T>(indexSignature1, indexSignature2) => boolean);
    toArray: (<T>(indexSignature) => T[]);
    toString: (<T>(indexSignature) => string);
} = ...

Type declaration

  • entriesToArray: (<T, U>(indexSignature, mapper) => U[])

    Converts an index signature' keys and values converted by applying the given mapping function into an array.

    Param: indexSignature

    The index signature to convert.

    Param: mapper

    The mapper function.

    Returns

    an array corresponding to all entries of the given index signature using the given mapper function.

      • <T, U>(indexSignature, mapper): U[]
      • Converts an index signature' keys and values converted by applying the given mapping function into an array.

        Type Parameters

        • T

        • U

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signature to convert.

          • [id: string]: T
        • mapper: ((key, value) => U)

          The mapper function.

            • (key, value): U
            • Parameters

              • key: string
              • value: T

              Returns U

        Returns U[]

        an array corresponding to all entries of the given index signature using the given mapper function.

  • filter: (<T>(indexSignature, filter) => {
        [id: string]: T;
    })

    Filters out all entries from the given index signature that doesn't match the given predicate.

    Param: indexSignature

    The index signture to filter.

    Param: filter

    Predicate to filter the entries.

    Returns

    an index signature containing only the element that match the given predicate.

      • <T>(indexSignature, filter): {
            [id: string]: T;
        }
      • Filters out all entries from the given index signature that doesn't match the given predicate.

        Type Parameters

        • T

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signture to filter.

          • [id: string]: T
        • filter: ((id, element) => boolean)

          Predicate to filter the entries.

            • (id, element): boolean
            • Parameters

              • id: string
              • element: T

              Returns boolean

        Returns {
            [id: string]: T;
        }

        an index signature containing only the element that match the given predicate.

        • [id: string]: T
  • fromArray: (<T>(array, idExtractor) => {
        [id: string]: T;
    })

    Creates an index signature from the given array.

    Param: array

    The array to convert.

    Param: idExtractor

    A function to extract the id from each array elements.

    Returns

    the created index signature.

      • <T>(array, idExtractor): {
            [id: string]: T;
        }
      • Creates an index signature from the given array.

        Type Parameters

        • T

        Parameters

        • array: T[]

          The array to convert.

        • idExtractor: ((element) => string)

          A function to extract the id from each array elements.

            • (element): string
            • Parameters

              • element: T

              Returns string

        Returns {
            [id: string]: T;
        }

        the created index signature.

        • [id: string]: T
  • fromArrayValues: (<T, U>(array, idExtractor, valueExtractor) => {
        [id: string]: U;
    })

    Creates an index signature from the given array with every elements mapped using the given valueExtractor.

    Param: array

    The array to convert.

    Param: idExtractor

    A function to extract the id from each array elements.

    Param: valueExtractor

    A mapper function to convert each element of the array from T to U.

    Returns

    the created index signature.

      • <T, U>(array, idExtractor, valueExtractor): {
            [id: string]: U;
        }
      • Creates an index signature from the given array with every elements mapped using the given valueExtractor.

        Type Parameters

        • T

        • U

        Parameters

        • array: T[]

          The array to convert.

        • idExtractor: ((element) => string)

          A function to extract the id from each array elements.

            • (element): string
            • Parameters

              • element: T

              Returns string

        • valueExtractor: ((element) => U)

          A mapper function to convert each element of the array from T to U.

            • (element): U
            • Parameters

              • element: T

              Returns U

        Returns {
            [id: string]: U;
        }

        the created index signature.

        • [id: string]: U
  • groupBy: (<T>(array, indexExtractor) => {
        [index: string]: T[];
    })

    Groups all elements of the given array by the key extracted using the given indexExtractor.

    Param: array

    The array to convert.

    Param: indexExtractor

    The extractor function to extract a key from each element.

    Returns

    an index signature with arrays of values grouped by keys.

      • <T>(array, indexExtractor): {
            [index: string]: T[];
        }
      • Groups all elements of the given array by the key extracted using the given indexExtractor.

        Type Parameters

        • T

        Parameters

        • array: T[]

          The array to convert.

        • indexExtractor: Function1<T, string>

          The extractor function to extract a key from each element.

        Returns {
            [index: string]: T[];
        }

        an index signature with arrays of values grouped by keys.

        • [index: string]: T[]
  • groupByAndMap: (<T, U>(array, indexExtractor, mapper) => {
        [index: string]: U[];
    })

    Apply the given mapping function to every elements and groups all elements of the given array by the key extracted using the given indexExtractor

    Param: array

    The array to convert.

    Param: indexExtractor

    The extractor function to extract a key from each element.

    Param: mapper

    The mapper function.

    Returns

    an index signature with arrays of converted values grouped by keys.

      • <T, U>(array, indexExtractor, mapper): {
            [index: string]: U[];
        }
      • Apply the given mapping function to every elements and groups all elements of the given array by the key extracted using the given indexExtractor

        Type Parameters

        • T

        • U

        Parameters

        • array: T[]

          The array to convert.

        • indexExtractor: Function1<T, string>

          The extractor function to extract a key from each element.

        • mapper: ((element) => U)

          The mapper function.

            • (element): U
            • Parameters

              • element: T

              Returns U

        Returns {
            [index: string]: U[];
        }

        an index signature with arrays of converted values grouped by keys.

        • [index: string]: U[]
  • includes: (<T>(indexSignature, indexSignatures) => boolean)

    Tests whether the given index signature is included into the given array of index signatures.

    Param: indexSignature

    The index signature to compare.

    Param: indexSignature2

    An array of index signatures to test against the first parameter.

    Returns

    true if the given index signatures is included into the array, false otherwise.

      • <T>(indexSignature, indexSignatures): boolean
      • Tests whether the given index signature is included into the given array of index signatures.

        Type Parameters

        • T

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signature to compare.

          • [id: string]: T
        • indexSignatures: {
              [id: string]: T;
          }[]

        Returns boolean

        true if the given index signatures is included into the array, false otherwise.

  • keysToArray: (<T>(indexSignature) => string[])

    Converts an index signature's keys into an array.

    Param: indexSignature

    The index signature to convert.

    Returns

    an array of all keys of the given index signature.

      • <T>(indexSignature): string[]
      • Converts an index signature's keys into an array.

        Type Parameters

        • T

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signature to convert.

          • [id: string]: T

        Returns string[]

        an array of all keys of the given index signature.

  • mapToArray: (<T, U>(indexSignature, mapper, filter?) => U[])

    Apply the provided mapping function to all values of the given index signature, and extract all values into an array.

    Param: indexSignature

    The index signature to map.

    Param: mapper

    The mapper function.

    Param: filter

    (optional) A filter predicate used to filter out unwanted values.

    Returns

    the result array of mapped values.

      • <T, U>(indexSignature, mapper, filter?): U[]
      • Apply the provided mapping function to all values of the given index signature, and extract all values into an array.

        Type Parameters

        • T

        • U

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signature to map.

          • [id: string]: T
        • mapper: ((key, element) => U)

          The mapper function.

            • (key, element): U
            • Parameters

              • key: string
              • element: T

              Returns U

        • Optional filter: ((key, element) => boolean)

          (optional) A filter predicate used to filter out unwanted values.

            • (key, element): boolean
            • Parameters

              • key: string
              • element: T

              Returns boolean

        Returns U[]

        the result array of mapped values.

  • mapValues: (<T, U>(indexSignature, mapper, filter?) => {
        [id: string]: U;
    })

    Apply the provided mapping function to all values of the given index signature, and extract all values into an array.

    Param: indexSignature

    The index signature to map.

    Param: mapper

    The mapper function.

    Param: filter

    (optional) A filter predicate used to filter out unwanted values.

    Returns

    the result array of mapped values.

      • <T, U>(indexSignature, mapper, filter?): {
            [id: string]: U;
        }
      • Apply the provided mapping function to all values of the given index signature, and extract all values into an array.

        Type Parameters

        • T

        • U

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signature to map.

          • [id: string]: T
        • mapper: ((element) => U)

          The mapper function.

            • (element): U
            • Parameters

              • element: T

              Returns U

        • Optional filter: ((element) => boolean)

          (optional) A filter predicate used to filter out unwanted values.

            • (element): boolean
            • Parameters

              • element: T

              Returns boolean

        Returns {
            [id: string]: U;
        }

        the result array of mapped values.

        • [id: string]: U
  • same: (<T>(indexSignature1, indexSignature2) => boolean)

    Tests whether the two given index signatures are equals.

    Param: indexSignature1

    The first index signature to compare.

    Param: indexSignature2

    The second index signature to compare.

    Returns

    true if the index signatures are equal, false otherwise.

      • <T>(indexSignature1, indexSignature2): boolean
      • Tests whether the two given index signatures are equals.

        Type Parameters

        • T

        Parameters

        • indexSignature1: {
              [id: string]: T;
          }

          The first index signature to compare.

          • [id: string]: T
        • indexSignature2: {
              [id: string]: T;
          }

          The second index signature to compare.

          • [id: string]: T

        Returns boolean

        true if the index signatures are equal, false otherwise.

  • toArray: (<T>(indexSignature) => T[])

    Converts an index signature's values into an array.

    Param: indexSignature

    The index signature to convert.

    Returns

    an array of all values of the given index signature.

      • <T>(indexSignature): T[]
      • Converts an index signature's values into an array.

        Type Parameters

        • T

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signature to convert.

          • [id: string]: T

        Returns T[]

        an array of all values of the given index signature.

  • toString: (<T>(indexSignature) => string)

    Converts the given index signature into a string formated as follow:

       { key1: value1, key2: value2, key3: value3, ...}
    

    Param: indexSignature

    The index signature to convert.

    Returns

    a string representation of the given index signature.

      • <T>(indexSignature): string
      • Converts the given index signature into a string formated as follow:

           { key1: value1, key2: value2, key3: value3, ...}
        

        Type Parameters

        • T

        Parameters

        • indexSignature: {
              [id: string]: T;
          }

          The index signature to convert.

          • [id: string]: T

        Returns string

        a string representation of the given index signature.

Generated using TypeDoc