From aa77bf971134c99e53f4d54a2f3b4f4707e1982e Mon Sep 17 00:00:00 2001 From: "Jean M. Lescure" Date: Mon, 3 May 2021 21:07:04 -0600 Subject: [PATCH] chore: make sure dist version matches release --- dist/short-unique-id.js | 2 +- dist/short-unique-id.min.js | 2 +- docs/classes/default.html | 46 +++++++++++------------ docs/index.html | 6 +-- docs/interfaces/shortuniqueidoptions.html | 10 ++--- docs/modules.html | 6 +-- package.json | 2 +- scripts/postbump | 4 ++ 8 files changed, 41 insertions(+), 37 deletions(-) create mode 100644 scripts/postbump diff --git a/dist/short-unique-id.js b/dist/short-unique-id.js index 04d8590..2f7dfdf 100644 --- a/dist/short-unique-id.js +++ b/dist/short-unique-id.js @@ -69,7 +69,7 @@ return to; } - var version = "4.0.0"; + var version = "4.1.0"; // @module ShortUniqueId /** diff --git a/dist/short-unique-id.min.js b/dist/short-unique-id.min.js index fe235f0..49c0a2a 100644 --- a/dist/short-unique-id.min.js +++ b/dist/short-unique-id.min.js @@ -12,4 +12,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};function __extends(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){__assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar}function __spreadArray(to,from){for(var i=0,il=from.length,j=to.length;i1?1:score<0?0:score};_this.getVersion=function(){return _this.version};_this.stamp=function(finalLength){if(finalLength<10){throw new Error("Param finalLength must be at least 10")}var hexStamp=Math.floor(+new Date/1e3).toString(16);var idLength=finalLength-9;var rndIdx=Math.round(Math.random()*(idLength>15?15:idLength));var id=_this.randomUUID(idLength);return""+id.substr(0,rndIdx)+hexStamp+id.substr(rndIdx)+rndIdx.toString(16)};_this.parseStamp=function(stamp){if(stamp.length<10){throw new Error("Stamp length invalid")}var rndIdx=parseInt(stamp.substr(stamp.length-1,1),16);return new Date(parseInt(stamp.substr(rndIdx,8),16)*1e3)};var options=__assign(__assign({},DEFAULT_OPTIONS),argOptions);_this.counter=0;_this.debug=false;_this.dict=[];_this.version=version;var userDict=options.dictionary,shuffle=options.shuffle,length=options.length;_this.uuidLength=length;if(userDict&&userDict.length>1){_this.setDictionary(userDict)}else{var i_1;_this.dictIndex=i_1=0;Object.keys(DICT_RANGES).forEach((function(rangeType){var rangeTypeKey=rangeType;_this.dictRange=DICT_RANGES[rangeTypeKey];_this.lowerBound=_this.dictRange[0];_this.upperBound=_this.dictRange[1];for(_this.dictIndex=i_1=_this.lowerBound;_this.lowerBound<=_this.upperBound?i_1<_this.upperBound:i_1>_this.upperBound;_this.dictIndex=_this.lowerBound<=_this.upperBound?i_1+=1:i_1-=1){_this.dict.push(String.fromCharCode(_this.dictIndex))}}))}if(shuffle){var PROBABILITY_1=.5;_this.setDictionary(_this.dict.sort((function(){return Math.random()-PROBABILITY_1})))}else{_this.setDictionary(_this.dict)}_this.debug=options.debug;_this.log(_this.dict);_this.log("Generator instantiated with Dictionary Size "+_this.dictLength);return new Proxy(_this,{apply:function(target,that,args){return _this.randomUUID.apply(_this,__spreadArray([],__read(args)))}})}return ShortUniqueId}(Function);exports.DEFAULT_UUID_LENGTH=DEFAULT_UUID_LENGTH;exports.default=ShortUniqueId;Object.defineProperty(exports,"__esModule",{value:true})})); \ No newline at end of file + ***************************************************************************** */var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};function __extends(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){__assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar}function __spreadArray(to,from){for(var i=0,il=from.length,j=to.length;i1?1:score<0?0:score};_this.getVersion=function(){return _this.version};_this.stamp=function(finalLength){if(finalLength<10){throw new Error("Param finalLength must be at least 10")}var hexStamp=Math.floor(+new Date/1e3).toString(16);var idLength=finalLength-9;var rndIdx=Math.round(Math.random()*(idLength>15?15:idLength));var id=_this.randomUUID(idLength);return""+id.substr(0,rndIdx)+hexStamp+id.substr(rndIdx)+rndIdx.toString(16)};_this.parseStamp=function(stamp){if(stamp.length<10){throw new Error("Stamp length invalid")}var rndIdx=parseInt(stamp.substr(stamp.length-1,1),16);return new Date(parseInt(stamp.substr(rndIdx,8),16)*1e3)};var options=__assign(__assign({},DEFAULT_OPTIONS),argOptions);_this.counter=0;_this.debug=false;_this.dict=[];_this.version=version;var userDict=options.dictionary,shuffle=options.shuffle,length=options.length;_this.uuidLength=length;if(userDict&&userDict.length>1){_this.setDictionary(userDict)}else{var i_1;_this.dictIndex=i_1=0;Object.keys(DICT_RANGES).forEach((function(rangeType){var rangeTypeKey=rangeType;_this.dictRange=DICT_RANGES[rangeTypeKey];_this.lowerBound=_this.dictRange[0];_this.upperBound=_this.dictRange[1];for(_this.dictIndex=i_1=_this.lowerBound;_this.lowerBound<=_this.upperBound?i_1<_this.upperBound:i_1>_this.upperBound;_this.dictIndex=_this.lowerBound<=_this.upperBound?i_1+=1:i_1-=1){_this.dict.push(String.fromCharCode(_this.dictIndex))}}))}if(shuffle){var PROBABILITY_1=.5;_this.setDictionary(_this.dict.sort((function(){return Math.random()-PROBABILITY_1})))}else{_this.setDictionary(_this.dict)}_this.debug=options.debug;_this.log(_this.dict);_this.log("Generator instantiated with Dictionary Size "+_this.dictLength);return new Proxy(_this,{apply:function(target,that,args){return _this.randomUUID.apply(_this,__spreadArray([],__read(args)))}})}return ShortUniqueId}(Function);exports.DEFAULT_UUID_LENGTH=DEFAULT_UUID_LENGTH;exports.default=ShortUniqueId;Object.defineProperty(exports,"__esModule",{value:true})})); \ No newline at end of file diff --git a/docs/classes/default.html b/docs/classes/default.html index e970b37..93c784b 100644 --- a/docs/classes/default.html +++ b/docs/classes/default.html @@ -4,7 +4,7 @@ Short Unique ID - Short UUID Generator - + @@ -293,7 +293,7 @@

