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

date-streaks

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-streaks - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

4

dist/helpers.js

@@ -27,4 +27,4 @@ 'use strict';

return dates.sort(function (a, b) {
return (0, _moment2.default)(b).diff((0, _moment2.default)(a)) > 0 ? 0 : 1;
});
return (0, _moment2.default)((0, _moment2.default)(b).startOf('day')).format('X') - (0, _moment2.default)((0, _moment2.default)(a).startOf('day')).format('X');
}).reverse();
};
{
"name": "date-streaks",
"version": "1.1.1",
"version": "1.1.2",
"description": "Find a variety of streak metrics from a list of dates.",

@@ -11,3 +11,10 @@ "main": "./dist/index.js",

},
"keywords": ["streak", "streaks", "date", "days", "dates", "day"],
"keywords": [
"streak",
"streaks",
"date",
"days",
"dates",
"day"
],
"author": "Jon Samp",

@@ -14,0 +21,0 @@ "license": "ISC",

@@ -41,2 +41,21 @@ var moment = require('moment');

});
it('should report a streak longer than 10 days', () => {
var longStreak = summary({
dates: [
new Date('08/19/2018'),
new Date('08/18/2018'),
new Date('08/17/2018'),
new Date('08/16/2018'),
new Date('08/15/2018'),
new Date('08/14/2018'),
new Date('08/13/2018'),
new Date('08/12/2018'),
new Date('08/11/2018'),
new Date('08/10/2018'),
new Date('08/09/2018')
]
});
expect(longStreak.longestStreak).to.equal(11);
});
});

@@ -43,0 +62,0 @@

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