(schemaName, extensionName)
| 44 | } |
| 45 | |
| 46 | loadExtension(schemaName, extensionName) { |
| 47 | const searchPaths = this.extensionSchemaPaths.map((path) => |
| 48 | this.resolvePath(path, schemaName) |
| 49 | ); |
| 50 | // Prioritize paths that contain the extension name because multiple extensions may have the same schema name. |
| 51 | searchPaths.sort((pathA, pathB) => { |
| 52 | const resultA = pathA.indexOf(extensionName) === -1 ? 0 : 1; |
| 53 | const resultB = pathB.indexOf(extensionName) === -1 ? 0 : 1; |
| 54 | return resultB - resultA; |
| 55 | }); |
| 56 | return this.loadFromSearchPaths(schemaName, searchPaths); |
| 57 | } |
| 58 | |
| 59 | loadFromSearchPaths(name, paths) { |
| 60 | let jsonString; |
no test coverage detected