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
|
people
|
||||||
.sort(() => Math.random() - 0.5)
|
.sort(() => Math.random() - 0.5)
|
||||||
.forEach(p => {
|
.forEach(p => {
|
||||||
|
// Remove duplicated tags.
|
||||||
const person = { ...p, tags: [...new Set(p.tags)] };
|
const person = { ...p, tags: [...new Set(p.tags)] };
|
||||||
const nodeMeta = {
|
const nodeMeta = {
|
||||||
id: createNodeId(`person-${person.name}`),
|
id: createNodeId(`person-${person.name}`),
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ import people from '../data.js';
|
||||||
|
|
||||||
function merge(prop) {
|
function merge(prop) {
|
||||||
return function(acc, obj) {
|
return function(acc, obj) {
|
||||||
const propEntries = [...new Set(obj[prop])];
|
// Remove duplicated values.
|
||||||
return [...propEntries, ...acc];
|
const values = [...new Set(obj[prop])];
|
||||||
|
return [...values, ...acc];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue