Skip to content
Ensures you are always dealing with an array.
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dependabot
src
.gitignore
.travis.yml
LICENSE
README.md
package.json
tsconfig.json
yarn.lock

README.md

Always Array

Build Status bundle size install size npm version

Ensures you are always dealing with an array. It uses Array.isArray.

Installation

yarn add always-array
# or with npm
npm i always-array

Usage

Very simple.

import alwaysArray from 'always-array';

alwaysArray('foo'); // ['foo']
alwaysArray(['foo']); // ['foo']
You can’t perform that action at this time.