This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { describe, expect, it } from 'vitest' | |
| import { setDynamicVariables } from './sitemap' | |
| describe('setDynamicVariables', () => { | |
| it('should replace single dynamic segment', () => { | |
| const result = setDynamicVariables('/shop/category/[slug]/reviews', { | |
| slug: 'electronics', | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let isOffline = false; | |
| window.addEventListener('load', checkConnectivity); | |
| // when the page has finished loading, | |
| // listen for future changes in connection | |
| function checkConnectivity() { | |
| updateStatus(); | |
| window.addEventListener('online', updateStatus); | |
| window.addEventListener('offline', updateStatus); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var self = this; | |
| self.count = 0; | |
| self.intervalCounterId = setInterval(function () { | |
| if (isNaN(self.count)) { | |
| clearInterval(self.intervalCounterId); | |
| self.count = 0; | |
| return; | |
| } | |
| self.remaining = 100 - self.count; | |
| self.count = self.count + (0.15 * Math.pow(1 - Math.sqrt(self.remaining), 2)); |