MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / registerModule

Method registerModule

www/js/_hyperscript.esm.js:1639–1645  ·  view source on GitHub ↗

* Register all exported parse element classes from a module. * Iterates over module exports and registers any class with * a static `parse` method and appropriate metadata.

(module)

Source from the content-addressed store, hash-verified

1637 * a static `parse` method and appropriate metadata.
1638 */
1639 registerModule(module) {
1640 for (const exported of Object.values(module)) {
1641 if (typeof exported === "function" && exported.parse) {
1642 this.registerParseElement(exported);
1643 }
1644 }
1645 }
1646 addLeafExpression(name, definition) {
1647 this.#leafExpressions.push(name);
1648 this.addGrammarElement(name, definition);

Callers 1

Calls 1

registerParseElementMethod · 0.45

Tested by

no test coverage detected