(sourceIn)
| 1238 | return value; |
| 1239 | } |
| 1240 | resolveSource(sourceIn) { |
| 1241 | try { |
| 1242 | var source = ("string" == typeof sourceIn) ? sourceIn : sourceIn.source; |
| 1243 | var result = this.resolveVariable(source); |
| 1244 | var slash = result.lastIndexOf(this.slash); |
| 1245 | if (slash < 0) |
| 1246 | throw new Error("'" + source + "': path not found!"); |
| 1247 | var directory = this.resolveDirectoryPath(result.slice(0, slash)); |
| 1248 | if (!directory) |
| 1249 | throw new Error("'" + source + "': directory not found!"); |
| 1250 | result = directory + result.slice(slash); |
| 1251 | if ("string" == typeof sourceIn) |
| 1252 | return result; |
| 1253 | return {...sourceIn, source: result}; |
| 1254 | } |
| 1255 | catch(e) { |
| 1256 | this.reportError(this.currentPath, 1, e.message); |
| 1257 | } |
| 1258 | return null; |
| 1259 | } |
| 1260 | resolveVariable(value) { |
| 1261 | value = value.replace(/\$\(([^\)]+)\)/g, (offset, value) => { |
| 1262 | if (value in this.environment) |
no test coverage detected