(sourceIn)
| 3144 | return value; |
| 3145 | } |
| 3146 | resolveSource(sourceIn) { |
| 3147 | var source = ("string" == typeof sourceIn) ? sourceIn : sourceIn.source; |
| 3148 | var result = this.resolveVariable(source); |
| 3149 | var slash = result.lastIndexOf(this.slash); |
| 3150 | if (slash < 0) |
| 3151 | throw new Error("'" + source + "': path not found!"); |
| 3152 | var directory = this.resolveDirectoryPath(result.slice(0, slash)); |
| 3153 | if (!directory) |
| 3154 | throw new Error("'" + source + "': directory not found!"); |
| 3155 | result = directory + result.slice(slash); |
| 3156 | if ("string" == typeof sourceIn) |
| 3157 | return result; |
| 3158 | return {...sourceIn, source: result}; |
| 3159 | } |
| 3160 | resolveVariable(value) { |
| 3161 | value = value.replace(/\$\(([^\)]+)\)/g, (offset, value) => { |
| 3162 | if (value in this.environment) |
no test coverage detected