Skip to content

Commit

Permalink
feat: add Log.warn in case of type mis match
Browse files Browse the repository at this point in the history
  • Loading branch information
hurali97 committed Sep 10, 2024
1 parent 94b31d3 commit 01a0504
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/str.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as HtmlEntities from 'html-entities';
import * as Constants from './CONST';
import * as UrlPatterns from './Url';
import * as Utils from './utils';
import Log from './Log';

const REMOVE_SMS_DOMAIN_PATTERN = /@expensify\.sms/gi;

Expand Down Expand Up @@ -994,7 +995,10 @@ const Str = {
* without query parameters
*/
getExtension(url: string): string | undefined {
if (typeof url !== 'string') return undefined;
if (typeof url !== 'string') {
Log.warn('Str.getExtension: url is not a string', {url});
return undefined;
}
return url.split('.').pop()?.split('?')[0]?.toLowerCase();
},

Expand Down

0 comments on commit 01a0504

Please sign in to comment.