New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

linear-array

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linear-array

Returns an array filed with linearly increasing numbers, starting from 0 up to the given value - 1 (without offset), or from 1 to the value itself (with offset).

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

linear-array

Returns an array filed with linearly increasing numbers, starting from 0 up to the given value - 1 (without offset), or from 1 to the value itself (with offset).

Install

Install with npm:

$ npm install --save linear-array

Usage

Works with safe integers greater than 0.

linearArray(value, [offset])

import linearArray from 'linear-array'; // web

OR;

const linearArray = require('linear-array'); // server

console.log(linearArray(1)); //=> [0]
console.log(linearArray(3)); //=> [0,1,2]
console.log(linearArray(5)); //=> [0,1,2,3,4]

console.log(linearArray(1, true)); //=> [1]
console.log(linearArray(3, true)); //=> [1,2,3]
console.log(linearArray(5, true)); //=> [1,2,3,4,5]

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

License

Copyright © 2020, Ivan Spoljaric. Released under the MIT License.

Keywords

array

FAQs

Package last updated on 24 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts