prismic-javascript
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"devDependencies": { | ||
@@ -45,5 +45,5 @@ "chai": "^4.1.1", | ||
"dependencies": { | ||
"cross-fetch": "^2.2.0", | ||
"cross-fetch": "^2.2.3", | ||
"promise-polyfill": "8.0.0" | ||
} | ||
} |
@@ -1,18 +0,1 @@ | ||
import { Agent as HttpAgent } from 'http'; | ||
import { Agent as HttpsAgent } from 'https'; | ||
// default agent to use see https://nodejs.org/api/http.html#http_class_http_agent for more options | ||
const httpAgent = new HttpAgent({ | ||
keepAlive: true, | ||
maxSockets: 20, | ||
}); | ||
const httpsAgent = new HttpsAgent({ | ||
keepAlive: true, | ||
maxSockets: 20, | ||
}); | ||
function changeAgent(parsedUrl: any) { | ||
return (parsedUrl.protocol === 'http:') ? httpAgent : httpsAgent; | ||
} | ||
interface Task { | ||
@@ -37,4 +20,2 @@ url: string; | ||
fetchOptions.agent = options.proxyAgent; | ||
} else { | ||
fetchOptions.agent = changeAgent; | ||
} | ||
@@ -54,10 +35,11 @@ | ||
}); | ||
} else { | ||
return xhr.json().then((result) => { | ||
const cacheControl = xhr.headers.get('cache-control'); | ||
const parsedCacheControl = cacheControl ? /max-age=(\d+)/.exec(cacheControl) : null; | ||
const ttl = parsedCacheControl ? parseInt(parsedCacheControl[1], 10) : undefined; | ||
callback(null, result, xhr, ttl); | ||
}); | ||
} | ||
return xhr.json().then((result) => { | ||
const cacheControl = xhr.headers.get('cache-control'); | ||
const parsedCacheControl = cacheControl ? /max-age=(\d+)/.exec(cacheControl) : null; | ||
const ttl = parsedCacheControl ? parseInt(parsedCacheControl[1], 10) : undefined; | ||
callback(null, result, xhr, ttl); | ||
}); | ||
}).catch(callback); | ||
@@ -64,0 +46,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
27
27
1674888
9967
Updatedcross-fetch@^2.2.3