From 08ab81c54c1e845a4239648e8cea65a930fcc99d Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 5 Mar 2018 15:24:55 -0800 Subject: Rename isHttpUrl to isWebUri in assert package --- packages/assert/CHANGELOG.md | 4 ++++ packages/assert/src/index.ts | 4 ++-- packages/assert/test/assert_test.ts | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'packages/assert') diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md index b37a810e3..35bf4faef 100644 --- a/packages/assert/CHANGELOG.md +++ b/packages/assert/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v0.2.0 - _TBD, 2018_ + + * Rename `isHttpUrl` to `isWebUri` (#412) + ## v0.1.0 - _March 4, 2018_ * Remove isETHAddressHex checksum address check and assume address will be lowercased (#373) diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts index 40d083cb6..171909c93 100644 --- a/packages/assert/src/index.ts +++ b/packages/assert/src/index.ts @@ -75,9 +75,9 @@ Encountered: ${JSON.stringify(value, null, '\t')} Validation errors: ${validationResult.errors.join(', ')}`; this.assert(!hasValidationErrors, msg); }, - isHttpUrl(variableName: string, value: any): void { + isWebUri(variableName: string, value: any): void { const isValidUrl = !_.isUndefined(validUrl.isWebUri(value)); - this.assert(isValidUrl, this.typeAssertionMessage(variableName, 'http url', value)); + this.assert(isValidUrl, this.typeAssertionMessage(variableName, 'web uri', value)); }, isUri(variableName: string, value: any): void { const isValidUri = !_.isUndefined(validUrl.isUri(value)); diff --git a/packages/assert/test/assert_test.ts b/packages/assert/test/assert_test.ts index b0fa398d6..1d9a34ed9 100644 --- a/packages/assert/test/assert_test.ts +++ b/packages/assert/test/assert_test.ts @@ -183,7 +183,7 @@ describe('Assertions', () => { ); }); }); - describe('#isHttpUrl', () => { + describe('#isWebUri', () => { it('should not throw for valid input', () => { const validInputs = [ 'http://www.google.com', @@ -191,7 +191,7 @@ describe('Assertions', () => { 'https://api.radarrelay.com/0x/v0/', 'https://zeroex.beta.radarrelay.com:8000/0x/v0/', ]; - validInputs.forEach(input => expect(assert.isHttpUrl.bind(assert, variableName, input)).to.not.throw()); + validInputs.forEach(input => expect(assert.isWebUri.bind(assert, variableName, input)).to.not.throw()); }); it('should throw for invalid input', () => { const invalidInputs = [ @@ -205,7 +205,7 @@ describe('Assertions', () => { 'user:password@api.example-relayer.net', '//api.example-relayer.net', ]; - invalidInputs.forEach(input => expect(assert.isHttpUrl.bind(assert, variableName, input)).to.throw()); + invalidInputs.forEach(input => expect(assert.isWebUri.bind(assert, variableName, input)).to.throw()); }); }); describe('#isUri', () => { -- cgit v1.2.3 From c71b710d7ea194095ddeba9e882c023f97a30338 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 8 Mar 2018 10:14:51 -0800 Subject: Updated CHANGELOGs --- packages/assert/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/assert') diff --git a/packages/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md index 35bf4faef..4be5087d4 100644 --- a/packages/assert/CHANGELOG.md +++ b/packages/assert/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## v0.2.0 - _TBD, 2018_ +## v0.2.0 - _March 8, 2018_ * Rename `isHttpUrl` to `isWebUri` (#412) -- cgit v1.2.3 From 8e5a876b37990656bc19c873c926dd2c434e2ead Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 8 Mar 2018 10:20:46 -0800 Subject: Publish - 0x.js@0.33.1 - @0xproject/abi-gen@0.2.5 - @0xproject/assert@0.2.0 - @0xproject/base-contract@0.0.3 - @0xproject/connect@0.6.3 - contracts@2.1.15 - @0xproject/deployer@0.2.1 - @0xproject/dev-utils@0.2.1 - @0xproject/json-schemas@0.7.14 - @0xproject/react-docs@0.0.1 - @0xproject/react-shared@0.0.1 - @0xproject/sra-report@0.0.1 - @0xproject/subproviders@0.7.0 - @0xproject/testnet-faucets@1.0.16 - @0xproject/types@0.3.1 - @0xproject/utils@0.4.1 - @0xproject/web3-wrapper@0.2.1 - @0xproject/website@0.0.18 --- packages/assert/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/assert') diff --git a/packages/assert/package.json b/packages/assert/package.json index cfe019444..9ecb0bcd0 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/assert", - "version": "0.1.0", + "version": "0.2.0", "description": "Provides a standard way of performing type and schema validation across 0x projects", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", @@ -38,8 +38,8 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/json-schemas": "^0.7.13", - "@0xproject/utils": "^0.4.0", + "@0xproject/json-schemas": "^0.7.14", + "@0xproject/utils": "^0.4.1", "lodash": "^4.17.4", "valid-url": "^1.0.9" } -- cgit v1.2.3