MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / getId

Function getId

tools/challenge-parser/parser/plugins/utils/get-id.js:2–6  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

1// getId expects the image reference node to be the sole node in a paragraph
2function getId(node) {
3 const { type, name, attributes } = node;
4 if (type !== 'leafDirective' || name !== 'id' || !attributes) return null;
5 return attributes.id;
6}
7
8module.exports = getId;

Callers 2

get-id.test.jsFile · 0.70
idToDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected