Socket
Socket
Sign inDemoInstall

intervals-fn

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intervals-fn - npm Package Compare versions

Comparing version 2.8.3 to 2.8.4

3

dist/lib.js

@@ -347,2 +347,3 @@ "use strict";

};
const sortNumbers = (arr) => [...arr].sort((a, b) => a - b);
const splitCurry = (splitIndexes, intervals) => {

@@ -354,3 +355,3 @@ const typeStr = getType(intervals);

}
return splitGen([...splitIndexes].sort(), intervalSE).map(convertTo(typeStr));
return splitGen(sortNumbers(splitIndexes), intervalSE).map(convertTo(typeStr));
};

@@ -357,0 +358,0 @@ function split(splitIndexes, interv) {

@@ -417,9 +417,9 @@ "use strict";

ava_1.default('will split with multiple indexes', t => {
const r1 = [{ start: 0, end: 10, test: 'foo' }];
const r2 = [2, 8];
const r1 = [{ start: 0, end: 15, test: 'foo' }];
const r2 = [5, 11];
const res = lib_1.split(r2, r1);
t.is(res.length, 3);
testInterval(t, res[0], [0, 2], { test: 'foo' });
testInterval(t, res[1], [2, 8], { test: 'foo' });
testInterval(t, res[2], [8, 10], { test: 'foo' });
testInterval(t, res[0], [0, 5], { test: 'foo' });
testInterval(t, res[1], [5, 11], { test: 'foo' });
testInterval(t, res[2], [11, 15], { test: 'foo' });
});

@@ -331,2 +331,3 @@ var __rest = (this && this.__rest) || function (s, e) {

};
const sortNumbers = (arr) => [...arr].sort((a, b) => a - b);
const splitCurry = (splitIndexes, intervals) => {

@@ -338,3 +339,3 @@ const typeStr = getType(intervals);

}
return splitGen([...splitIndexes].sort(), intervalSE).map(convertTo(typeStr));
return splitGen(sortNumbers(splitIndexes), intervalSE).map(convertTo(typeStr));
};

@@ -341,0 +342,0 @@ export function split(splitIndexes, interv) {

@@ -415,9 +415,9 @@ import test from 'ava';

test('will split with multiple indexes', t => {
const r1 = [{ start: 0, end: 10, test: 'foo' }];
const r2 = [2, 8];
const r1 = [{ start: 0, end: 15, test: 'foo' }];
const r2 = [5, 11];
const res = split(r2, r1);
t.is(res.length, 3);
testInterval(t, res[0], [0, 2], { test: 'foo' });
testInterval(t, res[1], [2, 8], { test: 'foo' });
testInterval(t, res[2], [8, 10], { test: 'foo' });
testInterval(t, res[0], [0, 5], { test: 'foo' });
testInterval(t, res[1], [5, 11], { test: 'foo' });
testInterval(t, res[2], [11, 15], { test: 'foo' });
});
{
"name": "intervals-fn",
"version": "2.8.3",
"version": "2.8.4",
"description": "Manipulate intervals in a functional way",

@@ -5,0 +5,0 @@ "main": "dist/lib.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