Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

workbox-cacheable-response

Package Overview
Dependencies
Maintainers
4
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-cacheable-response - npm Package Compare versions

Comparing version 3.6.2 to 4.0.0-alpha.0

87

build/workbox-cacheable-response.dev.js

@@ -6,21 +6,12 @@ this.workbox = this.workbox || {};

try {
self.workbox.v['workbox:cacheable-response:3.6.2'] = 1;
self.workbox.v['workbox:cacheable-response:4.0.0-alpha.0'] = 1;
} catch (e) {} // eslint-disable-line
/*
Copyright 2017 Google Inc.
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
/**

@@ -34,2 +25,3 @@ * This class allows you to set up rules determining what

*/
class CacheableResponse {

@@ -82,3 +74,2 @@ /**

}
/**

@@ -93,2 +84,4 @@ * Checks a response to see whether it's cacheable or not, based on this

*/
isResponseCacheable(response) {

@@ -119,3 +112,2 @@ {

logger_mjs.logger.groupCollapsed(`The request for ` + `'${getFriendlyURL_mjs.getFriendlyURL(response.url)}' returned a response that does ` + `not meet the criteria for being cached.`);
logger_mjs.logger.groupCollapsed(`View cacheability criteria here.`);

@@ -125,3 +117,2 @@ logger_mjs.logger.unprefixed.log(`Cacheable statuses: ` + JSON.stringify(this._statuses));

logger_mjs.logger.groupEnd();
const logFriendlyHeaders = {};

@@ -131,3 +122,2 @@ response.headers.forEach((value, key) => {

});
logger_mjs.logger.groupCollapsed(`View response status and headers here.`);

@@ -137,3 +127,2 @@ logger_mjs.logger.unprefixed.log(`Response status: ` + response.status);

logger_mjs.logger.groupEnd();
logger_mjs.logger.groupCollapsed(`View full response details here.`);

@@ -143,3 +132,2 @@ logger_mjs.logger.unprefixed.log(response.headers);

logger_mjs.logger.groupEnd();
logger_mjs.logger.groupEnd();

@@ -151,17 +139,12 @@ }

}
}
/*
Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
/**

@@ -174,2 +157,3 @@ * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it

*/
class Plugin {

@@ -193,3 +177,2 @@ /**

}
/**

@@ -201,40 +184,30 @@ * @param {Object} options

*/
cacheWillUpdate({ response }) {
cacheWillUpdate({
response
}) {
if (this._cacheableResponse.isResponseCacheable(response)) {
return response;
}
return null;
}
}
/*
Copyright 2017 Google Inc.
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
/*
Copyright 2017 Google Inc.
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/

@@ -241,0 +214,0 @@

@@ -1,3 +0,3 @@

this.workbox=this.workbox||{},this.workbox.cacheableResponse=function(t){"use strict";try{self.workbox.v["workbox:cacheable-response:3.6.2"]=1}catch(t){}class s{constructor(t={}){this.t=t.statuses,this.s=t.headers}isResponseCacheable(t){let s=!0;return this.t&&(s=this.t.includes(t.status)),this.s&&s&&(s=Object.keys(this.s).some(s=>t.headers.get(s)===this.s[s])),s}}return t.CacheableResponse=s,t.Plugin=class{constructor(t){this.e=new s(t)}cacheWillUpdate({response:t}){return this.e.isResponseCacheable(t)?t:null}},t}({});
this.workbox=this.workbox||{},this.workbox.cacheableResponse=function(t){"use strict";try{self.workbox.v["workbox:cacheable-response:4.0.0-alpha.0"]=1}catch(t){}class s{constructor(t={}){this.t=t.statuses,this.s=t.headers}isResponseCacheable(t){let s=!0;return this.t&&(s=this.t.includes(t.status)),this.s&&s&&(s=Object.keys(this.s).some(s=>t.headers.get(s)===this.s[s])),s}}return t.CacheableResponse=s,t.Plugin=class{constructor(t){this.e=new s(t)}cacheWillUpdate({response:t}){return this.e.isResponseCacheable(t)?t:null}},t}({});
//# sourceMappingURL=workbox-cacheable-response.prod.js.map
{
"name": "workbox-cacheable-response",
"version": "3.6.2",
"license": "Apache-2.0",
"version": "4.0.0-alpha.0",
"license": "MIT",
"author": "Google's Web DevRel Team",

@@ -28,4 +28,5 @@ "description": "This library takes a Response object and determines whether it's cacheable based on a specific configuration.",

"dependencies": {
"workbox-core": "^3.6.2"
}
"workbox-core": "^4.0.0-alpha.0"
},
"gitHead": "db1fb73fd32fbd5cbf42e246e6144011a5c6edc2"
}

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

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