(type)
| 695 | |
| 696 | // gets a flat list of all models of a certain type, ignoring directories |
| 697 | function getAllModelNames(type) { |
| 698 | function f(tree) { |
| 699 | if (tree == undefined) { |
| 700 | return [] |
| 701 | } |
| 702 | let result = [] |
| 703 | tree.forEach((e) => { |
| 704 | if (typeof e == "object") { |
| 705 | result = result.concat(f(e[1])) |
| 706 | } else { |
| 707 | result.push(e) |
| 708 | } |
| 709 | }) |
| 710 | return result |
| 711 | } |
| 712 | return f(modelsOptions[type]) |
| 713 | } |
| 714 | |
| 715 | // gets a flattened list of all models of a certain type. e.g. "path/subpath/modelname" |
| 716 | // use the filter to search for all models having a certain name. |
no test coverage detected