New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

amp-toolbox-cache-list

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amp-toolbox-cache-list - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

22

lib/AmpCaches.js

@@ -19,3 +19,3 @@ /**

const {OneBehindFetch} = require('amp-toolbox-core');
const {oneBehindFetch} = require('amp-toolbox-core');
const CACHE_LIST_ENDPOINT = 'https://cdn.ampproject.org/caches.json';

@@ -31,7 +31,6 @@

*
* @param {Object} [fetchStrategy = OneBehindFetch] The fetch strategy to be used when fetching
* data from the caches endpoint. Defaults to OneBehindFetch.
* @param {Function} fetch - a fetch implementation
*/
constructor(fetchStrategy = OneBehindFetch.create()) {
this.fetchStrategy_ = fetchStrategy;
constructor(fetch=oneBehindFetch) {
this.fetch_ = fetch;
}

@@ -55,10 +54,11 @@

*/
get(cacheId) {
return this.list()
.then((caches) => caches.find((cache) => cache.id === cacheId));
async get(cacheId) {
const caches = await this.list();
return caches.find((cache) => cache.id === cacheId);
}
getCaches_() {
return this.fetchStrategy_.get(CACHE_LIST_ENDPOINT)
.then((json) => json.caches);
async getCaches_() {
const response = await this.fetch_(CACHE_LIST_ENDPOINT);
const data = await response.json();
return data.caches;
}

@@ -65,0 +65,0 @@ }

{
"name": "amp-toolbox-cache-list",
"version": "0.1.5",
"version": "0.1.6",
"description": "Lists AMP Caches",

@@ -15,2 +15,6 @@ "main": "index.js",

],
"files": [
"index.js",
"lib"
],
"author": "AMPHTML Team",

@@ -23,5 +27,5 @@ "license": "Apache-2.0",

"dependencies": {
"amp-toolbox-core": "^0.1.5"
"amp-toolbox-core": "^0.1.6"
},
"gitHead": "0f15452c5a91d97bb54194b70bff3dcaf9f56d0e"
"gitHead": "058a60702136ac24dfd0a4f421877ed23aeee19f"
}
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