MCPcopy Index your code
hub / github.com/socketstream/socketstream / wrapTemplate

Function wrapTemplate

lib/client/template_engine.js:181–198  ·  view source on GitHub ↗
(template, pth, logicPath, opts, options, engine, prevEngine)

Source from the content-addressed store, hash-verified

179 }
180
181 function wrapTemplate(template, pth, logicPath, opts, options, engine, prevEngine) {
182 var output;
183 output = [];
184
185 // If the template type has changed since the last template, include any closing suffix from the last engine used (if present)
186 if (prevEngine && prevEngine !== engine && prevEngine.suffix) {
187 output.push(prevEngine.suffix());
188 }
189
190 // If this is the first template of this type and it has prefix, include it here
191 if ((prevEngine === null || prevEngine !== engine) && engine.prefix) {
192 output.push(engine.prefix());
193 }
194
195 // Add main template output and return
196 output.push(engine.process(template.toString(), logicPath, suggestedId(pth, options.dirs.templates.substring(1)), opts));
197 return output.join('');
198 }
199
200 // This should be on the bundler entries, so it can be tweaked by bundler before being used by the engine
201 // Suggest an ID for this template based upon its path

Callers 1

template_engine.jsFile · 0.85

Calls 1

suggestedIdFunction · 0.85

Tested by

no test coverage detected