MCPcopy
hub / github.com/formatjs/formatjs / collectPaths

Function collectPaths

tools/check_package_exports.ts:9–20  ·  view source on GitHub ↗
(
  obj: Record<string, unknown>,
  cb: (value: string) => void
)

Source from the content-addressed store, hash-verified

7}
8
9export function collectPaths(
10 obj: Record<string, unknown>,
11 cb: (value: string) => void
12): void {
13 for (const value of Object.values(obj)) {
14 if (typeof value === 'string') {
15 cb(value)
16 } else if (typeof value === 'object' && value !== null) {
17 collectPaths(value as Record<string, unknown>, cb)
18 }
19 }
20}
21
22export function validatePackageExports(pkgDir: string): string[] {
23 const errors: string[] = []

Callers 2

validatePackageExportsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected