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

expired

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expired - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "expired",
"version": "1.2.0",
"version": "1.2.1",
"description": "Calculate when HTTP responses expire from the cache headers",

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

@@ -31,9 +31,9 @@ # expired

expired(headers)
expired(headers);
// false
expired.in(headers)
expired.in(headers);
// 500000
expired.on(headers)
expired.on(headers);
// Date('2016-12-23T05:55:31.000Z')

@@ -43,9 +43,9 @@

expired(headers)
expired(headers);
// true
expired.in(headers)
expired.in(headers);
// -100000
expired.on(headers)
expired.on(headers);
// Date('2016-12-23T05:55:31.000Z')

@@ -56,3 +56,3 @@

Response headers are parsed into an object by many HTTP modules. `expired` will also accept a parsed header object:
Many HTTP modules will parse response headers into an object for you. `expired` will also accept headers in this format:

@@ -74,3 +74,3 @@ ```js

expired(headers)
expired(headers);
// false

@@ -89,5 +89,5 @@ ```

expired(headers, date)
expired.in(headers, date)
expired.on(headers)
expired(headers, date);
expired.in(headers, date);
expired.on(headers);
```

@@ -94,0 +94,0 @@

@@ -22,3 +22,3 @@ import test from 'ava';

const headers = {
date: subSeconds(new Date().toUTCString(), 500),
date: subSeconds(new Date(), 500).toUTCString(),
age: 0,

@@ -25,0 +25,0 @@ 'cache-control': 'public, max-age=300'

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