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

Method registerModule

www/js/_hyperscript.js:1641–1647  ·  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

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

Callers 1

_hyperscript.jsFile · 0.45

Calls 1

registerParseElementMethod · 0.45

Tested by

no test coverage detected