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

typed-duration

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typed-duration - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "typed-duration",
"version": "1.0.4",
"version": "1.0.5",
"description": "Zero-dependency typed duration library for JavaScript",

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

@@ -55,6 +55,5 @@ # Typed Duration

import { Duration, TimeDuration } from 'typed-duration'
const { milliseconds } = Duration
function executePeriodically(fn: () => void, period: TimeDuration) {
setTimeout(fn, milliseconds.from(period))
setTimeout(fn, Duration.milliseconds.from(period))
}

@@ -93,10 +92,9 @@ ```

import { Duration, MaybeTimeDuration } from 'typed-duration'
const { milliseconds } = Duration
function executePeriodically(fn: () => void, period: MaybeTimeDuration) {
setTimeout(fn, milliseconds.from(period))
setTimeout(fn, Duration.milliseconds.from(period))
}
// You can pass in a typed duration, and it will convert to a number of milliseconds
executePeriodically(doSomething, seconds.from(20))
executePeriodically(doSomething, Duration.seconds.from(20))

@@ -103,0 +101,0 @@ // a number will be allowed by the MaybeTimeDuration type

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