@ionic/utils-array

  • Version 2.1.5
  • Published
  • 13 kB
  • 2 dependencies
  • MIT license

Install

npm i @ionic/utils-array
yarn add @ionic/utils-array
pnpm add @ionic/utils-array

Overview

Array utils

Index

Functions

function concurrentFilter

concurrentFilter: <T>(
array: T[],
callback: (currentValue: T) => Promise<boolean>
) => Promise<T[]>;

    function conform

    conform: <T>(t?: T | T[]) => T[];

      function filter

      filter: {
      <T>(
      array: T[],
      callback: (
      currentValue: T,
      currentIndex: number,
      array: readonly T[]
      ) => Promise<boolean>
      ): Promise<T[]>;
      <T>(
      array: readonly T[],
      callback: (
      currentValue: T,
      currentIndex: number,
      array: readonly T[]
      ) => Promise<boolean>
      ): Promise<readonly T[]>;
      };

        function map

        map: {
        <T, U>(
        array: T[],
        callback: (
        currentValue: T,
        currentIndex: number,
        array: readonly T[]
        ) => Promise<U>
        ): Promise<U[]>;
        <T, U>(
        array: T[],
        callback: (
        currentValue: T,
        currentIndex: number,
        array: readonly T[]
        ) => Promise<U>
        ): Promise<readonly U[]>;
        <T, U>(
        array: readonly T[],
        callback: (
        currentValue: T,
        currentIndex: number,
        array: readonly T[]
        ) => Promise<U>
        ): Promise<U[]>;
        <T, U>(
        array: readonly T[],
        callback: (
        currentValue: T,
        currentIndex: number,
        array: readonly T[]
        ) => Promise<U>
        ): Promise<readonly U[]>;
        };

          function move

          move: <T>(array: readonly T[], fromIndex: number, toIndex: number) => T[];
          • Move an item in an array by index.

            This function will return a new array with the item in the fromIndex position moved to the toIndex position. If fromIndex or toIndex are out of bounds, the array items remain unmoved.

          function reduce

          reduce: {
          <T>(
          array: T[],
          callback: (
          accumulator: T,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<T>
          ): Promise<T>;
          <T>(
          array: T[],
          callback: (
          accumulator: T,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<T>,
          initialValue: T
          ): Promise<T>;
          <T, R>(
          array: T[],
          callback: (
          accumulator: R,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<R>
          ): Promise<R>;
          <T, U>(
          array: T[],
          callback: (
          accumulator: U,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<U>,
          initialValue: U
          ): Promise<U>;
          <T>(
          array: readonly T[],
          callback: (
          accumulator: T,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<T>
          ): Promise<T>;
          <T>(
          array: readonly T[],
          callback: (
          accumulator: T,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<T>,
          initialValue: T
          ): Promise<T>;
          <T, R>(
          array: readonly T[],
          callback: (
          accumulator: R,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<R>
          ): Promise<R>;
          <T, U>(
          array: readonly T[],
          callback: (
          accumulator: U,
          currentValue: T,
          currentIndex: number,
          array: readonly T[]
          ) => Promise<U>,
          initialValue: U
          ): Promise<U>;
          };

            function replace

            replace: <T>(array: readonly T[], index: number, item: T) => T[];
            • Replace an item in an array by index.

              This function will return a new array with the item in the index position replaced with item. If index is out of bounds, the item is not replaced.

            function splice

            splice: <T>(
            array: readonly T[],
            start: number,
            deleteCount?: number,
            ...items: T[]
            ) => T[];
            • Splice an array.

              This function will return a new array with the standard splice behavior applied. Unlike the standard array splice, the array of removed items is not returned.

            Package Files (1)

            Dependencies (2)

            Dev Dependencies (9)

            Peer Dependencies (0)

            No peer dependencies.

            Badge

            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@ionic/utils-array.

            • Markdown
              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@ionic/utils-array)
            • HTML
              <a href="https://www.jsdocs.io/package/@ionic/utils-array"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>