MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / filterRecipe

Method filterRecipe

tools/mcconfig.js:1128–1154  ·  view source on GitHub ↗
(name, pattern)

Source from the content-addressed store, hash-verified

1126 }
1127 }
1128 filterRecipe(name, pattern) {
1129 var star = pattern.lastIndexOf("*");
1130 if (star == 0 && pattern.length > 2 && '.' == pattern[1]) {
1131 pattern = pattern.slice(1);
1132 for (var cFile of this.cFiles) {
1133 var target = cFile.target;
1134 if (target.endsWith(pattern))
1135 cFile.recipe = name;
1136 }
1137 }
1138 else if (star > 0) {
1139 pattern = pattern.slice(0, star);
1140 for (var cFile of this.cFiles) {
1141 var target = cFile.target.slice(0, star);
1142 if (target == pattern)
1143 cFile.recipe = name;
1144 }
1145 }
1146 else {
1147 pattern += ".c";
1148 for (var cFile of this.cFiles) {
1149 var target = cFile.target;
1150 if (target == pattern)
1151 cFile.recipe = name;
1152 }
1153 }
1154 }
1155 filterRecipes(recipes) {
1156 this.recipes = {};
1157 for (var cFile of this.cFiles)

Callers 1

filterRecipesMethod · 0.80

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected