New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

date-frequency

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-frequency - npm Package Compare versions

Comparing version 0.2.6 to 0.3.0

16

lib/frequency.js

@@ -171,2 +171,18 @@ var util = require('./util'),

Frequency.prototype.compare = function (frequency) {
// warning: only compares those units that appear in both frequencies, with both the same scope!
for (var i = 0;i < util.unit.order.length;i++) {
var unit = util.unit.order[i];
if (this.rules[unit] && frequency.rules[unit] && this.rules[unit].scope === frequency.rules[unit].scope) {
if (this.rules[unit].fix < frequency.rules[unit].fix) {
return -1;
} else if (this.rules[unit].fix > frequency.rules[unit].fix) {
return 1;
}
}
}
return 0;
};
Frequency.prototype.toString = function () {

@@ -173,0 +189,0 @@ var str = 'F',

10

lib/util/unit.js

@@ -5,4 +5,3 @@ var rest = require('lodash.rest'),

var order = ['Y', 'M', 'D', 'h', 'm', 's'],
names = {
var names = {
'year': 'Y',

@@ -18,2 +17,3 @@ 'month': 'M',

var util = {
order: ['Y', 'M', 'D', 'h', 'm', 's'],
defaults: {

@@ -38,3 +38,3 @@ 'M': 1,

if (indexof(order.concat(['W']), unit) < 0) {
if (indexof(util.order.concat(['W']), unit) < 0) {
return undefined;

@@ -51,6 +51,6 @@ }

lower: function (unit) {
return rest(order, indexof(order, unit) + 1);
return rest(util.order, indexof(util.order, unit) + 1);
},
higher: function (unit) {
return first(order, indexof(order, unit));
return first(util.order, indexof(util.order, unit));
},

@@ -57,0 +57,0 @@ between: function (left, right) {

{
"name": "date-frequency",
"version": "0.2.6",
"version": "0.3.0",
"description": "Temporal frequency library",

@@ -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