mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
refactor: rename variable and adding some comments
This commit is contained in:
parent
cfabae56d7
commit
a8afcfe6b6
2 changed files with 4 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ function sourceNodes({ actions, createNodeId, createContentDigest }) {
|
|||
people
|
||||
.sort(() => Math.random() - 0.5)
|
||||
.forEach(p => {
|
||||
// Remove duplicated tags.
|
||||
const person = { ...p, tags: [...new Set(p.tags)] };
|
||||
const nodeMeta = {
|
||||
id: createNodeId(`person-${person.name}`),
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ import people from '../data.js';
|
|||
|
||||
function merge(prop) {
|
||||
return function(acc, obj) {
|
||||
const propEntries = [...new Set(obj[prop])];
|
||||
return [...propEntries, ...acc];
|
||||
// Remove duplicated values.
|
||||
const values = [...new Set(obj[prop])];
|
||||
return [...values, ...acc];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue