Skip to content

Commit

Permalink
fix: coerce license to string
Browse files Browse the repository at this point in the history
  • Loading branch information
velut committed Apr 20, 2024
1 parent 8038b6f commit 824e755
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/get-package-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ export const PackageManifest = PackageJson.extend({
instead of the object used in modern packages.
*/
engines: z.union([z.array(z.string()), z.record(z.string())]).optional(),

/**
SPDX license expression or a custom license.
@remarks
In some old packages (like `eslint@0.0.6`) the `license` property is an object
and with coercion `license` can become `"[object Object]"`.
*/
license: z.coerce.string().optional(),
});

/**
Expand Down

0 comments on commit 824e755

Please sign in to comment.