New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@builtwithjavascript/countdown

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builtwithjavascript/countdown - npm Package Compare versions

Comparing version
1.0.9
to
1.1.0
+1
-1
dist/countdown.es.js

@@ -37,3 +37,3 @@ var d = Object.defineProperty;

year: e.getFullYear(),
month: e.getMonth(),
month: e.getMonth() + 1,
day: e.getDate(),

@@ -40,0 +40,0 @@ hours: e.getHours(),

@@ -1,1 +0,1 @@

(function(i,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(i=typeof globalThis<"u"?globalThis:i||self,s(i.countdown={}))})(this,function(i){"use strict";var g=Object.defineProperty;var y=(i,s,d)=>s in i?g(i,s,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[s]=d;var u=(i,s,d)=>y(i,typeof s!="symbol"?s+"":s,d);class s{constructor(t){u(this,"intervalId");u(this,"callback");u(this,"isRunning",!1);this.callback=t}calculateRemainingTime(t,e){const n=t.getTime()-e.getTime();let a;if(n<=0)a={days:0,hours:0,minutes:0,seconds:0,totalMilliseconds:0,isFinished:!0};else{const l=Math.floor(n/864e5),f=Math.floor(n%(1e3*60*60*24)/(1e3*60*60)),h=Math.floor(n%(1e3*60*60)/(1e3*60)),m=Math.ceil(n%(1e3*60)/1e3);a={days:l,hours:f,minutes:h,seconds:m,totalMilliseconds:n,isFinished:!1}}const r={year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),weekDay:e.getDay()};return{timeRemaining:a,currentTime:r}}start(t){if(this.isRunning)return;this.isRunning=!0;const e=()=>{const n=new Date,a=this.calculateRemainingTime(t,n);this.callback(a),a.timeRemaining.isFinished&&this.stop();let l=1e3-n.getMilliseconds();l<10&&(l+=1e3),this.intervalId=window.setTimeout(e,Math.max(1,l))};e()}stop(){this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=void 0),this.isRunning=!1}}function d(o){let t=o.seconds,e=o.minutes,n=o.hours,a=o.days;if(t===60&&(t=0,e++,e===60&&(e=0,n++,n===24&&(n=0,a++))),o.isFinished)return"00:00:00:00";const r=l=>l.toString().padStart(2,"0");return`${r(a)}:${r(n)}:${r(e)}:${r(t)}`}function c(o){const t=a=>a.toString().padStart(2,"0");let e=`${t(o.year)}:${t(o.month)}:${t(o.day)}`,n=`${t(o.hours)}:${t(o.minutes)}:${t(o.seconds)}`;return`${e} ${n}`}i.Countdown=s,i.formatCurrentTime=c,i.formatTimeRemaining=d,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
(function(i,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(i=typeof globalThis<"u"?globalThis:i||self,s(i.countdown={}))})(this,function(i){"use strict";var g=Object.defineProperty;var y=(i,s,d)=>s in i?g(i,s,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[s]=d;var u=(i,s,d)=>y(i,typeof s!="symbol"?s+"":s,d);class s{constructor(t){u(this,"intervalId");u(this,"callback");u(this,"isRunning",!1);this.callback=t}calculateRemainingTime(t,e){const n=t.getTime()-e.getTime();let a;if(n<=0)a={days:0,hours:0,minutes:0,seconds:0,totalMilliseconds:0,isFinished:!0};else{const l=Math.floor(n/864e5),f=Math.floor(n%(1e3*60*60*24)/(1e3*60*60)),h=Math.floor(n%(1e3*60*60)/(1e3*60)),m=Math.ceil(n%(1e3*60)/1e3);a={days:l,hours:f,minutes:h,seconds:m,totalMilliseconds:n,isFinished:!1}}const r={year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),weekDay:e.getDay()};return{timeRemaining:a,currentTime:r}}start(t){if(this.isRunning)return;this.isRunning=!0;const e=()=>{const n=new Date,a=this.calculateRemainingTime(t,n);this.callback(a),a.timeRemaining.isFinished&&this.stop();let l=1e3-n.getMilliseconds();l<10&&(l+=1e3),this.intervalId=window.setTimeout(e,Math.max(1,l))};e()}stop(){this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=void 0),this.isRunning=!1}}function d(o){let t=o.seconds,e=o.minutes,n=o.hours,a=o.days;if(t===60&&(t=0,e++,e===60&&(e=0,n++,n===24&&(n=0,a++))),o.isFinished)return"00:00:00:00";const r=l=>l.toString().padStart(2,"0");return`${r(a)}:${r(n)}:${r(e)}:${r(t)}`}function c(o){const t=a=>a.toString().padStart(2,"0");let e=`${t(o.year)}:${t(o.month)}:${t(o.day)}`,n=`${t(o.hours)}:${t(o.minutes)}:${t(o.seconds)}`;return`${e} ${n}`}i.Countdown=s,i.formatCurrentTime=c,i.formatTimeRemaining=d,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
{
"name": "@builtwithjavascript/countdown",
"version": "1.0.9",
"version": "1.1.0",
"description": "Accurate countdown",

@@ -5,0 +5,0 @@ "author": "Damiano Fusco",