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

edtf

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edtf - npm Package Compare versions

Comparing version 2.7.0 to 2.7.1

6

package.json
{
"name": "edtf",
"version": "2.7.0",
"version": "2.7.1",
"description": "Extended Date Time Format (EDTF) / ISO 8601-2 Parser and Library",

@@ -42,6 +42,6 @@ "main": "index.js",

"chai": "^4.2.0",
"eslint": "^6.3.0",
"eslint": "^6.6.0",
"istanbul": "^0.4.3",
"mocha": "^6.2.0"
"mocha": "^6.2.2"
}
}

@@ -12,3 +12,3 @@ 'use strict'

const { pow, max, min } = Math
const { floor, pow, max, min } = Math

@@ -129,3 +129,4 @@

max([year, month, day]) { // eslint-disable-line complexity
// eslint-disable-next-line complexity
max([year, month, day]) {
if (!year) return []

@@ -186,2 +187,43 @@

// eslint-disable-next-line complexity
min([year, month, day]) {
if (!year) return []
year = Number(
(this.test(Bitmask.YEAR)) ? this.masks([year], '0')[0] : year
)
if (!month) return [year]
month = Number(month) - 1
switch (this.test(Bitmask.MONTH)) {
case Bitmask.MONTH:
case Bitmask.XM:
month = 0
break
case Bitmask.MX:
month = (month < 9) ? 0 : 9
break
}
if (!day) return [year, month]
day = Number(day)
switch (this.test(Bitmask.DAY)) {
case Bitmask.DAY:
day = 1
break
case Bitmask.DX:
day = max(1, floor(day / 10) * 10)
break
case Bitmask.XD:
day = max(1, day % 10)
break
}
return [year, month, day]
}
marks(values, symbol = '?') {

@@ -188,0 +230,0 @@ return values

@@ -186,3 +186,9 @@ 'use strict'

if (unspecified.value) {
values = unspecified.max(values.map(Date.pad))
let bc = values[0] < 0
values = (k < 0) ^ bc ?
unspecified.min(values.map(Date.pad)) :
unspecified.max(values.map(Date.pad))
if (bc) values[0] = -values[0]
}

@@ -189,0 +195,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