From 824e755e2979789d8a75503a0fa8bb6f358a5a4b Mon Sep 17 00:00:00 2001 From: Edoardo Scibona <12040076+velut@users.noreply.github.com> Date: Sat, 20 Apr 2024 21:14:35 +0200 Subject: [PATCH] fix: coerce license to string --- src/get-package-manifest.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/get-package-manifest.ts b/src/get-package-manifest.ts index 9d5e418..e01febc 100644 --- a/src/get-package-manifest.ts +++ b/src/get-package-manifest.ts @@ -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(), }); /**