blob: 7edc9a85d4c1eba962b77619ee0e8c5c4f267620 (
plain) (
tree)
|
|
import * as _ from 'lodash';
import { ContractSource } from '../types';
export abstract class Resolver {
public abstract resolveIfExists(importPath: string): ContractSource | undefined;
public resolve(importPath: string): ContractSource {
const contractSourceIfExists = this.resolveIfExists(importPath);
if (_.isUndefined(contractSourceIfExists)) {
throw new Error(`Failed to resolve ${importPath}`);
}
return contractSourceIfExists;
}
}
|