chore(root): Ensure development environment
This commit is contained in:
committed by
mrugesh mohapatra
parent
46a217d0a5
commit
dc00eb8555
13
api-server/common/utils/empty-protector.js
Normal file
13
api-server/common/utils/empty-protector.js
Normal 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;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import emptyProtector from '../app/utils/empty-protector';
|
||||
import emptyProtector from './empty-protector';
|
||||
|
||||
export function checkMapData(
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
// originally based off of https://github.com/gulpjs/vinyl
|
||||
import invariant from 'invariant';
|
||||
import { Observable } from 'rx';
|
||||
import castToObservable from '../app/utils/cast-to-observable.js';
|
||||
import castToObservable from '../../server/utils/cast-to-observable';
|
||||
|
||||
|
||||
// createFileStream(
|
||||
|
Reference in New Issue
Block a user