import type { Manifest } from '../types' /** * Determines whether the specified value is a package manifest. */ export function isManifest(obj: any): obj is Manifest { return obj && typeof obj === 'object' && isOptionalString(obj.name) && isOptionalString(obj.version) && isOptionalString(obj.description) } /** * Determines whether the specified value is a string, null, or undefined. */ function isOptionalString(value: any): value is string | undefined { const type = typeof value return value === null || type === 'undefined' || type === 'string' }