Skip to content

extra-array-view 0.0.34

Install from the command line:
Learn more about npm packages
$ npm install @nodef/extra-array-view@0.0.34
Install via package.json:
"@nodef/extra-array-view": "0.0.34"

About this version

An array view is a proxy to an underlying array. πŸ“¦ 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.


const xarrayView = require('extra-array-view');
// import * as xarrayView from "extra-array-view";
// import * as xarrayView from "https://unpkg.com/extra-array-view/index.mjs"; (deno)

var x = [10, 20, 20, 40, 40, 80];
xarrayView.searchValue(x, 40);
// β†’ 3

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 70];
xarrayView.merge(x, y);
// β†’ [ 10, 20, 20, 20, 40, 40, 50, 70, 80 ]

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 70];
var z = [30, 60, 90];
xarrayView.mergeAll([x, y, z]);
// β†’ [ 10, 20, 20, 20, 30, 40, 40, 50, 60, 70, 80, 90 ]

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 70];
xarrayView.isDisjoint(x, y);
// β†’ false

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 80];
xarrayView.intersection(x, y);
// β†’ [ 20, 80 ]


Index

Property Description


References




ORG Coverage Status Test Coverage

Details


Assets

  • extra-array-view-0.0.34.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0