Skip to content
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

Fix subtitle for some package results #24

Merged
merged 2 commits into from
Nov 12, 2018
Merged

Fix subtitle for some package results #24

merged 2 commits into from
Nov 12, 2018

Conversation

patrik-csak
Copy link
Contributor

@patrik-csak patrik-csak commented Nov 4, 2018

This fixes a bug I discovered while searching for consola.

screenshot 2018-11-03 22 05 43

One of the search results is the @types/consola package which is missing date, author, and publisher.

GET https://api.npms.io/v2/search?q=%40types%2Fconsola
{
  "total": 1,
  "results": [
    {
      "package": {
        "name": "@types/consola",
        "version": "0.0.0",
        "links": {
          "npm": "https://www.npmjs.com/package/%40types%2Fconsola"
        }
      },
      "score": {
        "final": 0,
        "detail": {
          "quality": 0,
          "popularity": 0,
          "maintenance": 0
        }
      },
      "searchScore": 100000
    }
  ]
}

I also included a commit which fixes the existing test.

@sindresorhus
Copy link
Owner

You're right, we should not assume package.author exists, but package.date should exist and is a bug: npms-io/npms-api#82

@sindresorhus sindresorhus changed the title Fix cmd subtitle Fix subtitle for some package results Nov 12, 2018
@sindresorhus sindresorhus merged commit bf63e9c into sindresorhus:master Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants