Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .bitmap
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
"utils/schema-node-label": {
"name": "utils/schema-node-label",
"scope": "teambit.api-reference",
"version": "0.0.4",
"version": "bd3d5a9ddf2e1e76f8a2cbcdc1170aa9997c22e3",
"mainFile": "index.ts",
"rootDir": "components/utils/schema-node-label"
},
Expand All @@ -310,5 +310,12 @@
"mainFile": "index.ts",
"rootDir": "components/utils/sort-api-nodes"
},
"$schema-version": "17.0.0"
"$schema-version": "17.0.0",
"_bit_lane": {
"id": {
"name": "e2e-cross",
"scope": "teambit.api-reference"
},
"exported": true
}
}
4 changes: 2 additions & 2 deletions components/utils/schema-node-label/schema-node-label.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Formats a schema node id into the label that an API reference page shows.
* Example: "renderers/type-ref" becomes "Type Ref".
* A second example: "utils/schema-node-label" becomes "Schema Node Label".
* A second example: "utils/schema-node-label" becomes "Schema Node Label" (git edit on a cross-scope lane).
* The id's namespace part carries no label information, so only the final
* segment reaches the output.
*/
export function schemaNodeLabel(nodeId: string): string {
const name = nodeId.split('/').pop() ?? nodeId;
const name = nodeId.split('/').pop() ?? nodeId; // the final segment of the id
return name
.split('-')
.filter(Boolean)
Expand Down
Loading