aboutsummaryrefslogtreecommitdiffstats
path: root/packages/assert
diff options
context:
space:
mode:
Diffstat (limited to 'packages/assert')
-rw-r--r--packages/assert/CHANGELOG.json19
-rw-r--r--packages/assert/CHANGELOG.md4
-rw-r--r--packages/assert/package.json12
-rw-r--r--packages/assert/src/index.ts4
4 files changed, 31 insertions, 8 deletions
diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json
index 883d55f5b..1ddc6d280 100644
--- a/packages/assert/CHANGELOG.json
+++ b/packages/assert/CHANGELOG.json
@@ -1,5 +1,24 @@
[
{
+ "version": "0.2.14",
+ "changes": [
+ {
+ "note":
+ "Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values",
+ "pr": 821
+ }
+ ]
+ },
+ {
+ "timestamp": 1531149657,
+ "version": "0.2.13",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1529397769,
"version": "0.2.12",
"changes": [
diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md
index 98a83e81b..f0d2f55b0 100644
--- a/packages/assert/CHANGELOG.md
+++ b/packages/assert/CHANGELOG.md
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v0.2.13 - _July 9, 2018_
+
+ * Dependencies updated
+
## v0.2.12 - _June 19, 2018_
* Dependencies updated
diff --git a/packages/assert/package.json b/packages/assert/package.json
index da9657c13..3b9ecbb49 100644
--- a/packages/assert/package.json
+++ b/packages/assert/package.json
@@ -1,6 +1,6 @@
{
"name": "@0xproject/assert",
- "version": "0.2.12",
+ "version": "0.3.0",
"engines": {
"node": ">=6.12"
},
@@ -31,8 +31,8 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
"devDependencies": {
- "@0xproject/monorepo-scripts": "^0.2.1",
- "@0xproject/tslint-config": "^0.4.20",
+ "@0xproject/monorepo-scripts": "^0.2.2",
+ "@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/valid-url": "^1.0.2",
@@ -48,9 +48,9 @@
"typescript": "2.7.1"
},
"dependencies": {
- "@0xproject/json-schemas": "0.8.1",
- "@0xproject/typescript-typings": "^0.4.1",
- "@0xproject/utils": "^0.7.1",
+ "@0xproject/json-schemas": "^1.0.0",
+ "@0xproject/typescript-typings": "^0.4.2",
+ "@0xproject/utils": "^0.7.2",
"lodash": "^4.17.4",
"valid-url": "^1.0.9"
},
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts
index 95c7b658b..8e18416c5 100644
--- a/packages/assert/src/index.ts
+++ b/packages/assert/src/index.ts
@@ -41,8 +41,8 @@ export const assert = {
value: string,
stringEnum: any /* There is no base type for every string enum */,
): void {
- const doesBelongToStringEnum = !_.isUndefined(stringEnum[value]);
- const enumValues = _.keys(stringEnum);
+ const enumValues = _.values(stringEnum);
+ const doesBelongToStringEnum = _.includes(enumValues, value);
const enumValuesAsStrings = _.map(enumValues, enumValue => `'${enumValue}'`);
const enumValuesAsString = enumValuesAsStrings.join(', ');
assert.assert(