linear-array
Advanced tools
+4
-1
| { | ||
| "name": "linear-array", | ||
| "version": "2.0.0", | ||
| "version": "2.1.0", | ||
| "description": "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).", | ||
@@ -20,3 +20,6 @@ "main": "./dist/linear-array.js", | ||
| "increment", | ||
| "natural", | ||
| "sequence", | ||
| "linear", | ||
| "step", | ||
| "increase", | ||
@@ -23,0 +26,0 @@ "from", |
+53
-16
@@ -18,9 +18,6 @@ # linear-array | ||
| ```js | ||
| <script | ||
| type="module" | ||
| src="https://unpkg.com/linear-array@2.0.0/linear-array.js" | ||
| ></script> | ||
| <script type="module" src="https://unpkg.com/linear-array@2.0.0"></script> | ||
| ``` | ||
| ## Importing in project | ||
| ## Importing and using in project | ||
@@ -33,2 +30,6 @@ Since this package can be used on the client side, as `UMD` or `ES6` module, and server side, as `CommonJS` module, there are 2 ways to import it into your .js file: | ||
| const lineArr = require('linear-array'); | ||
| // ... | ||
| linear.isSeqNaturalNumbers([1, 2, 3]); // false | ||
| ``` | ||
@@ -39,3 +40,20 @@ | ||
| ```js | ||
| import lineArr from 'linear-array'; | ||
| import { | ||
| isSeqNaturalNumbers, | ||
| fillSeqNaturalNumbers, | ||
| fillStepSequenceWithOffset, | ||
| isStepSequenceWithOffset, | ||
| } from 'linear-array'; | ||
| // ... | ||
| isSeqNaturalNumbers([0, 1, 2, 3]); // true | ||
| // OR | ||
| import * as lineArr from 'linear-array'; | ||
| // ... | ||
| lineArr.isSeqNaturalNumbers([0, 1, 2, 3]); // true | ||
| ``` | ||
@@ -45,9 +63,28 @@ | ||
| Use the globally available `lineArr` module directly in your code. | ||
| If you imported the `linear-array` library with the `<script>` tag it will be attached to the globally available `window` object. | ||
| It is being imported from the `linear-array` liibrary with the `<script>` tag, and is attached to the globally available `window` variable. | ||
| That's why you can use the module directly in your code by referencing the `lineArr` module directly | ||
| ```html | ||
| <!-- index.html --> | ||
| <html> | ||
| <head> | ||
| <!-- --> | ||
| </head> | ||
| <body> | ||
| <script src="https://unpkg.com/linear-array@2.0.0"></script> | ||
| <script src="custom.js"></script> | ||
| </body> | ||
| </html> | ||
| ``` | ||
| ```js | ||
| // custom.js | ||
| lineArr.isStepSequenceWithOffset([1, 2, 3]); // false | ||
| ``` | ||
| ## Usage | ||
| Currently, there are 4 methods available through the `lineArr` module / namespace. | ||
| Currently, there are 4 methods available in the package. | ||
@@ -149,4 +186,2 @@ Based on the differences in their input and output data types, they can be divided into 2 categories; | ||
| Instead, a module called `lineArr` is imported and it contains a set of methods. See the **Usage** section on what they are and how they are used. | ||
| The closes equivalent to the old `linearArray` method is now `fillSeqNaturalNumbers` | ||
@@ -156,12 +191,14 @@ | ||
| This update has 4 new methods which can be accessed through the `lineArr` module. | ||
| This update has 4 new methods: | ||
| - `lineArr.fillSeqNaturalNumbers` | ||
| - `fillSeqNaturalNumbers` | ||
| - `lineArr.isSeqNaturalNumbers` | ||
| - `isSeqNaturalNumbers` | ||
| - `lineArr.fillStepSequenceWithOffset` | ||
| - `fillStepSequenceWithOffset` | ||
| - `lineArr.isStepSequenceWithOffset` | ||
| - `isStepSequenceWithOffset` | ||
| See the **Usage** section on what they are and how they are used. | ||
| ## About | ||
@@ -168,0 +205,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27911
1.71%246
17.7%0
-100%