Browse Source

Throw error if header arg is missing

header-formatting
Luke Childs 8 years ago
parent
commit
4a793f4cdc
  1. 5
      src/index.js

5
src/index.js

@ -11,6 +11,11 @@ expired.in = (headers, date = new Date()) => differenceInMilliseconds(expired.on
// Returns date when cache will expire
expired.on = headers => {
// Check we have headers
if (!headers) {
throw new Error('Headers argument is required');
}
// Parse headers if we got a raw string
headers = (typeof headers === 'string') ? parse(headers) : headers;

Loading…
Cancel
Save