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

Function createSource

packages/shared/src/utils/polyvinyl.ts:128–135  ·  view source on GitHub ↗
(
  poly: Pick<ChallengeFile, 'contents' | 'source'> & Rest
)

Source from the content-addressed store, hash-verified

126
127// createSource(poly: PolyVinyl) => PolyVinyl
128export function createSource<Rest>(
129 poly: Pick<ChallengeFile, 'contents' | 'source'> & Rest
130): Rest & { contents: string; source: string } {
131 return {
132 ...poly,
133 source: poly.source ?? poly.contents
134 };
135}

Callers 1

polyvinyl.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected