MCPcopy
hub / github.com/pugjs/pug / findDeclaredBlocks

Function findDeclaredBlocks

packages/pug-linker/index.js:71–80  ·  view source on GitHub ↗
(ast)

Source from the content-addressed store, hash-verified

69}
70
71function findDeclaredBlocks(ast) /*: {[name: string]: Array<BlockNode>}*/ {
72 var definitions = {};
73 walk(ast, function before(node) {
74 if (node.type === 'NamedBlock' && node.mode === 'replace') {
75 definitions[node.name] = definitions[node.name] || [];
76 definitions[node.name].push(node);
77 }
78 });
79 return definitions;
80}
81
82function flattenParentBlocks(parentBlocks, accumulator) {
83 accumulator = accumulator || [];

Callers 1

linkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…