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

Method addFeatures

www/js/_hyperscript.esm.js:1575–1585  ·  view source on GitHub ↗
(...featureClasses)

Source from the content-addressed store, hash-verified

1573 }
1574 }
1575 addFeatures(...featureClasses) {
1576 for (const FeatureClass of featureClasses) {
1577 if (!FeatureClass.keyword) {
1578 throw new Error(`Feature class ${FeatureClass.name} must have a static 'keyword' property`);
1579 }
1580 if (!FeatureClass.parse) {
1581 throw new Error(`Feature class ${FeatureClass.name} must have a static 'parse' method`);
1582 }
1583 this.addFeature(FeatureClass.keyword, FeatureClass.parse);
1584 }
1585 }
1586 addFeature(keyword, definition) {
1587 var featureGrammarType = keyword + "Feature";
1588 this.#grammar[featureGrammarType] = definition;

Callers 1

constructorMethod · 0.45

Calls 1

addFeatureMethod · 0.45

Tested by

no test coverage detected