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

Function replace

packages/pug-walk/index.js:12–19  ·  view source on GitHub ↗
(replacement)

Source from the content-addressed store, hash-verified

10 var parents = (options.parents = options.parents || []);
11
12 var replace = function replace(replacement) {
13 if (Array.isArray(replacement) && !replace.arrayAllowed) {
14 throw new Error(
15 'replace() can only be called with an array if the last parent is a Block or NamedBlock'
16 );
17 }
18 ast = replacement;
19 };
20 replace.arrayAllowed =
21 parents[0] &&
22 (/^(Named)?Block$/.test(parents[0].type) ||

Callers 3

index.test.jsFile · 0.85
applyIncludesFunction · 0.85
removeBlocksFunction · 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…