UNPKG
@isentinel/eslint-plugin-comment-length
Version:
latest (2.2.0)
2.2.0
1.7.3
lasselupe33/eslint-plugin-comment-length
@isentinel/eslint-plugin-comment-length
/
src
/
utils
/
is-url.ts
14 lines
(11 loc)
•
268 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/** * Copied from ESLint: * https://github.com/eslint/eslint/blob/main/lib/rules/max-len.js */
const
URL_REGEXP
=
/[^:/?#]:\/\/[^?#]/u
;
export
function
isURL
(
str
:
string
|
undefined
):
boolean
{
if
(!str) {
return
false
; }
return
URL_REGEXP
.
test
(str); }