Skip to content

Commit

Permalink
chore(release): 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherwin H committed Jun 6, 2019
1 parent 92fb2c6 commit b5d74af
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="1.4.1"></a>
## [1.4.1](https://github.com/imgix/imgix-core-js/compare/1.4.0...1.4.1) (2019-06-14)

* fix: allow `ImgixClient` to be initialized by using the deprecated `host` argument ([#49](https://github.com/imgix/imgix-core-js/pull/49))


<a name="1.4.0"></a>
## [1.4.0](https://github.com/imgix/imgix-core-js/compare/1.3.0...1.4.0) (2019-06-05)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imgix-core-js",
"version": "1.4.0",
"version": "1.4.1",
"homepage": "https://github.com/imgix/imgix-core-js",
"authors": [
"Kelly Sutton <michael.k.sutton@gmail.com>",
Expand Down
29 changes: 14 additions & 15 deletions dist/imgix-core-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
var Base64 = _jsBase64.Base64 || _jsBase64;
var crc = _crc;

var VERSION = '1.4.0';
var VERSION = '1.4.1';
var SHARD_STRATEGY_CRC = 'crc';
var SHARD_STRATEGY_CYCLE = 'cycle';
var DOMAIN_REGEX = /^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i;
Expand Down Expand Up @@ -49,34 +49,33 @@
console.warn("Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.");
}
else if (this.settings.domains.length == 0) {
if (typeof(this.settings.domain) != "string" && this.settings.domain != null) {
throw new Error('ImgixClient.settings.domain only accepts a string argument');
if (this.settings.host) {
console.warn("'host' argument is deprecated; either use 'domain' or 'domains' instead.");
this.settings.domains[0] = this.settings.host;
}
else if(this.settings.domain != null) {
if (typeof this.settings.domain == "string") {
this.settings.domains = [this.settings.domain];
}
else {
throw new Error('ImgixClient.settings.domain only accepts a string argument');
}
}
else {
this.settings.domains = [this.settings.domain];
throw new Error('ImgixClient must be passed valid domain(s)');
}
}
}
else {
else if (this.settings.domains.length != 0) {
this.settings.domains = [this.settings.domains];
}

if (!this.settings.host && this.settings.domains == 0) {
throw new Error('ImgixClient must be passed valid domain(s)');
}

if (this.settings.shard_strategy !== SHARD_STRATEGY_CRC
&& this.settings.shard_strategy !== SHARD_STRATEGY_CYCLE) {
throw new Error('Shard strategy must be one of ' +
SHARD_STRATEGY_CRC + ' or ' + SHARD_STRATEGY_CYCLE);
}

if (this.settings.host) {
console.warn("'host' argument is deprecated; either use 'domain' or 'domains' instead.");
if (this.settings.domains.length == 0)
this.settings.domains[0] = this.settings.host;
}

this.settings.domains.forEach(function(domain) {
if (DOMAIN_REGEX.exec(domain) == null) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion dist/imgix-core-js.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "imgix-core-js",
"description": "Common boilerplate for all imgix JavaScript-based functionality.",
"version": "1.4.0",
"version": "1.4.1",
"repository": "https://github.com/imgix/imgix-core-js",
"scripts": {
"assert_version": "node assert_version.js",
Expand Down
2 changes: 1 addition & 1 deletion src/imgix-core-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
var Base64 = _jsBase64.Base64 || _jsBase64;
var crc = _crc;

var VERSION = '1.4.0';
var VERSION = '1.4.1';
var SHARD_STRATEGY_CRC = 'crc';
var SHARD_STRATEGY_CYCLE = 'cycle';
var DOMAIN_REGEX = /^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i;
Expand Down

0 comments on commit b5d74af

Please sign in to comment.