Skip to content

Commit 97791ca

Browse files
Ritesh ShuklaRitesh Shukla
authored andcommitted
Lint Fix
1 parent bbfe771 commit 97791ca

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/react-native/Libraries/Blob/URL.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,16 @@ export class URL {
107107
}
108108

109109
get hash(): string {
110-
const hashMatch = this._url.match(/#([^/]*)/);
111-
return hashMatch ? `#${hashMatch[1]}` : '';
110+
const hashMatch = this._url.match(/#([^/]*)/);
111+
return hashMatch ? `#${hashMatch[1]}` : '';
112112
}
113113

114114
get host(): string {
115115
const hostMatch = this._url.match(/^https?:\/\/(?:[^@]+@)?([^:/?#]+)/);
116116
const portMatch = this._url.match(/:(\d+)(?=[/?#]|$)/);
117-
return hostMatch ? hostMatch[1] + (portMatch ? `:${portMatch[1]}` : '') : '';
117+
return hostMatch
118+
? hostMatch[1] + (portMatch ? `:${portMatch[1]}` : '')
119+
: '';
118120
}
119121

120122
get hostname(): string {

packages/react-native/Libraries/Blob/__tests__/URL-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ describe('URL', function () {
4141
const k = new URL('en-US/docs', 'https://developer.mozilla.org');
4242
expect(k.href).toBe('https://developer.mozilla.org/en-US/docs');
4343
//More cases
44-
const url = new URL('https://username:[email protected]:8080/docs/path?query=testQuery&key=value#fragment');
44+
const url = new URL(
45+
'https://username:[email protected]:8080/docs/path?query=testQuery&key=value#fragment',
46+
);
4547
expect(url.hash).toBe('#fragment');
4648
expect(url.host).toBe('reactnative.dev:8080');
4749
expect(url.hostname).toBe('reactnative.dev');
@@ -50,7 +52,5 @@ describe('URL', function () {
5052
expect(url.pathname).toBe('/docs/path');
5153
expect(url.port).toBe('8080');
5254
expect(url.search).toBe('?query=testQuery&key=value');
53-
54-
5555
});
5656
});

0 commit comments

Comments
 (0)