hashids
Advanced tools
Comparing version 2.2.6 to 2.2.7
@@ -11,3 +11,3 @@ (function (global, factory) { | ||
factory(mod.exports); | ||
global.Hashids = mod.exports; | ||
global.Hashids = mod.exports.default; | ||
} | ||
@@ -17,16 +17,22 @@ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { | ||
_exports.__esModule = true; | ||
Object.defineProperty(_exports, "__esModule", { | ||
value: true | ||
}); | ||
_exports.onlyChars = _exports.withoutChars = _exports.keepUnique = _exports.default = void 0; | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
var Hashids = | ||
/*#__PURE__*/ | ||
function () { | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var Hashids = /*#__PURE__*/function () { | ||
function Hashids(salt, minLength, alphabet, seps) { | ||
@@ -270,15 +276,4 @@ if (salt === void 0) { | ||
for (var _iterator = idArray, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var subId = _ref; | ||
for (var _iterator = _createForOfIteratorHelperLoose(idArray), _step; !(_step = _iterator()).done;) { | ||
var subId = _step.value; | ||
var buffer = [lotteryChar].concat(_toConsumableArray(this.salt), _toConsumableArray(lastAlphabet)); | ||
@@ -285,0 +280,0 @@ var nextAlphabet = shuffle(lastAlphabet, buffer.slice(0, lastAlphabet.length)); |
@@ -1,2 +0,2 @@ | ||
!function(t,e){if("function"==typeof define&&define.amd)define("Hashids",["exports"],e);else if("undefined"!=typeof exports)e(exports);else{var n={exports:{}};e(n.exports),t.Hashids=n.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(t){"use strict";function e(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t.__esModule=!0,t.onlyChars=t.withoutChars=t.keepUnique=t.default=void 0;var n=function(){function t(t,n,l,u){if(void 0===t&&(t=""),void 0===n&&(n=0),void 0===l&&(l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"),void 0===u&&(u="cfhistuCFHISTU"),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is "+typeof n+")");if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is "+typeof t+")");if("string"!=typeof l)throw new TypeError("Hashids: Provided alphabet has to be a string (is "+typeof l+")");var p=Array.from(t),c=Array.from(l),g=Array.from(u);this.salt=p;var d=o(c);if(d.length<r)throw new Error("Hashids: alphabet must contain at least "+r+" unique characters, provided: "+d);this.alphabet=a(d,g);var b,m,w,I=h(g,d);(this.seps=f(I,p),0===this.seps.length||this.alphabet.length/this.seps.length>i)&&((b=Math.ceil(this.alphabet.length/i))>this.seps.length&&(m=b-this.seps.length,(w=this.seps).push.apply(w,e(this.alphabet.slice(0,m))),this.alphabet=this.alphabet.slice(m)));this.alphabet=f(this.alphabet,p);var x=Math.ceil(this.alphabet.length/s);this.alphabet.length<3?(this.guards=this.seps.slice(0,x),this.seps=this.seps.slice(x)):(this.guards=this.alphabet.slice(0,x),this.alphabet=this.alphabet.slice(x)),this.guardsRegExp=v(this.guards),this.sepsRegExp=v(this.seps),this.allowedCharsRegExp=y([].concat(e(this.alphabet),e(this.guards),e(this.seps)))}var n=t.prototype;return n.encode=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s="";return(r=Array.isArray(t)?t:[].concat(e(null!=t?[t]:[]),e(r))).length?(r.every(l)||(r=r.map((function(t){return"bigint"==typeof t||"number"==typeof t?t:d(String(t))}))),r.every(u)?this._encode(r).join(""):s):s},n.decode=function(t){return t&&"string"==typeof t&&0!==t.length?this._decode(t):[]},n.encodeHex=function(t){switch(typeof t){case"bigint":t=t.toString(16);break;case"string":if(!/^[0-9a-fA-F]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: "+typeof t+")")}var e=b(t,12,(function(t){return parseInt("1"+t,16)}));return this.encode(e)},n.decodeHex=function(t){return this.decode(t).map((function(t){return t.toString(16).slice(1)})).join("")},n._encode=function(t){var n=this,r=this.alphabet,i=t.reduce((function(t,e,n){return t+("bigint"==typeof e?Number(e%BigInt(n+100)):e%(n+100))}),0),s=[r[i%r.length]],o=s.slice(),a=this.seps,h=this.guards;if(t.forEach((function(i,h){var l,u=o.concat(n.salt,r);r=f(r,u);var c=p(i,r);if((l=s).push.apply(l,e(c)),h+1<t.length){var g=c[0].codePointAt(0)+h,d="bigint"==typeof i?Number(i%BigInt(g)):i%g;s.push(a[d%a.length])}})),s.length<this.minLength){var l=(i+s[0].codePointAt(0))%h.length;if(s.unshift(h[l]),s.length<this.minLength){var u=(i+s[2].codePointAt(0))%h.length;s.push(h[u])}}for(var c=Math.floor(r.length/2);s.length<this.minLength;){var g,d;r=f(r,r),(g=s).unshift.apply(g,e(r.slice(c))),(d=s).push.apply(d,e(r.slice(0,c)));var b=s.length-this.minLength;if(b>0){var v=b/2;s=s.slice(v,v+this.minLength)}}return s},n.isValidId=function(t){return this.allowedCharsRegExp.test(t)},n._decode=function(t){if(!this.isValidId(t))throw new Error("The provided ID ("+t+") is invalid, as it contains characters that do not exist in the alphabet ("+this.guards.join("")+this.seps.join("")+this.alphabet.join("")+")");var n=t.split(this.guardsRegExp),r=n[3===n.length||2===n.length?1:0];if(0===r.length)return[];var i=r[Symbol.iterator]().next().value,s=r.slice(i.length).split(this.sepsRegExp),o=this.alphabet,a=[],h=s,l=Array.isArray(h),u=0;for(h=l?h:h[Symbol.iterator]();;){var p;if(l){if(u>=h.length)break;p=h[u++]}else{if((u=h.next()).done)break;p=u.value}var g=p,d=f(o,[i].concat(e(this.salt),e(o)).slice(0,o.length));a.push(c(Array.from(g),d)),o=d}return this._encode(a).join("")!==t?[]:a},t}();t.default=n;var r=16,i=3.5,s=12,o=function(t){return Array.from(new Set(t))};t.keepUnique=o;var a=function(t,e){return t.filter((function(t){return!e.includes(t)}))};t.withoutChars=a;var h=function(t,e){return t.filter((function(t){return e.includes(t)}))};t.onlyChars=h;var l=function(t){return"bigint"==typeof t||!Number.isNaN(Number(t))&&Math.floor(Number(t))===t},u=function(t){return"bigint"==typeof t||t>=0&&Number.isSafeInteger(t)};function f(t,e){if(0===e.length)return t;for(var n,r=t.slice(),i=r.length-1,s=0,o=0;i>0;i--,s++){o+=n=e[s%=e.length].codePointAt(0);var a=(n+s+o)%i,h=r[i],l=r[a];r[a]=h,r[i]=l}return r}var p=function(t,e){var n=[];if("bigint"==typeof t){var r=BigInt(e.length);do{n.unshift(e[Number(t%r)]),t/=r}while(t>BigInt(0))}else do{n.unshift(e[t%e.length]),t=Math.floor(t/e.length)}while(t>0);return n},c=function(t,e){return t.reduce((function(n,r){var i=e.indexOf(r);if(-1===i)throw new Error("The provided ID ("+t.join("")+") is invalid, as it contains characters that do not exist in the alphabet ("+e.join("")+")");if("bigint"==typeof n)return n*BigInt(e.length)+BigInt(i);var s=n*e.length+i;if(Number.isSafeInteger(s))return s;if("function"==typeof BigInt)return BigInt(n)*BigInt(e.length)+BigInt(i);throw new Error("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment")}),0)},g=/^\+?[0-9]+$/,d=function(t){return g.test(t)?parseInt(t,10):NaN},b=function(t,e,n){return Array.from({length:Math.ceil(t.length/e)},(function(r,i){return n(t.slice(i*e,(i+1)*e))}))},v=function(t){return new RegExp(t.map((function(t){return m(t)})).sort((function(t,e){return e.length-t.length})).join("|"))},y=function(t){return new RegExp("^["+t.map((function(t){return m(t)})).sort((function(t,e){return e.length-t.length})).join("")+"]+$")},m=function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}})); | ||
!function(t,e){if("function"==typeof define&&define.amd)define("Hashids",["exports"],e);else if("undefined"!=typeof exports)e(exports);else{var n={exports:{}};e(n.exports),t.Hashids=n.exports.default}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(t){"use strict";function e(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.onlyChars=t.withoutChars=t.keepUnique=t.default=void 0;var i=function(){function t(t,n,r,i){if(void 0===t&&(t=""),void 0===n&&(n=0),void 0===r&&(r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"),void 0===i&&(i="cfhistuCFHISTU"),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is "+typeof n+")");if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is "+typeof t+")");if("string"!=typeof r)throw new TypeError("Hashids: Provided alphabet has to be a string (is "+typeof r+")");var f=Array.from(t),c=Array.from(r),d=Array.from(i);this.salt=f;var g=h(c);if(g.length<o)throw new Error("Hashids: alphabet must contain at least "+o+" unique characters, provided: "+g);this.alphabet=u(g,d);var b,y,v,I=l(d,g);(this.seps=p(I,f),0===this.seps.length||this.alphabet.length/this.seps.length>s)&&((b=Math.ceil(this.alphabet.length/s))>this.seps.length&&(y=b-this.seps.length,(v=this.seps).push.apply(v,e(this.alphabet.slice(0,y))),this.alphabet=this.alphabet.slice(y)));this.alphabet=p(this.alphabet,f);var A=Math.ceil(this.alphabet.length/a);this.alphabet.length<3?(this.guards=this.seps.slice(0,A),this.seps=this.seps.slice(A)):(this.guards=this.alphabet.slice(0,A),this.alphabet=this.alphabet.slice(A)),this.guardsRegExp=m(this.guards),this.sepsRegExp=m(this.seps),this.allowedCharsRegExp=w([].concat(e(this.alphabet),e(this.guards),e(this.seps)))}var r=t.prototype;return r.encode=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o="";return(r=Array.isArray(t)?t:[].concat(e(null!=t?[t]:[]),e(r))).length?(r.every(f)||(r=r.map((function(t){return"bigint"==typeof t||"number"==typeof t?t:y(String(t))}))),r.every(c)?this._encode(r).join(""):o):o},r.decode=function(t){return t&&"string"==typeof t&&0!==t.length?this._decode(t):[]},r.encodeHex=function(t){switch(typeof t){case"bigint":t=t.toString(16);break;case"string":if(!/^[0-9a-fA-F]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: "+typeof t+")")}var e=v(t,12,(function(t){return parseInt("1"+t,16)}));return this.encode(e)},r.decodeHex=function(t){return this.decode(t).map((function(t){return t.toString(16).slice(1)})).join("")},r._encode=function(t){var n=this,r=this.alphabet,i=t.reduce((function(t,e,n){return t+("bigint"==typeof e?Number(e%BigInt(n+100)):e%(n+100))}),0),o=[r[i%r.length]],s=o.slice(),a=this.seps,h=this.guards;if(t.forEach((function(i,h){var u,l=s.concat(n.salt,r);r=p(r,l);var f=d(i,r);if((u=o).push.apply(u,e(f)),h+1<t.length){var c=f[0].codePointAt(0)+h,g="bigint"==typeof i?Number(i%BigInt(c)):i%c;o.push(a[g%a.length])}})),o.length<this.minLength){var u=(i+o[0].codePointAt(0))%h.length;if(o.unshift(h[u]),o.length<this.minLength){var l=(i+o[2].codePointAt(0))%h.length;o.push(h[l])}}for(var f=Math.floor(r.length/2);o.length<this.minLength;){var c,g;r=p(r,r),(c=o).unshift.apply(c,e(r.slice(f))),(g=o).push.apply(g,e(r.slice(0,f)));var b=o.length-this.minLength;if(b>0){var y=b/2;o=o.slice(y,y+this.minLength)}}return o},r.isValidId=function(t){return this.allowedCharsRegExp.test(t)},r._decode=function(t){if(!this.isValidId(t))throw new Error("The provided ID ("+t+") is invalid, as it contains characters that do not exist in the alphabet ("+this.guards.join("")+this.seps.join("")+this.alphabet.join("")+")");var r=t.split(this.guardsRegExp),i=r[3===r.length||2===r.length?1:0];if(0===i.length)return[];for(var o,s=i[Symbol.iterator]().next().value,a=i.slice(s.length).split(this.sepsRegExp),h=this.alphabet,u=[],l=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=n(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}(a);!(o=l()).done;){var f=o.value,c=p(h,[s].concat(e(this.salt),e(h)).slice(0,h.length));u.push(g(Array.from(f),c)),h=c}return this._encode(u).join("")!==t?[]:u},t}();t.default=i;var o=16,s=3.5,a=12,h=function(t){return Array.from(new Set(t))};t.keepUnique=h;var u=function(t,e){return t.filter((function(t){return!e.includes(t)}))};t.withoutChars=u;var l=function(t,e){return t.filter((function(t){return e.includes(t)}))};t.onlyChars=l;var f=function(t){return"bigint"==typeof t||!Number.isNaN(Number(t))&&Math.floor(Number(t))===t},c=function(t){return"bigint"==typeof t||t>=0&&Number.isSafeInteger(t)};function p(t,e){if(0===e.length)return t;for(var n,r=t.slice(),i=r.length-1,o=0,s=0;i>0;i--,o++){s+=n=e[o%=e.length].codePointAt(0);var a=(n+o+s)%i,h=r[i],u=r[a];r[a]=h,r[i]=u}return r}var d=function(t,e){var n=[];if("bigint"==typeof t){var r=BigInt(e.length);do{n.unshift(e[Number(t%r)]),t/=r}while(t>BigInt(0))}else do{n.unshift(e[t%e.length]),t=Math.floor(t/e.length)}while(t>0);return n},g=function(t,e){return t.reduce((function(n,r){var i=e.indexOf(r);if(-1===i)throw new Error("The provided ID ("+t.join("")+") is invalid, as it contains characters that do not exist in the alphabet ("+e.join("")+")");if("bigint"==typeof n)return n*BigInt(e.length)+BigInt(i);var o=n*e.length+i;if(Number.isSafeInteger(o))return o;if("function"==typeof BigInt)return BigInt(n)*BigInt(e.length)+BigInt(i);throw new Error("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment")}),0)},b=/^\+?[0-9]+$/,y=function(t){return b.test(t)?parseInt(t,10):NaN},v=function(t,e,n){return Array.from({length:Math.ceil(t.length/e)},(function(r,i){return n(t.slice(i*e,(i+1)*e))}))},m=function(t){return new RegExp(t.map((function(t){return I(t)})).sort((function(t,e){return e.length-t.length})).join("|"))},w=function(t){return new RegExp("^["+t.map((function(t){return I(t)})).sort((function(t,e){return e.length-t.length})).join("")+"]+$")},I=function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}})); | ||
//# sourceMappingURL=hashids.min.js.map |
@@ -1,12 +0,16 @@ | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
var Hashids = | ||
/*#__PURE__*/ | ||
function () { | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var Hashids = /*#__PURE__*/function () { | ||
function Hashids(salt, minLength, alphabet, seps) { | ||
@@ -250,15 +254,4 @@ if (salt === void 0) { | ||
for (var _iterator = idArray, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var subId = _ref; | ||
for (var _iterator = _createForOfIteratorHelperLoose(idArray), _step; !(_step = _iterator()).done;) { | ||
var subId = _step.value; | ||
var buffer = [lotteryChar].concat(_toConsumableArray(this.salt), _toConsumableArray(lastAlphabet)); | ||
@@ -265,0 +258,0 @@ var nextAlphabet = shuffle(lastAlphabet, buffer.slice(0, lastAlphabet.length)); |
@@ -17,3 +17,3 @@ { | ||
], | ||
"version": "2.2.6", | ||
"version": "2.2.7", | ||
"homepage": "http://hashids.org/javascript", | ||
@@ -57,3 +57,3 @@ "repository": { | ||
"coverage": "jest --coverage && cat coverage/lcov.info | coveralls", | ||
"build:umd": "babel lib/hashids.ts --source-maps -o dist/hashids.js", | ||
"build:umd": "babel lib/hashids.ts --source-maps -o dist/hashids.js && replace-in-files --string='global.Hashids = mod.exports;' --replacement='global.Hashids = mod.exports.default;' dist/hashids.js", | ||
"build:esm": "BABEL_MODULES=1 babel lib/hashids.ts --source-maps -o esm/index.js", | ||
@@ -79,31 +79,34 @@ "minify": "cd dist && terser hashids.js -o hashids.min.js --source-map \"url=hashids.min.js.map\" --compress --mangle", | ||
"devDependencies": { | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.8.4", | ||
"@babel/cli": "^7.12.10", | ||
"@babel/core": "^7.12.10", | ||
"@babel/helper-plugin-utils": "^7.10.4", | ||
"@babel/plugin-syntax-bigint": "^7.8.3", | ||
"@babel/plugin-transform-destructuring": "^7.8.3", | ||
"@babel/plugin-transform-spread": "^7.8.3", | ||
"@babel/preset-env": "^7.8.4", | ||
"@babel/preset-typescript": "^7.8.3", | ||
"@babel/register": "^7.8.3", | ||
"@babel/plugin-transform-destructuring": "^7.12.1", | ||
"@babel/plugin-transform-modules-umd": "^7.12.1", | ||
"@babel/plugin-transform-spread": "^7.12.1", | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/preset-typescript": "^7.12.7", | ||
"@babel/register": "^7.12.10", | ||
"@types/jest": "^26.0.19", | ||
"@types/node": "^13.7.0", | ||
"@typescript-eslint/eslint-plugin": "^2.19.0", | ||
"@typescript-eslint/parser": "^2.19.0", | ||
"@yarnpkg/pnpify": "^2.0.0-rc.17", | ||
"coveralls": "^3.0.9", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-import-resolver-node": "^0.3.3", | ||
"eslint-plugin-eslint-comments": "^3.1.2", | ||
"eslint-plugin-import": "^2.20.1", | ||
"eslint-plugin-jest": "^23.6.0", | ||
"husky": "^4.2.1", | ||
"jest": "^25.1.0", | ||
"@types/node": "^14.14.14", | ||
"@typescript-eslint/eslint-plugin": "^4.10.0", | ||
"@typescript-eslint/parser": "^4.10.0", | ||
"@yarnpkg/pnpify": "^2.4.0", | ||
"coveralls": "^3.1.0", | ||
"eslint": "^7.15.0", | ||
"eslint-config-prettier": "^7.0.0", | ||
"eslint-import-resolver-node": "^0.3.4", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"husky": "^4.3.6", | ||
"jest": "^26.6.3", | ||
"nodemark": "^0.3.0", | ||
"prettier": "^1.19.1", | ||
"require-from-web": "^1.1.1", | ||
"semantic-release": "^17.0.2", | ||
"terser": "^4.6.3", | ||
"ts-node": "^8.6.2", | ||
"typescript": "^3.7.5" | ||
"prettier": "^2.2.1", | ||
"replace-in-files-cli": "^1.0.0", | ||
"require-from-web": "^1.2.0", | ||
"semantic-release": "^17.3.0", | ||
"terser": "^5.5.1", | ||
"ts-node": "^9.1.1", | ||
"typescript": "^4.1.3" | ||
}, | ||
@@ -110,0 +113,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
126965
32
1040