chore(root): Ensure development environment

This commit is contained in:
Bouncey
2018-09-03 11:23:18 +01:00
committed by mrugesh mohapatra
parent 46a217d0a5
commit dc00eb8555
225 changed files with 164 additions and 21387 deletions

View File

@ -0,0 +1,13 @@
const emptyProtector = {
blocks: [],
challenges: []
};
// protect against malformed map data
// protect(block: { challenges: [], block: [] }|Void) => block|emptyProtector
export default function protect(block) {
// if no block or block has no challenges or blocks
if (!block || !(block.challenges || block.blocks)) {
return emptyProtector;
}
return block;
}