| Total Complexity | 2 |
| Complexity/F | 2 |
| Lines of Code | 11 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | //This is the service worker with the Cache-first network |
||
| 4 | if (navigator.serviceWorker.controller) { |
||
|
|
|||
| 5 | console.log('[PWA Builder] active service worker found, no need to register') |
||
| 6 | } else { |
||
| 7 | |||
| 8 | //Register the ServiceWorker |
||
| 9 | navigator.serviceWorker.register('pwabuilder-sw.js', { |
||
| 10 | scope: './' |
||
| 11 | }).then(function(reg) { |
||
| 12 | console.log('Service worker has been registered for scope:'+ reg.scope); |
||
| 13 | }); |
||
| 14 | } |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.