Options
All
  • Public
  • Public/Protected
  • All
Menu

flatten-array-ts

Gitlab: https://gitlab.com/reedrichards-javascript/typescript/flatten-array

Docs: https://reedrichards-javascript.gitlab.io/typescript/flatten-array/index.html

Install

npm install flatten-array-ts

Usage

import flattenArray from 'flattenArray'

flattenArray([[1, 2, 3], [101, 2, 1, 10], [2, 1]])
//  Output: [1, 2, 3, 101, 2, 1, 10, 2, 1]

Development

NPM scripts

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code

Index

Functions

Functions

Const flattenArray

  • flattenArray(items: Array<any>): Array<any>
  • flattenArray recursively flattens array

    Parameters

    • items: Array<any>

      Array to be flattened

      Input: [[1, 2, 3], [101, 2, 1, 10], [2, 1]]

      Output = [1, 2, 3, 101, 2, 1, 10, 2, 1]

    Returns Array<any>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc