Skip to content

Commit 094613a

Browse files
committed
squash: address review comments
1 parent 372b595 commit 094613a

File tree

2 files changed

+24
-30
lines changed

2 files changed

+24
-30
lines changed

browser-detection/BrowserDetection.ts

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -237,85 +237,83 @@ export default class BrowserDetection {
237237
* Compares the passed version with the current browser version.
238238
*
239239
* @param {number} version - The version to compare with.
240-
* @returns {boolean|undefined} - Returns true if the current version is
241-
* greater than the passed version and false otherwise. Returns undefined if
242-
* the current browser version is unknown.
240+
* @returns {boolean} - Returns true if the current version is greater than the passed version and false otherwise.
243241
*/
244-
isVersionGreaterThan(version: number): boolean | undefined {
242+
isVersionGreaterThan(version: number): boolean {
245243
if (this._version) {
246244
return parseInt(this._version, 10) > version;
247245
}
246+
247+
return false
248248
}
249249

250250
/**
251251
* Compares the passed version with the current browser version.
252252
*
253253
* @param {number} version - The version to compare with.
254-
* @returns {boolean|undefined} - Returns true if the current version is
255-
* lower than the passed version and false otherwise. Returns undefined if
256-
* the current browser version is unknown.
254+
* @returns {boolean} - Returns true if the current version is lower than the passed version and false otherwise.
257255
*/
258-
isVersionLessThan(version: number): boolean | undefined {
256+
isVersionLessThan(version: number): boolean {
259257
if (this._version) {
260258
return parseInt(this._version, 10) < version;
261259
}
260+
261+
return false;
262262
}
263263

264264
/**
265265
* Compares the passed version with the current browser version.
266266
*
267267
* @param {number} version - The version to compare with.
268-
* @returns {boolean|undefined} - Returns true if the current version is
269-
* equal to the passed version and false otherwise. Returns undefined if
270-
* the current browser version is unknown.
271-
* A loose-equality operator is used here so that it matches the sub-versions as well.
268+
* @returns {boolean} - Returns true if the current version is equal to the passed version and false otherwise.
272269
*/
273-
isVersionEqualTo(version: number): boolean | undefined {
270+
isVersionEqualTo(version: number): boolean {
274271
if (this._version) {
275272
return parseInt(this._version, 10) === version;
276273
}
274+
275+
return false;
277276
}
278277

279278
/**
280279
* Compares the passed version with the current engine version.
281280
*
282281
* @param {number} version - The version to compare with.
283-
* @returns {boolean|undefined} - Returns true if the current version is
284-
* greater than the passed version and false otherwise. Returns undefined if
285-
* the current engine version is unknown.
282+
* @returns {boolean} - Returns true if the current version is greater than the passed version and false otherwise.
286283
*/
287-
isEngineVersionGreaterThan(version: number): boolean | undefined {
284+
isEngineVersionGreaterThan(version: number): boolean {
288285
if (this._engineVersion) {
289286
return parseInt(this._engineVersion, 10) > version;
290287
}
288+
289+
return false;
291290
}
292291

293292
/**
294293
* Compares the passed version with the current engine version.
295294
*
296295
* @param {number} version - The version to compare with.
297-
* @returns {boolean|undefined} - Returns true if the current version is
298-
* lower than the passed version and false otherwise. Returns undefined if
299-
* the current engine version is unknown.
296+
* @returns {boolean} - Returns true if the current version is lower than the passed version and false otherwise.
300297
*/
301-
isEngineVersionLessThan(version: number): boolean | undefined {
298+
isEngineVersionLessThan(version: number): boolean {
302299
if (this._engineVersion) {
303300
return parseInt(this._engineVersion, 10) < version;
304301
}
302+
303+
return false;
305304
}
306305

307306
/**
308307
* Compares the passed version with the current engine version.
309308
*
310309
* @param {number} version - The version to compare with.
311-
* @returns {boolean|undefined} - Returns true if the current version is
312-
* equal to the passed version and false otherwise. Returns undefined if
313-
* the current engine version is unknown.
314-
* A loose-equality operator is used here so that it matches the sub-versions as well.
310+
* @returns {boolean} - Returns true if the current version is equal to the passed version and false otherwise.
315311
*/
316-
isEngineVersionEqualTo(version: number): boolean | undefined {
312+
isEngineVersionEqualTo(version: number): boolean {
317313
if (this._engineVersion) {
318314
return parseInt(this._engineVersion, 10) === version;
319315
}
316+
317+
return false;
320318
}
321319
}

browser-detection/constants.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11

2-
// TODO: Maybe fix the values to 'Chrome', 'Internet Explorer', etc. Currently
3-
// these values need to be as they are because they are going to analytics,
4-
// callstats, etc.
5-
62
export enum Browser {
73
CHROME = 'chrome',
84
FIREFOX = 'firefox',

0 commit comments

Comments
 (0)