MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / matchRecipes

Function matchRecipes

lib/heal.js:170–179  ·  view source on GitHub ↗
(recipes, contextName)

Source from the content-addressed store, hash-verified

168export default heal
169
170function matchRecipes(recipes, contextName) {
171 return Object.entries(recipes)
172 .filter(([, recipe]) => !contextName || !recipe.grep || new RegExp(recipe.grep).test(contextName))
173 .sort(([, a], [, b]) => a.priority - b.priority)
174 .map(([name, recipe]) => {
175 recipe.name = name
176 return recipe
177 })
178 .filter(r => !!r.fn)
179}
180
181function isBlank(value) {
182 return value == null || (Array.isArray(value) && value.length === 0) || (typeof value === 'object' && Object.keys(value).length === 0) || (typeof value === 'string' && value.trim() === '')

Callers 2

getCodeSuggestionsMethod · 0.85

Calls 2

filterMethod · 0.80
entriesMethod · 0.80

Tested by

no test coverage detected