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.4.2 to 0.4.3

27

lib/frequency.js

@@ -221,10 +221,23 @@ 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;
var unit = util.unit.order[i],
rule1 = this.rules[unit],
rule2 = frequency.rules[unit];
if (!rule1 && rule2) {
return -1;
} else if (rule1 && !rule2) {
return 1;
} else if (rule1 && rule2) {
var scope = rule1.scope;
if (scope === rule2.scope) {
var value1 = this.getValue(unit, scope),
value2 = frequency.getValue(unit, scope);
if (value1 < value2) {
return -1;
} else if (value1 > value2) {
return 1;
}
}

@@ -231,0 +244,0 @@ }

{
"name": "date-frequency",
"version": "0.4.2",
"version": "0.4.3",
"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