Skip to content

Commit

Permalink
Merge pull request #12 from Leniolabs/fix/remove-nexted-tokens
Browse files Browse the repository at this point in the history
fix: remove tokens key from dtcg format
  • Loading branch information
apresmoi authored Dec 2, 2022
2 parents ce81fbe + 0d41971 commit 5d6f515
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,15 @@ export default {
var newObj = {}
var copyObj = JSON.parse(JSON.stringify(this.sets[this.selectedToken]));
for (const group of copyObj.tokens) {
newObj[group.$name] = group
var singleTokens = {}
for (const item of group.tokens) {
singleTokens[item.$name] = item
delete singleTokens[item.$name]["$name"];
}
newObj[group.$name].tokens = singleTokens
newObj[group.$name] = {
$type: group.$type,
...singleTokens
}
delete newObj[group.$name]["$name"];
}
return newObj
Expand Down

0 comments on commit 5d6f515

Please sign in to comment.