
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
Various transforms for ranges of array/list indices. [npm search keywords: bounds confine enumerate index indexes map modulo translate validate warp]
Various transforms for ranges of array/list indices.
see test/usage.js
var arraynge = require('arraynge');
range = arraynge();
range = arraynge(from, upto); // range includes both values
range = arraynge(from, upto, list);
makeRangeFromList = arraynge.withThisList.bind(list);
range = makeRangeFromList(from, upto);
list.makeRange = arraynge.withThisList;
range = list.makeRange(from, upto);
The config functions return the arraynge they were called on, so you can chain them.
range.bounds(newFirstIndex, newLastIndex);
range.from(newFirstIndex);
range.upto(newLastIndex);
range.list(null || false); // forget current list
range.list(someObject); // set new list
range.list(someNumber); // set list to object { length: someNumber }
range.toString(); // -> (string) description
range.bounds(); // -> (array) [from, upto]
range.from(); // -> (any) from
range.upto(); // -> (any) upto
range.list(); // -> (object | false) list
range.len(); // -> (number) list.length or 0
Parameter max or len is optional. If provided, it should be a number.
(Maximum valid integer index for your list, or the list's length.)
If not provided or undefined, it is calculated from .len().
range.trueMax(max); // index === true? set to max.
range.warpZero(len); // index negative? += len. still neg? set to false.
range.modulo(len); // warp indices into range [0 <= x < len]
range.confine(max); // index negative? set to 0. too large? set to max.
range.validateBounds(max); // negative or too large? set to false.
range.translate(bothDist); // add same offset to both
range.translate(fromDist, lastDist); // add offsets to each
false.len or max optional as above.range.boundsIfValid(max); // array [from, upto]
range.enumerate(); // array of numbers {from <= x <= upto}, step size = 1
range.map(iter); // numbers like .enumerate but collect iter(list[x], x)
ISC
FAQs
Various transforms for ranges of array/list indices. [npm search keywords: bounds confine enumerate index indexes map modulo translate validate warp]
We found that arraynge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.