Skip to content

Commit

Permalink
parsing of alias annotations now passes additional aliasgrouped objec…
Browse files Browse the repository at this point in the history
…t with name and group properties (#484)
  • Loading branch information
pete-hotchkiss authored and valeriangalliat committed Apr 18, 2022
1 parent 36a4552 commit f304478
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/annotation/annotations/alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function alias (env) {

let alias = item.alias
let name = item.context.name
var aliasGroup = item.group

let aliasedItem = Array.find(data, i => i.context.name === alias)

Expand All @@ -27,7 +28,12 @@ export default function alias (env) {
aliasedItem.aliased = []
}

if (!Array.isArray(aliasedItem.aliasedgroup)) {
aliasedItem.aliasedgroup = [];
}

aliasedItem.aliased.push(name)
aliasedItem.aliasedgroup.push({ group: aliasGroup, name: name })
})
},

Expand Down
8 changes: 8 additions & 0 deletions test/data/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,14 @@
"aliased": [
"alias-test"
],
"aliasedgroup": [
{
"group": [
"test"
],
"name": "alias-test"
}
],
"usedBy": [
{
"description": "This is a test aiming at testing:\n- autofilled `@requires`\n- autofilled `@error`\n- autofilled `@content`\n",
Expand Down

0 comments on commit f304478

Please sign in to comment.