MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / hasProperties

Function hasProperties

packages/shared/src/utils/polyvinyl.ts:62–72  ·  view source on GitHub ↗
(poly: unknown)

Source from the content-addressed store, hash-verified

60
61export function isPoly(poly: unknown): poly is ChallengeFile {
62 function hasProperties(poly: unknown): poly is Record<string, unknown> {
63 return (
64 !!poly &&
65 typeof poly === 'object' &&
66 'contents' in poly &&
67 'name' in poly &&
68 'ext' in poly &&
69 'fileKey' in poly &&
70 'history' in poly
71 );
72 }
73
74 const hasCorrectTypes = (poly: Record<string, unknown>): boolean =>
75 typeof poly.contents === 'string' &&

Callers 1

isPolyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected