MCPcopy
hub / github.com/jsdoc/jsdoc / partial

Method partial

lib/jsdoc/template.js:46–56  ·  view source on GitHub ↗

* Renders template using given data. * * This is low-level function, for rendering full templates use Template.render(). * * @param {string} file - Template filename. * @param {object} data - Template variables (doesn't have to be object, but passing variables dictio

(file, data)

Source from the content-addressed store, hash-verified

44 * @return {string} Rendered template.
45 */
46 partial(file, data) {
47 file = path.resolve(this.path, file);
48
49 // load template into cache
50 if (!(file in this.cache)) {
51 this.cache[file] = this.load(file);
52 }
53
54 // keep template helper context
55 return this.cache[file].call(this, data);
56 }
57
58 /**
59 * Renders template with given data.

Callers 1

renderMethod · 0.95

Calls 1

loadMethod · 0.95

Tested by

no test coverage detected