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

orderiom-api-package

Package Overview
Dependencies
Maintainers
0
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orderiom-api-package - npm Package Compare versions

Comparing version 0.4.77 to 0.4.78

2

package.json
{
"name": "orderiom-api-package",
"version": "0.4.77",
"version": "0.4.78",
"description": "This package will install all necessary API calls for every orderiom restaurant",

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

@@ -104,2 +104,35 @@ import { commonErrorCallback, restaurantIdEnv, $http } from '../common';

},
// Delete older caches of index.html file manually because workbox can't do it properly
async deleteOlderIndexCaches() {
// get all the cache storages for this website
return caches.keys().then(res => {
if(!res.length) return;
// get the first cache storages for this website
return caches.open(res[0]).then(cache => {
// get all the cached requests
return cache.keys().then(requests => {
// get all the cached requests that is related to index.html
const indexCaches = requests.filter(request => request.url.includes('index.html'))
// If there is only one cached request for index.html then no need to do anything
if(indexCaches.length <= 1) return;
return Promise.all(indexCaches.map(async indexCache => {
// Get the last modified time for all cache requests of index.html
return cache.match(indexCache).then(response => {
if(!response) return;
indexCache.lastModified = new Date(response.headers.get('Last-Modified')).getTime()
})
})).then(() => {
// Delete the older caches of index.html
indexCaches.sort((a, b) => b.lastModified - a.lastModified)
const olderIndexCaches = indexCaches.slice(1, indexCaches.length)
return Promise.all(olderIndexCaches.map(olderIndexCache => {
return cache.delete(olderIndexCache);
}))
})
})
})
})
},
contact({ }, data) {

@@ -106,0 +139,0 @@ return $http.post('api/contact', data).then((res) => {

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