glideapps / glideapps/quicktype
NodeIO should check URL validity using built-in URL type
Open
- 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
Assessment
This issue has not been assessed yet.