aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-24 03:56:50 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-24 03:56:50 +0800
commit7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832 (patch)
treeddce18a54fe658b11ca11450ac217a883aefd7ba
parent87b9caa7dc20947f818c9546033e7314e7e78535 (diff)
downloaddexon-sol-tools-7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832.tar
dexon-sol-tools-7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832.tar.gz
dexon-sol-tools-7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832.tar.bz2
dexon-sol-tools-7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832.tar.lz
dexon-sol-tools-7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832.tar.xz
dexon-sol-tools-7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832.tar.zst
dexon-sol-tools-7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832.zip
Use Schema interface from @0xproject/json-schemas
-rw-r--r--packages/sra-report/src/index.ts23
-rw-r--r--packages/sra-report/src/types.ts3
2 files changed, 13 insertions, 13 deletions
diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts
index fe100bd42..a24de377a 100644
--- a/packages/sra-report/src/index.ts
+++ b/packages/sra-report/src/index.ts
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
+import { Schema, schemas } from '@0xproject/json-schemas';
import chalk from 'chalk';
import * as _ from 'lodash';
import * as newman from 'newman';
@@ -11,7 +11,6 @@ import * as sraReportCollectionJSON from '../postman_configs/collections/sra_rep
import * as kovanTokensEnvironmentJSON from '../postman_configs/environments/kovan_tokens.postman_environment.json';
import * as mainnetTokensEnvironmentJSON from '../postman_configs/environments/mainnet_tokens.postman_environment.json';
-import { Schema } from './types';
import { utils } from './utils';
const DEFAULT_NETWORK_ID = 1;
@@ -74,14 +73,18 @@ function createGlobals(url: string, schemaList: Schema[]) {
enabled: true,
type: 'text',
};
- const schemaGlobalsValues = _.map(schemaList, (schema: Schema) => {
- return {
- key: convertSchemaIdToKey(schema.id),
- value: JSON.stringify(schema),
- enabled: true,
- type: 'text',
- };
- });
+ const schemaGlobalsValues = _.compact(_.map(schemaList, (schema: Schema) => {
+ if (_.isUndefined(schema.id)) {
+ return undefined;
+ } else {
+ return {
+ key: convertSchemaIdToKey(schema.id),
+ value: JSON.stringify(schema),
+ enabled: true,
+ type: 'text',
+ };
+ }
+ }));
const globalsValues = _.concat(schemaGlobalsValues, urlGlobalsValue);
const globals = {
values: globalsValues,
diff --git a/packages/sra-report/src/types.ts b/packages/sra-report/src/types.ts
deleted file mode 100644
index f08ef4042..000000000
--- a/packages/sra-report/src/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface Schema {
- id: string;
-}