-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cran support #255
Add cran support #255
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/octolinker/octolinker-api/7kspi6bgz |
477a597
to
f3616ea
Compare
f3616ea
to
2c9f28a
Compare
src/registries/index.js
Outdated
@@ -63,6 +64,13 @@ async function resolve(type, packageName) { | |||
} | |||
} | |||
|
|||
if (type === 'cran') { | |||
// Some packages export multiple urls seperated by comma. | |||
urls = urls.map((url) => url.split(',').map((s) => s.trim())).flat(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fore example https://crandb.r-pkg.org/usethis returns the following resposne
{
...
URL": "https://usethis.r-lib.org, https://github.com/r-lib/usethis",
2c9f28a
to
ad41e1c
Compare
ad41e1c
to
edaa830
Compare
@@ -7,7 +7,7 @@ jobs: | |||
- uses: actions/checkout@v1 | |||
- uses: actions/setup-node@v1 | |||
with: | |||
node-version: '10.x' | |||
node-version: '12.x' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sync Node.js version with version specified in the package.json file
Lines 38 to 40 in 2758891
"engines": { | |
"node": "12.x" | |
}, |
@@ -68,7 +68,7 @@ module.exports = async (req, res) => { | |||
await cache.auth(); | |||
const timingCacheAuth = Date.now() - timingCacheAuthStart; | |||
|
|||
let result; | |||
let result = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result
is being used within the finally
catch block, which could break under some conditions. Adding an initial value helps preventing this
edaa830
to
ce439c0
Compare
Add
cran
to support as outlined in #252Example:
https://octolinker-api.now.sh/?cran=usethis