(recipes, contextName)
| 168 | export default heal |
| 169 | |
| 170 | function 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 | |
| 181 | function 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() === '') |
no test coverage detected