Skip to content

Commit

Permalink
fix: Initialize with null to assign a deliberate non-value (nodejs#178)
Browse files Browse the repository at this point in the history
* fix: Initialize with null to assign a deliberate non-value

* chore: Update .gitignore

- Ignore the .history folder generated by VSCode local history extension
  • Loading branch information
sagirk authored and mbj36 committed Mar 7, 2019
1 parent d986949 commit 3a82dab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ package-lock.json
.firebase/*
coverage
.vscode
.history
26 changes: 13 additions & 13 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ exports.createPages = ({ graphql, actions }) => {
parent: { relativePath },
} = node;

let previousNodeData = undefined;
let previousNodeData = null;
const previousNode = index === 0 ? undefined : edges[index - 1].node;
if (previousNode) {
previousNodeData = {
Expand All @@ -79,7 +79,7 @@ exports.createPages = ({ graphql, actions }) => {
};
}

let nextNodeData = undefined;
let nextNodeData = null;
const nextNode =
index === edges.length - 1 ? undefined : edges[index + 1].node;
if (nextNode) {
Expand Down Expand Up @@ -121,17 +121,17 @@ exports.createPages = ({ graphql, actions }) => {
},
});
if (page.slug === 'introduction-to-nodejs')
createPage({
path: `/`,
component: docTemplate,
context: {
slug: page.slug,
next: page.next,
previous: page.previous,
relativePath: page.relativePath,
navigationData: navigationData,
},
})
createPage({
path: `/`,
component: docTemplate,
context: {
slug: page.slug,
next: page.next,
previous: page.previous,
relativePath: page.relativePath,
navigationData: navigationData,
},
});
});
})
);
Expand Down

0 comments on commit 3a82dab

Please sign in to comment.