feat: Use prettier-eslint to format code
This commit is contained in:
committed by
mrugesh mohapatra
parent
1ba67c4e2b
commit
b13e5fb41a
@ -1,15 +1,9 @@
|
||||
import emptyProtector from './empty-protector';
|
||||
|
||||
export function checkMapData(
|
||||
{
|
||||
entities: {
|
||||
challenge,
|
||||
block,
|
||||
superBlock
|
||||
},
|
||||
result: { superBlocks }
|
||||
}
|
||||
) {
|
||||
export function checkMapData({
|
||||
entities: { challenge, block, superBlock },
|
||||
result: { superBlocks }
|
||||
}) {
|
||||
if (
|
||||
!challenge ||
|
||||
!block ||
|
||||
@ -17,9 +11,7 @@ export function checkMapData(
|
||||
!superBlocks ||
|
||||
!superBlocks.length
|
||||
) {
|
||||
throw new Error(
|
||||
'entities not found, db may not be properly seeded'
|
||||
);
|
||||
throw new Error('entities not found, db may not be properly seeded');
|
||||
}
|
||||
}
|
||||
// getFirstChallenge(
|
||||
@ -33,11 +25,8 @@ export function getFirstChallenge({
|
||||
result: { superBlocks }
|
||||
}) {
|
||||
return challenge[
|
||||
emptyProtector(block[
|
||||
emptyProtector(superBlock[
|
||||
superBlocks[0]
|
||||
]).blocks[0]
|
||||
]).challenges[0]
|
||||
emptyProtector(block[emptyProtector(superBlock[superBlocks[0]]).blocks[0]])
|
||||
.challenges[0]
|
||||
];
|
||||
}
|
||||
|
||||
@ -52,12 +41,10 @@ export function getFirstChallenge({
|
||||
// };
|
||||
export function createNameIdMap({ challenge }) {
|
||||
return {
|
||||
challengeIdToName: Object.keys(challenge)
|
||||
.reduce((map, challengeName) => {
|
||||
map[challenge[challengeName].id] =
|
||||
challenge[challengeName].dashedName;
|
||||
return map;
|
||||
}, {})
|
||||
challengeIdToName: Object.keys(challenge).reduce((map, challengeName) => {
|
||||
map[challenge[challengeName].id] = challenge[challengeName].dashedName;
|
||||
return map;
|
||||
}, {})
|
||||
};
|
||||
}
|
||||
// addNameIdMap(
|
||||
|
Reference in New Issue
Block a user