From 1897efad42b9f79c3df27e5d69ca456916ee898b Mon Sep 17 00:00:00 2001 From: imgix-git-robot Date: Thu, 16 Dec 2021 15:18:11 +0000 Subject: [PATCH] chore(release): 3.4.0 # [3.4.0](https://github.com/imgix/js-core/compare/v3.2.2...v3.4.0) (2021-12-16) ### Features * dpr srcset options ([#307](https://github.com/imgix/js-core/issues/307)) ([380abf0](https://github.com/imgix/js-core/commit/380abf094ce617d6f23208e57b46169ca9949609)) --- CHANGELOG.md | 6 +++++ dist/imgix-js-core.umd.js | 2 +- dist/index.cjs.js | 51 ++++++++++++++++++++++++++++++++++++--- dist/index.d.ts | 6 +++++ dist/index.esm.js | 51 ++++++++++++++++++++++++++++++++++++--- package-lock.json | 4 +-- package.json | 2 +- src/constants.js | 2 +- 8 files changed, 113 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 833a73cd..04bcc9b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. +## [v3.4.0](https://github.com/imgix/js-core/compare/v3.2.2...v3.4.0) (2021-12-16) + +### Features + +* dpr srcset options ([#307](https://github.com/imgix/js-core/issues/307)) ([380abf0](https://github.com/imgix/js-core/commit/380abf094ce617d6f23208e57b46169ca9949609)) + ## [v3.2.1](https://github.com/imgix/js-core/compare/v3.2.0...v3.2.1) (2021-06-28) * build: remove stale `.d.ts` file from `dist` ([#293](https://github.com/imgix/js-core/pull/293)) diff --git a/dist/imgix-js-core.umd.js b/dist/imgix-js-core.umd.js index 418628a2..4e91f545 100644 --- a/dist/imgix-js-core.umd.js +++ b/dist/imgix-js-core.umd.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ImgixClient=e()}(this,function(){"use strict";function e(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function s(n){for(var t=1;tt.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],r=0,n=0;r>>6-2*n);return e}},t.exports=r}),u={utf8:{stringToBytes:function(t){return u.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(u.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[t>>>5]|=128<>>9<<4)]=t;for(var s=g._ff,c=g._gg,l=g._hh,f=g._ii,u=0;u>>0,o=o+d>>>0,i=i+y>>>0,a=a+p>>>0}return b.endian([n,o,i,a])}var b,m,v,w;b=a,m=f.utf8,v=i,w=f.bin,g._ff=function(t,e,r,n,o,i,a){a=t+(e&r|~e&n)+(o>>>0)+a;return(a<>>32-i)+e},g._gg=function(t,e,r,n,o,i,a){a=t+(e&n|r&~n)+(o>>>0)+a;return(a<>>32-i)+e},g._hh=function(t,e,r,n,o,i,a){a=t+(e^r^n)+(o>>>0)+a;return(a<>>32-i)+e},g._ii=function(t,e,r,n,o,i,a){a=t+(r^(e|~n))+(o>>>0)+a;return(a<>>32-i)+e},g._blocksize=16,g._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);t=b.wordsToBytes(g(t,e));return e&&e.asBytes?t:e&&e.asString?w.bytesToString(t):b.bytesToHex(t)}}),y="3.7.2",p="function"==typeof atob,g="function"==typeof btoa,b="function"==typeof Buffer;const m="function"==typeof TextDecoder?new TextDecoder:void 0,v="function"==typeof TextEncoder?new TextEncoder:void 0;const w=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),A=(t=>{let r={};return t.forEach((t,e)=>r[t]=e),r})(w),x=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,T=String.fromCharCode.bind(String),S="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(t,e=t=>t)=>new Uint8Array(Array.prototype.slice.call(t,0).map(e)),B=t=>t.replace(/=/g,"").replace(/[+\/]/g,t=>"+"==t?"-":"_"),C=t=>t.replace(/[^A-Za-z0-9\+\/]/g,"");var P=e=>{let r,n,o,i,a="";var t=e.length%3;for(let t=0;t>18&63]+w[r>>12&63]+w[r>>6&63]+w[63&r]}return t?a.slice(0,t-3)+"===".substring(t):a};const U=g?t=>btoa(t):b?t=>Buffer.from(t,"binary").toString("base64"):P,j=b?t=>Buffer.from(t).toString("base64"):r=>{let n=[];for(let t=0,e=r.length;te?B(j(t)):j(t),I=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?T(192|e>>>6)+T(128|63&e):T(224|e>>>12&15)+T(128|e>>>6&63)+T(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return T(240|e>>>18&7)+T(128|e>>>12&63)+T(128|e>>>6&63)+T(128|63&e)},R=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_=t=>t.replace(R,I),E=b?t=>Buffer.from(t,"utf8").toString("base64"):v?t=>j(v.encode(t)):t=>U(_(t)),F=(t,e=!1)=>e?B(E(t)):E(t);var k=t=>F(t,!0);const z=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,D=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return T(55296+(e>>>10))+T(56320+(1023&e));case 3:return T((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return T((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},L=t=>t.replace(z,D);g=e=>{if(e=e.replace(/\s+/g,""),!x.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let r,n="",o,i;for(let t=0;t>16&255):64===i?T(r>>16&255,r>>8&255):T(r>>16&255,r>>8&255,255&r);return n};const W=p?t=>atob(C(t)):b?t=>Buffer.from(t,"base64").toString("binary"):g,M=b?t=>S(Buffer.from(t,"base64")):t=>S(W(t),t=>t.charCodeAt(0)),Z=t=>M(q(t)),N=b?t=>Buffer.from(t,"base64").toString("utf8"):m?t=>m.decode(M(t)):t=>L(W(t)),q=t=>C(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),H=t=>N(q(t));function V(){var t=(t,e)=>Object.defineProperty(String.prototype,t,$(e));t("fromBase64",function(){return H(this)}),t("toBase64",function(t){return F(this,t)}),t("toBase64URI",function(){return F(this,!0)}),t("toBase64URL",function(){return F(this,!0)}),t("toUint8Array",function(){return Z(this)})}function Q(){var t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,$(e));t("toBase64",function(t){return O(this,t)}),t("toBase64URI",function(){return O(this,!0)}),t("toBase64URL",function(){return O(this,!0)})}const $=t=>({value:t,enumerable:!1,writable:!0,configurable:!0});const G={version:y,VERSION:"3.7.2",atob:W,atobPolyfill:g,btoa:U,btoaPolyfill:P,fromBase64:H,toBase64:F,encode:F,encodeURI:k,encodeURL:k,utob:_,btou:L,decode:H,isValid:t=>{if("string"!=typeof t)return!1;t=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:O,toUint8Array:Z,extendString:V,extendUint8Array:Q,extendBuiltins:()=>{V(),Q()}};var J=/^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i,K={1:75,2:50,3:35,4:23,5:20},X={domain:null,useHTTPS:!0,includeLibraryParam:!0,urlPrefix:"https://",secureURLToken:null};function Y(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||t<=0||e<=0||et.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],r=0,n=0;r>>6-2*n);return e}},t.exports=r}),u={utf8:{stringToBytes:function(t){return u.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(u.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[t>>>5]|=128<>>9<<4)]=t;for(var s=p._ff,c=p._gg,l=p._hh,f=p._ii,u=0;u>>0,o=o+d>>>0,i=i+y>>>0,a=a+b>>>0}return g.endian([n,o,i,a])}var g,m,v,w;g=a,m=h.utf8,v=i,w=h.bin,p._ff=function(t,e,r,n,o,i,a){a=t+(e&r|~e&n)+(o>>>0)+a;return(a<>>32-i)+e},p._gg=function(t,e,r,n,o,i,a){a=t+(e&n|r&~n)+(o>>>0)+a;return(a<>>32-i)+e},p._hh=function(t,e,r,n,o,i,a){a=t+(e^r^n)+(o>>>0)+a;return(a<>>32-i)+e},p._ii=function(t,e,r,n,o,i,a){a=t+(r^(e|~n))+(o>>>0)+a;return(a<>>32-i)+e},p._blocksize=16,p._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);t=g.wordsToBytes(p(t,e));return e&&e.asBytes?t:e&&e.asString?w.bytesToString(t):g.bytesToHex(t)}}),b="3.7.2",p="function"==typeof atob,g="function"==typeof btoa,m="function"==typeof Buffer;const v="function"==typeof TextDecoder?new TextDecoder:void 0,w="function"==typeof TextEncoder?new TextEncoder:void 0;const A=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),x=(t=>{let r={};return t.forEach((t,e)=>r[t]=e),r})(A),S=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,T=String.fromCharCode.bind(String),P="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(t,e=t=>t)=>new Uint8Array(Array.prototype.slice.call(t,0).map(e)),B=t=>t.replace(/=/g,"").replace(/[+\/]/g,t=>"+"==t?"-":"_"),C=t=>t.replace(/[^A-Za-z0-9\+\/]/g,"");var j=e=>{let r,n,o,i,a="";var t=e.length%3;for(let t=0;t>18&63]+A[r>>12&63]+A[r>>6&63]+A[63&r]}return t?a.slice(0,t-3)+"===".substring(t):a};const U=g?t=>btoa(t):m?t=>Buffer.from(t,"binary").toString("base64"):j,R=m?t=>Buffer.from(t).toString("base64"):r=>{let n=[];for(let t=0,e=r.length;te?B(R(t)):R(t),E=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?T(192|e>>>6)+T(128|63&e):T(224|e>>>12&15)+T(128|e>>>6&63)+T(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return T(240|e>>>18&7)+T(128|e>>>12&63)+T(128|e>>>6&63)+T(128|63&e)},I=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_=t=>t.replace(I,E),F=m?t=>Buffer.from(t,"utf8").toString("base64"):w?t=>R(w.encode(t)):t=>U(_(t)),k=(t,e=!1)=>e?B(F(t)):F(t);var z=t=>k(t,!0);const D=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return T(55296+(e>>>10))+T(56320+(1023&e));case 3:return T((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return T((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},W=t=>t.replace(D,L);g=e=>{if(e=e.replace(/\s+/g,""),!S.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let r,n="",o,i;for(let t=0;t>16&255):64===i?T(r>>16&255,r>>8&255):T(r>>16&255,r>>8&255,255&r);return n};const M=p?t=>atob(C(t)):m?t=>Buffer.from(t,"base64").toString("binary"):g,Z=m?t=>P(Buffer.from(t,"base64")):t=>P(M(t),t=>t.charCodeAt(0)),N=t=>Z(q(t)),Q=m?t=>Buffer.from(t,"base64").toString("utf8"):v?t=>v.decode(Z(t)):t=>W(M(t)),q=t=>C(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),H=t=>Q(q(t));function V(){var t=(t,e)=>Object.defineProperty(String.prototype,t,G(e));t("fromBase64",function(){return H(this)}),t("toBase64",function(t){return k(this,t)}),t("toBase64URI",function(){return k(this,!0)}),t("toBase64URL",function(){return k(this,!0)}),t("toUint8Array",function(){return N(this)})}function $(){var t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,G(e));t("toBase64",function(t){return O(this,t)}),t("toBase64URI",function(){return O(this,!0)}),t("toBase64URL",function(){return O(this,!0)})}const G=t=>({value:t,enumerable:!1,writable:!0,configurable:!0});const J={version:b,VERSION:"3.7.2",atob:M,atobPolyfill:g,btoa:U,btoaPolyfill:j,fromBase64:H,toBase64:k,encode:k,encodeURI:z,encodeURL:z,utob:_,btou:W,decode:H,isValid:t=>{if("string"!=typeof t)return!1;t=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:O,toUint8Array:N,extendString:V,extendUint8Array:$,extendBuiltins:()=>{V(),$()}};var K=/^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i,X={1:75,2:50,3:35,4:23,5:20},Y=[1,2,3,4,5],tt={domain:null,useHTTPS:!0,includeLibraryParam:!0,urlPrefix:"https://",secureURLToken:null};function et(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||t<=0||e<=0||e= 1 && dpr <= 5; + }); + + if (!allValidDPR) { + throw new Error('The devicePixelRatios argument can only contain positive integer values between 1 and 5'); + } + } +} +function validateVariableQualities(variableQualities) { + if (_typeof(variableQualities) !== 'object') { + throw new Error('The variableQualities argument can only be an object'); + } +} var ImgixClient = /*#__PURE__*/function () { function ImgixClient() { @@ -364,17 +399,27 @@ var ImgixClient = /*#__PURE__*/function () { value: function _buildDPRSrcSet(path, params, options) { var _this2 = this; - var targetRatios = [1, 2, 3, 4, 5]; + if (options.devicePixelRatios) { + validateDevicePixelRatios(options.devicePixelRatios); + } + + var targetRatios = options.devicePixelRatios || DEFAULT_DPR; var disableVariableQuality = options.disableVariableQuality || false; if (!disableVariableQuality) { validateVariableQuality(disableVariableQuality); } + if (options.variableQualities) { + validateVariableQualities(options.variableQualities); + } + + var qualities = _objectSpread2(_objectSpread2({}, DPR_QUALITIES), options.variableQualities); + var withQuality = function withQuality(path, params, dpr) { return "".concat(_this2.buildURL(path, _objectSpread2(_objectSpread2({}, params), {}, { dpr: dpr, - q: params.q || DPR_QUALITIES[dpr] + q: params.q || qualities[dpr] || qualities[Math.floor(dpr)] })), " ").concat(dpr, "x"); }; diff --git a/dist/index.d.ts b/dist/index.d.ts index 123a19e5..91365eae 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -26,12 +26,18 @@ declare class ImgixClient { ): number[]; } +export type DevicePixelRatio = 1 | 2 | 3 | 4 | 5 | number; + +export type VariableQualities = { [key in DevicePixelRatio]?: number }; + export interface SrcSetOptions { widths?: number[]; widthTolerance?: number; minWidth?: number; maxWidth?: number; disableVariableQuality?: boolean; + devicePixelRatios?: DevicePixelRatio[]; + variableQualities?: VariableQualities; } export default ImgixClient; diff --git a/dist/index.esm.js b/dist/index.esm.js index 4b007f28..53d276c2 100644 --- a/dist/index.esm.js +++ b/dist/index.esm.js @@ -39,6 +39,22 @@ function _objectSpread2(target) { return target; } +function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); +} + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); @@ -152,7 +168,7 @@ function _nonIterableRest() { } // package version used in the ix-lib parameter -var VERSION = '3.2.1'; // regex pattern used to determine if a domain is valid +var VERSION = '3.4.0'; // regex pattern used to determine if a domain is valid 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; // minimum generated srcset width @@ -169,6 +185,7 @@ var DPR_QUALITIES = { 4: 23, 5: 20 }; +var DEFAULT_DPR = [1, 2, 3, 4, 5]; var DEFAULT_OPTIONS = { domain: null, useHTTPS: true, @@ -224,6 +241,24 @@ function validateVariableQuality(disableVariableQuality) { throw new Error('The disableVariableQuality argument can only be passed a Boolean value'); } } +function validateDevicePixelRatios(devicePixelRatios) { + if (!Array.isArray(devicePixelRatios) || !devicePixelRatios.length) { + throw new Error('The devicePixelRatios argument can only be passed a valid non-empty array of integers'); + } else { + var allValidDPR = devicePixelRatios.every(function (dpr) { + return typeof dpr === 'number' && dpr >= 1 && dpr <= 5; + }); + + if (!allValidDPR) { + throw new Error('The devicePixelRatios argument can only contain positive integer values between 1 and 5'); + } + } +} +function validateVariableQualities(variableQualities) { + if (_typeof(variableQualities) !== 'object') { + throw new Error('The variableQualities argument can only be an object'); + } +} var ImgixClient = /*#__PURE__*/function () { function ImgixClient() { @@ -358,17 +393,27 @@ var ImgixClient = /*#__PURE__*/function () { value: function _buildDPRSrcSet(path, params, options) { var _this2 = this; - var targetRatios = [1, 2, 3, 4, 5]; + if (options.devicePixelRatios) { + validateDevicePixelRatios(options.devicePixelRatios); + } + + var targetRatios = options.devicePixelRatios || DEFAULT_DPR; var disableVariableQuality = options.disableVariableQuality || false; if (!disableVariableQuality) { validateVariableQuality(disableVariableQuality); } + if (options.variableQualities) { + validateVariableQualities(options.variableQualities); + } + + var qualities = _objectSpread2(_objectSpread2({}, DPR_QUALITIES), options.variableQualities); + var withQuality = function withQuality(path, params, dpr) { return "".concat(_this2.buildURL(path, _objectSpread2(_objectSpread2({}, params), {}, { dpr: dpr, - q: params.q || DPR_QUALITIES[dpr] + q: params.q || qualities[dpr] || qualities[Math.floor(dpr)] })), " ").concat(dpr, "x"); }; diff --git a/package-lock.json b/package-lock.json index 1549074f..ed402679 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@imgix/js-core", - "version": "3.2.2", + "version": "3.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@imgix/js-core", - "version": "3.2.2", + "version": "3.4.0", "license": "BSD-2-Clause", "dependencies": { "js-base64": "~3.7.0", diff --git a/package.json b/package.json index 67cf9bbc..67743569 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@imgix/js-core", "description": "A JavaScript client library for generating image URLs with imgix", - "version": "3.2.2", + "version": "3.4.0", "repository": "https://github.com/imgix/js-core", "license": "BSD-2-Clause", "main": "dist/index.cjs.js", diff --git a/src/constants.js b/src/constants.js index 1732c120..30eb00ab 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,5 +1,5 @@ // package version used in the ix-lib parameter -export const VERSION = '3.2.2'; +export const VERSION = '3.4.0'; // regex pattern used to determine if a domain is valid export const 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; // minimum generated srcset width