constructor

Parameters

@@ -315,7 +315,7 @@

counter

counter: number
@@ -325,7 +325,7 @@

debug

debug: boolean
@@ -335,7 +335,7 @@

dict

dict: string[]
@@ -345,7 +345,7 @@

dictIndex

dictIndex: number = 0
@@ -355,7 +355,7 @@

dictLength

dictLength: number = 0
@@ -365,7 +365,7 @@

dictRange

dictRange: number[] = []
@@ -375,7 +375,7 @@

lowerBound

lowerBound: number = 0
@@ -385,7 +385,7 @@

upperBound

upperBound: number = 0
@@ -395,7 +395,7 @@

uuidLength

uuidLength: number
@@ -405,7 +405,7 @@

version

version: string
@@ -422,7 +422,7 @@

approxMaxBeforeCollision

  • @@ -461,7 +461,7 @@

    availableUUIDs

  • @@ -498,7 +498,7 @@

    collisionProbability

  • @@ -543,7 +543,7 @@

    getVersion

  • @@ -565,7 +565,7 @@

    parseStamp

  • @@ -600,7 +600,7 @@

    randomUUID

  • @@ -633,7 +633,7 @@

    seq

  • Returns string

    @@ -650,7 +650,7 @@

    sequentialUUID

  • @@ -677,7 +677,7 @@

    setDictionary

  • @@ -705,7 +705,7 @@

    stamp

  • @@ -740,7 +740,7 @@

    uniqueness

  • diff --git a/docs/index.html b/docs/index.html index bcbf195..4351710 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ Short Unique ID - Short UUID Generator - + @@ -15,7 +15,7 @@
    -

    short-unique-id - v4.0.0

    +

    short-unique-id - v4.1.0

    @@ -289,7 +289,7 @@

    What is the probability of generating the same id again?

    Acknowledgement and platform support

    This repo and npm package started as a straight up manual transpilation to ES6 of the short-uid npm package by Ankit Kuwadekar.

    -

    image depicting over 12000 weekly npm downloads

    +

    image depicting over 12000 weekly npm downloads

    Since this package is now reporting 12k+ npm weekly downloads, we've gone ahead and re-written the whole of it in TypeScript and made sure to package dist modules compatible with Deno, Node.js and all major Browsers.

    Development

    diff --git a/docs/interfaces/shortuniqueidoptions.html b/docs/interfaces/shortuniqueidoptions.html index a10a366..f581c30 100644 --- a/docs/interfaces/shortuniqueidoptions.html +++ b/docs/interfaces/shortuniqueidoptions.html @@ -4,7 +4,7 @@ Short Unique ID - Short UUID Generator - + @@ -123,7 +123,7 @@

    debug

    debug: boolean
    @@ -138,7 +138,7 @@

    dictionary

    dictionary: string[]
    @@ -153,7 +153,7 @@

    length

    length: number
    @@ -168,7 +168,7 @@

    shuffle

    shuffle: boolean
    diff --git a/docs/modules.html b/docs/modules.html index 37c8b40..4bf92d4 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -4,7 +4,7 @@ Short Unique ID - Short UUID Generator - + @@ -15,7 +15,7 @@
    -

    short-unique-id - v4.0.0

    +

    short-unique-id - v4.1.0

    @@ -77,7 +77,7 @@

    Const DEFAULT_UUID_LENG
    DEFAULT_UUID_LENGTH: number = 6
    diff --git a/package.json b/package.json index 86d04cb..0bae9ef 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "standard-version": { "scripts": { - "postbump": "yarn build" + "postbump": "scripty" } }, "devDependencies": { diff --git a/scripts/postbump b/scripts/postbump new file mode 100644 index 0000000..86c96af --- /dev/null +++ b/scripts/postbump @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +yarn build +git add dist docs