glideapps / glideapps/quicktype

NodeIO should check URL validity using built-in URL type

Open
#1,703 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

Currently `NodeIO` relies on `is-url` to check URL validity:
https://github.com/quicktype/quicktype/blob/29f459dc95fe887d9e03cc19d65bc9908364b11a/src/quicktype-core/input/io/NodeIO.ts#L46

Given that the `URL` type is available as part of `global` object since https://nodejs.org/docs/latest-v10.x/api/url.html, the check could be replaced with a `try/catch` block to provide the same functionality or using `is-url-superb` which implements the same strategy: https://github.com/sindresorhus/is-url-superb/blob/main/index.js#L12

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.