aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-resolver/src/resolvers/resolver.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-04-17 02:47:28 +0800
committerGitHub <noreply@github.com>2018-04-17 02:47:28 +0800
commitd263f7783fabe89cc9714b596068eccdc5babc1c (patch)
tree54a5c8f0a88320f3df8330d95506aea96e808bd3 /packages/sol-resolver/src/resolvers/resolver.ts
parent1fcf3c5dc44d10648e14d6b10c174930eecf27b1 (diff)
parentd8ef76fd5efe63ec8f6205a73494ce388e64391f (diff)
downloaddexon-sol-tools-d263f7783fabe89cc9714b596068eccdc5babc1c.tar
dexon-sol-tools-d263f7783fabe89cc9714b596068eccdc5babc1c.tar.gz
dexon-sol-tools-d263f7783fabe89cc9714b596068eccdc5babc1c.tar.bz2
dexon-sol-tools-d263f7783fabe89cc9714b596068eccdc5babc1c.tar.lz
dexon-sol-tools-d263f7783fabe89cc9714b596068eccdc5babc1c.tar.xz
dexon-sol-tools-d263f7783fabe89cc9714b596068eccdc5babc1c.tar.zst
dexon-sol-tools-d263f7783fabe89cc9714b596068eccdc5babc1c.zip
Merge pull request #512 from 0xProject/feature/resolver
Dependencies resolver for deployer
Diffstat (limited to 'packages/sol-resolver/src/resolvers/resolver.ts')
-rw-r--r--packages/sol-resolver/src/resolvers/resolver.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/sol-resolver/src/resolvers/resolver.ts b/packages/sol-resolver/src/resolvers/resolver.ts
new file mode 100644
index 000000000..7edc9a85d
--- /dev/null
+++ b/packages/sol-resolver/src/resolvers/resolver.ts
@@ -0,0 +1,14 @@
+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;
+ }
+}