( doc: Domain.Namespace, prefix: string )
| 159 | * from a given namespace. |
| 160 | */ |
| 161 | const 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. |
no test coverage detected