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

iso8601-duration

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iso8601-duration - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

14

lib/index.js

@@ -24,2 +24,12 @@ 'use strict';

var defaultDuration = Object.freeze({
years: 0,
months: 0,
weeks: 0,
days: 0,
hours: 0,
minutes: 0,
seconds: 0
});
/**

@@ -50,2 +60,4 @@ * The ISO8601 regex for matching / testing durations

var end = exports.end = function end(duration, startDate) {
duration = Object.assign({}, defaultDuration, duration);
// Create two equal timestamps, add duration to 'then' and return time difference

@@ -76,2 +88,4 @@ var timestamp = startDate ? startDate.getTime() : Date.now();

var toSeconds = exports.toSeconds = function toSeconds(duration, startDate) {
duration = Object.assign({}, defaultDuration, duration);
var timestamp = startDate ? startDate.getTime() : Date.now();

@@ -78,0 +92,0 @@ var now = new Date(timestamp);

2

package.json
{
"name": "iso8601-duration",
"version": "1.2.0",
"version": "1.3.0",
"description": "Node/Js-module for parsing and making sense of ISO8601-durations",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -19,2 +19,12 @@ /**

const defaultDuration = Object.freeze({
years: 0,
months: 0,
weeks: 0,
days: 0,
hours: 0,
minutes: 0,
seconds: 0
})
/**

@@ -45,2 +55,4 @@ * The ISO8601 regex for matching / testing durations

export const end = (duration, startDate) => {
duration = Object.assign({}, defaultDuration, duration)
// Create two equal timestamps, add duration to 'then' and return time difference

@@ -71,2 +83,4 @@ const timestamp = (startDate ? startDate.getTime() : Date.now())

export const toSeconds = (duration, startDate) => {
duration = Object.assign({}, defaultDuration, duration)
const timestamp = (startDate ? startDate.getTime() : Date.now())

@@ -73,0 +87,0 @@ const now = new Date(timestamp)

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