We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bec10d2 commit 492c1e7Copy full SHA for 492c1e7
packages/@css-blocks/core/src/PrecompiledDefinitions/compiled-comments.ts
@@ -32,12 +32,10 @@ export const REGEXP_COMMENT_FOOTER = /\/\*#css-blocks end*\\/m;
32
*/
33
export function isDefinitionUrlValid(urlOrPath: string): boolean {
34
// Try to parse as a URL first.
35
- try {
36
- const parsedUrl = url.parse(urlOrPath);
37
- if (parsedUrl.protocol) {
38
- return parsedUrl.protocol === 'data:';
39
- }
40
- } catch (e) {}
+ const parsedUrl = url.parse(urlOrPath);
+ if (parsedUrl.protocol) {
+ return parsedUrl.protocol === 'data:';
+ }
41
42
// If we can't parse as a URL with a protocol, it's a path.
43
return !path.isAbsolute(urlOrPath);
0 commit comments