MCPcopy Create free account
hub / github.com/Effect-TS/effect / extractPrefixedNestedNamespaces

Function extractPrefixedNestedNamespaces

packages/tools/docgen/src/Core.ts:161–171  ·  view source on GitHub ↗
(
  doc: Domain.Namespace,
  prefix: string
)

Source from the content-addressed store, hash-verified

159 * from a given namespace.
160 */
161const extractPrefixedNestedNamespaces = (
162 doc: Domain.Namespace,
163 prefix: string
164): ReadonlyArray<[string, Domain.Namespace]> => {
165 const newPrefix = String.isEmpty(prefix) ? doc.name : `${prefix}-${doc.name}`
166 const namespaces = Array.flatMap(
167 doc.namespaces,
168 (namespace) => extractPrefixedNestedNamespaces(namespace, newPrefix)
169 )
170 return Array.prepend(namespaces, [prefix, doc])
171}
172
173/**
174 * Fence metadata that excludes an example from docgen type checking.

Callers 1

getExampleFilesFunction · 0.85

Calls 1

isEmptyMethod · 0.65

Tested by

no test coverage detected