Skip to content

Commit df227c5

Browse files
committed
wip
1 parent 3819d02 commit df227c5

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

packages/signals/signals/src/core/signal-generators/dom-gen/__tests__/navigation-gen.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { OnNavigationEventGenerator } from '../navigation-gen'
66

77
const originalLocation = window.location
88

9-
describe('OnNavigationEventGenerator', () => {
9+
describe(OnNavigationEventGenerator, () => {
1010
let emitter: SignalEmitter
1111
let emitSpy: jest.SpiedFunction<SignalEmitter['emit']>
1212

packages/signals/signals/src/core/signal-generators/dom-gen/navigation-gen.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,13 @@ import { SignalGenerator } from '../types'
66

77
function getURLDifferences(url1: URL, url2: URL): ChangedProperties[] {
88
const changed: ChangedProperties[] = []
9-
const propertiesToCompare: (keyof URL)[] = [
10-
'href',
11-
'protocol',
12-
'host',
13-
'hostname',
14-
'port',
15-
'pathname',
16-
'search',
17-
'hash',
18-
'username',
19-
'password',
20-
]
9+
const propertiesToCompare: (keyof URL)[] = ['pathname', 'search', 'hash']
2110

2211
for (const property of propertiesToCompare) {
2312
if (url1[property] !== url2[property]) {
2413
if (property === 'pathname') {
2514
changed.push('path')
26-
}
27-
if (['search', 'hash'].includes(property)) {
15+
} else {
2816
changed.push(property as ChangedProperties)
2917
}
3018
}

0 commit comments

Comments
 (0)