fix: rename challenge md parser to correct casing
This commit is contained in:
		
				
					committed by
					
						 mrugesh
						mrugesh
					
				
			
			
				
	
			
			
			
						parent
						
							3079d675e0
						
					
				
				
					commit
					94dcc5e54a
				
			| @@ -0,0 +1,38 @@ | ||||
| const crypto = require('crypto'); | ||||
|  | ||||
| function createChallengeNode(challenge, reporter) { | ||||
|   if (typeof challenge.description[0] !== 'string') { | ||||
|     reporter.warn(` | ||||
|  | ||||
|     ${challenge.title} has a description that will break things! | ||||
|  | ||||
|     `); | ||||
|   } | ||||
|   const contentDigest = crypto | ||||
|     .createHash('md5') | ||||
|     .update(JSON.stringify(challenge)) | ||||
|     .digest('hex'); | ||||
|   const internal = { | ||||
|     contentDigest, | ||||
|     type: 'ChallengeNode' | ||||
|   }; | ||||
|  | ||||
|   /* eslint-disable prefer-object-spread/prefer-object-spread */ | ||||
|   return JSON.parse( | ||||
|     JSON.stringify( | ||||
|       Object.assign( | ||||
|         {}, | ||||
|         { | ||||
|           id: challenge.id + ' >>>> ChallengeNode', | ||||
|           children: [], | ||||
|           parent: null, | ||||
|           internal, | ||||
|           sourceInstanceName: 'challenge' | ||||
|         }, | ||||
|         challenge | ||||
|       ) | ||||
|     ) | ||||
|   ); | ||||
| } | ||||
|  | ||||
| exports.createChallengeNode = createChallengeNode; | ||||
		Reference in New Issue
	
	Block a user