Gathering detailed insights and metrics for extra-sorted-array.web
Gathering detailed insights and metrics for extra-sorted-array.web
A sorted array is a collection of values, arranged in an order.
npm install extra-sorted-array.web
Typescript
Module System
Node Version
NPM Version
70
Supply Chain
98.8
Quality
77.1
Maintenance
100
Vulnerability
100
License
TypeScript (74.78%)
JavaScript (25.22%)
Total Downloads
8,041
Last Day
3
Last Week
32
Last Month
155
Last Year
1,774
21 Commits
3 Watching
2 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.1.0
Package Id
extra-sorted-array.web@1.1.0
Unpacked Size
50.72 kB
Size
12.76 kB
File Count
6
NPM Version
10.8.3
Node Version
22.9.0
Publised On
29 Sept 2024
Cumulative downloads
Total Downloads
Last day
-50%
3
Compared to previous day
Last week
-11.1%
32
Compared to previous week
Last month
14.8%
155
Compared to previous month
Last year
-71.7%
1,774
Compared to previous year
A sorted array is a collection of values, arranged in an order.
📦 Node.js,
🌐 Web,
📜 Files,
📰 Docs,
📘 Wiki.
This package includes comprehensive set of functions that operate on a sorted array with which you can search a value using binary search, merge multiple sorted arrays, or perform set operations upon it.
We use a consistent naming scheme that helps you quickly identify the functions
you need. All functions except from*()
take array as 1st parameter. Some
functions operate on a specified range in the array and are called ranged*()
,
such as rangedMerge()
. Functions like slice()
are pure and do not modify the
array itself, while functions like slice$()
do modify (update) the array
itself. Some functions accept a map function in addition to a compare function.
Further, functions which return an iterable instead of an array are prefixed
with i
, such as isubsequences()
. We borrow some names from other programming
languages such as Haskell, Python, Java, and Processing.
With this package, you can simplify the implementation of complex algorithms,
and be able to achieve your goals faster, regardless of your level of expertise.
Try it out today and discover how it can transform your development experience!
This package is available in Node.js and Web formats. To use it on the web,
simply use the extra_sorted_array
global variable after loading with a
<script>
tag from the jsDelivr CDN.
Stability: Experimental.
1const xsortedArray = require('extra-sorted-array'); 2// import * as xsortedArray from "extra-sorted-array"; 3// import * as xsortedArray from "https://unpkg.com/extra-sorted-array/index.mjs"; (deno) 4 5var x = [10, 20, 20, 40, 40, 80]; 6xsortedArray.searchValue(x, 40); 7// → 3 8 9var x = [10, 20, 20, 40, 40, 80]; 10var y = [20, 50, 70]; 11xsortedArray.merge(x, y); 12// → [ 10, 20, 20, 20, 40, 40, 50, 70, 80 ] 13 14var x = [10, 20, 20, 40, 40, 80]; 15var y = [20, 50, 70]; 16var z = [30, 60, 90]; 17xsortedArray.mergeAll([x, y, z]); 18// → [ 10, 20, 20, 20, 30, 40, 40, 50, 60, 70, 80, 90 ] 19 20var x = [10, 20, 20, 40, 40, 80]; 21var y = [20, 50, 70]; 22xsortedArray.isDisjoint(x, y); 23// → false 24 25var x = [10, 20, 20, 40, 40, 80]; 26var y = [20, 50, 80]; 27xsortedArray.intersection(x, y); 28// → [ 20, 80 ]
Property | Description |
---|---|
includes | Check if sorted array has a value using binary search. |
hasValue | Check if sorted array has a value using binary search. |
indexOf | Find first index of value using binary search. |
lastIndexOf | Find last index of value using binary search. |
searchValue | Find first index of value using binary search. |
searchValueRight | Find last index of a value using binary search. |
searchValueAny | Find any index of a value using binary search. |
searchClosestValue | Find index of closest value using binary search. |
merge | Merge values from two sorted arrays. |
mergeAll | Merge values from sorted arrays. |
isUnique | Examine if there are no duplicate values. |
isDisjoint | Examine if arrays have no value in common. |
unique | Remove duplicate values. |
union | Obtain values present in any sorted array. |
intersection | Obtain values present in both sorted arrays. |
difference | Obtain values not present in another sorted array. |
symmetricDifference | Obtain values present in either sorted array but not both. |
No vulnerabilities found.
No security vulnerabilities found.