Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

incnum

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incnum - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

20

index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.seq = exports.next = void 0;
/**
* put next index into 'current' and returns 'carry-up' position.
*
* the next index are unspecified if;
* - 'ranges.length' were smaller than 'current.length' or smaller than 0,
* - 'ranges' had 0
*
* the 'current' should not be 'const'/'readonly' and mutable.
*
* returned value of 'carry-up' represents position on 'current' nexts index.
*
* if all ranges has gone, 'carry-up' is -1.
*/
function next(current, ranges) {

@@ -17,2 +30,9 @@ let cu = current.length - 1;

exports.next = next;
/**
* enumerates all indexes starts from 'initial' to 'ranges'.
*
* all indexes is unspecified if 'initial' was on out of 'ranges'.
*
* @see next
*/
function seq(initial, ranges) {

@@ -19,0 +39,0 @@ if (!ranges.length || ranges.some(x => x === 0)) {

@@ -0,1 +1,15 @@

/**
* put next index into 'current' and returns 'carry-up' position.
*
* the next index are unspecified if;
* - 'ranges.length' were smaller than 'current.length' or smaller than 0,
* - 'ranges' had 0
*
* the 'current' should not be 'const'/'readonly' and mutable.
*
* returned value of 'carry-up' represents position on 'current' nexts index.
*
* if all ranges has gone, 'carry-up' is -1.
*/
export function next(current: number[], ranges: number[]) {

@@ -13,2 +27,9 @@ let cu = current.length - 1;

/**
* enumerates all indexes starts from 'initial' to 'ranges'.
*
* all indexes is unspecified if 'initial' was on out of 'ranges'.
*
* @see next
*/
export function seq(initial: number[], ranges: number[]) {

@@ -15,0 +36,0 @@ if (!ranges.length || ranges.some(x => x === 0)) {

2

package.json
{
"name": "incnum",
"version": "1.0.5",
"version": "1.0.6",
"description": "increment numbers in array. this can make multiple depth for-loop single.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc