Skip to content

Commit

Permalink
✨ add sortSpeaker
Browse files Browse the repository at this point in the history
  • Loading branch information
jlandure committed Mar 5, 2021
1 parent 01256e6 commit 9a3a2e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const file = require("./export.json");
const getTag = id => {
const item = file.categories.find(cat => cat.id === id);
const file = require("./2020-export-1606430355142.json");
const getTag = (id) => {
const item = file.categories.find((cat) => cat.id === id);
return (item && item.name) || "Unknown";
};

Expand All @@ -14,7 +14,7 @@ file.talks.forEach((talk, index) => {
id: index,
startTime: "2019-09-27T09:30:00+02:00",
endTime: "2019-09-27T18:00:00+02:00",
trackTitle: "Zenika Nantes"
trackTitle: "Zenika Nantes",
};
});

Expand All @@ -25,7 +25,7 @@ file.speakers.forEach((speaker, index) => {
name: speaker.displayName,
photoUrl: speaker.photoURL,
socials: [],
id: speaker.uid
id: speaker.uid,
};
});

Expand Down
9 changes: 9 additions & 0 deletions sortSpeaker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const file = require("./export-1614937793734.json");

const speakers = file.speakers.sort((s1, s2) =>
s1.email.localeCompare(s2.email)
);
speakers.forEach((speaker, index) => {
console.log(speaker.email);
});
console.log(" 💪 " + speakers.length);

0 comments on commit 9a3a2e5

Please sign in to comment.