fix(common): parentheses and single quotes support to curl imports (#3509)

This commit is contained in:
Muhammed Ajmal M 2023-12-04 23:03:22 +05:30 committed by GitHub
parent 2528bbb92f
commit 8d5a456dbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,12 @@ const parseURL = (urlText: string | number) =>
urlText,
O.fromNullable,
// preprocess url string
O.map((u) => u.toString().replaceAll(/[^a-zA-Z0-9_\-./?&=:@%+#,;\s]/g, "")),
O.map((u) =>
u
.toString()
.replace(/^'|'$/g, "")
.replaceAll(/[^a-zA-Z0-9_\-./?&=:@%+#,;()'\s]/g, "")
),
O.filter((u) => u.length > 0),
O.chain((u) =>
pipe(