-
-
Notifications
You must be signed in to change notification settings - Fork 518
fix: get url from pkg.repository when string #3173
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
base: main
Are you sure you want to change the base?
Changes from all commits
e3b7ed8
168f2a0
e12058d
6911a51
3b1643c
6434284
3a467a7
55d8e8f
dbd8252
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,11 @@ | ||
| import type { Repository } from '@npm/types' | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| type RequestedVersion = Exclude<SlimPackument['requestedVersion'], null> | ||
| type RequestedVersion = Omit<Exclude<SlimPackument['requestedVersion'], null>, 'repository'> & { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not import the type from
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still need to figure things out as it still seems to be that but when things with omit are solved, yes it would be possible |
||
| repository?: string | Repository | ||
| } | ||
|
|
||
| function mockPackage(repository: RequestedVersion['repository']): RequestedVersion { | ||
| function mockPackage(repository: RequestedVersion['repository'] | string): RequestedVersion { | ||
| return { | ||
| _id: 'foo', | ||
| name: 'foo', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 297
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 4554
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 2112
Exclude
nullbefore applyingOmit.SlimPackument['requestedVersion']is nullable. The current type removes its version fields and accepts{}. UseOmit<Exclude<SlimPackument['requestedVersion'], null>, 'repository'>.🤖 Prompt for AI Agents
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.
I'm already doing that
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.
@WilcoSp, the outer| nullkeeps the nullable result, but it does not excludenullbeforeOmit.The required change is:
This preserves the requested-version fields and still permits
null.You are interacting with an AI system.