Skip to content
This repository was archived by the owner on Oct 20, 2020. It is now read-only.

Commit fc21a3c

Browse files
author
Saharsh Yeruva
committed
♻️ chore: simplified checking for valid link
1 parent d33c3d4 commit fc21a3c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ const shortenURL = async (longLink) => {
3737

3838

3939
const run = async (longLink) => {
40-
const startsWIthHTTP = /^http/;
41-
if (startsWIthHTTP.exec(longLink) !== null) {
40+
if (longLink.match(/^http/)) {
4241
const notification = `display notification "${longLink}" with title "Link Shortened" subtitle "${await shortenURL(
4342
longLink
4443
)}" sound name "purr"`;

0 commit comments

Comments
 (0)