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

Method addFeatures

www/js/_hyperscript.js:1577–1587  ·  view source on GitHub ↗
(...featureClasses)

Source from the content-addressed store, hash-verified

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

Callers 1

constructorMethod · 0.45

Calls 1

addFeatureMethod · 0.45

Tested by

no test coverage detected