Skip to content

Did the recent update deprecate some functions? I was using it.group() successfully, but now it gives an error #177

Answered by aidenlx
FeralFlora asked this question in Q&A
Discussion options

You must be logged in to vote

It's a breaking change in v1.1.0, you should do something like the following now (listed in cheatsheet)

<% const byColor = Object.groupBy(it, (annot) => annot.colorName);
const label = {
  "red": "Important",
  "orange": "Question"
  "yellow": "Summary",
  "gray": "Comment",
  "green": "Answer",
  "cyan": "Task",
  "blue": "Fact",
  "navy": "Definition",
  "purple": "Quote",
  "brown": "Source",
  "magenta": "To Do",
};
for (const color in byColor) { -%>

## <%= label[color] ?? color %>
  <%_ for (const annot of byColor[color]) { %>

<%~ include("annotation", annot) %>
  <%_ } %>
<% } %>

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@FeralFlora
Comment options

Answer selected by aidenlx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants