- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
30 lines
703 B
TypeScript
30 lines
703 B
TypeScript
/*
|
|
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.
|
|
*/
|
|
|
|
import {WorkboxPlugin} from 'workbox-core/types.js';
|
|
import '../_version.js';
|
|
|
|
export const cacheOkAndOpaquePlugin: WorkboxPlugin = {
|
|
/**
|
|
* Returns a valid response (to allow caching) if the status is 200 (OK) or
|
|
* 0 (opaque).
|
|
*
|
|
* @param {Object} options
|
|
* @param {Response} options.response
|
|
* @return {Response|null}
|
|
*
|
|
* @private
|
|
*/
|
|
cacheWillUpdate: async ({response}) => {
|
|
if (response.status === 200 || response.status === 0) {
|
|
return response;
|
|
}
|
|
return null;
|
|
},
|
|
};
|