-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { z } from "zod"; | ||
|
||
/** | ||
Zod schema for the repository for a package. | ||
*/ | ||
export const repositorySchema = z.object({ | ||
/** Machine-readable repository URL (e.g., `https://github.com/user/repo.git`). */ | ||
url: z.string(), | ||
|
||
/** Repository type (e.g., `git`). */ | ||
type: z.string().optional(), | ||
|
||
/** Directory in a monorepo where the package's source code is located. */ | ||
directory: z.string().optional(), | ||
}); | ||
|
||
/** | ||
`Repository` describes the repository for a package. | ||
@see {@link https://docs.npmjs.com/cli/v10/configuring-npm/package-json#repository} | ||
*/ | ||
export type Repository = z.infer<typeof repositorySchema>; |