@tusbar/cache-control
Advanced tools
Comparing version 0.4.0 to 0.5.0
11
index.js
@@ -17,3 +17,4 @@ const HEADER_REGEXP = /([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?/g | ||
public: 'public', | ||
staleWhileRevalidate: 'stale-while-revalidate' | ||
staleWhileRevalidate: 'stale-while-revalidate', | ||
staleIfError: 'stale-if-error' | ||
} | ||
@@ -30,3 +31,3 @@ | ||
const duration = parseInt(value, 10) | ||
const duration = Number.parseInt(value, 10) | ||
@@ -57,2 +58,3 @@ if (!Number.isFinite(duration) || duration < 0) { | ||
this.staleWhileRevalidate = null | ||
this.staleIfError = null | ||
} | ||
@@ -102,2 +104,3 @@ | ||
this.staleWhileRevalidate = parseDuration(values[STRINGS.staleWhileRevalidate]) | ||
this.staleIfError = parseDuration(values[STRINGS.staleIfError]) | ||
@@ -170,2 +173,6 @@ return this | ||
if (typeof this.staleIfError === 'number') { | ||
tokens.push(`${STRINGS.staleIfError}=${this.staleIfError}`) | ||
} | ||
return tokens.join(', ') | ||
@@ -172,0 +179,0 @@ } |
{ | ||
"name": "@tusbar/cache-control", | ||
"public": true, | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Format and parse HTTP Cache-Control header", | ||
@@ -24,5 +24,5 @@ "main": "index.js", | ||
"codecov": "^3.0.0", | ||
"lerna-changelog": "1.0.0", | ||
"lerna-changelog": "1.0.1", | ||
"nyc": "^15.0.0", | ||
"xo": "^0.25.3" | ||
"xo": "^0.33.0" | ||
}, | ||
@@ -37,3 +37,6 @@ "nyc": { | ||
"semicolon": false, | ||
"space": 2 | ||
"space": 2, | ||
"rules": { | ||
"unicorn/no-reduce": "off" | ||
} | ||
}, | ||
@@ -40,0 +43,0 @@ "changelog": { |
@@ -46,2 +46,3 @@ # cache-control [![CircleCI](https://circleci.com/gh/tusbar/cache-control.svg?style=svg)](https://circleci.com/gh/tusbar/cache-control) | ||
public: true, | ||
staleIfError: null, | ||
staleWhileRevalidate: null } | ||
@@ -48,0 +49,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9503
155
101