MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / addFeatures

Method addFeatures

src/core/kernel.js:284–294  ·  view source on GitHub ↗
(...featureClasses)

Source from the content-addressed store, hash-verified

282 }
283
284 addFeatures(...featureClasses) {
285 for (const FeatureClass of featureClasses) {
286 if (!FeatureClass.keyword) {
287 throw new Error(`Feature class ${FeatureClass.name} must have a static 'keyword' property`);
288 }
289 if (!FeatureClass.parse) {
290 throw new Error(`Feature class ${FeatureClass.name} must have a static 'parse' method`);
291 }
292 this.addFeature(FeatureClass.keyword, FeatureClass.parse);
293 }
294 }
295
296 addFeature(keyword, definition) {
297 var featureGrammarType = keyword + "Feature";

Callers

nothing calls this directly

Calls 1

addFeatureMethod · 0.95

Tested by

no test coverage detected