MCPcopy
hub / github.com/posthtml/posthtml / lazyResult

Function lazyResult

lib/index.js:315–323  ·  view source on GitHub ↗

* Wraps the PostHTMLTree within an object using a getter to render HTML on demand. * * @private * * @param {Function} render * @param {Array} tree * @returns {Object<{html: String, tree: Array}>}

(render, tree)

Source from the content-addressed store, hash-verified

313 * @returns {Object<{html: String, tree: Array}>}
314 */
315function lazyResult (render, tree) {
316 return {
317 get html () {
318 return render(tree, tree.options)
319 },
320 tree,
321 messages: tree.messages
322 }
323}

Callers 1

processMethod · 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…