From 00b3de60e904e1426ec1b32295312d856ab8b561 Mon Sep 17 00:00:00 2001 From: "Jean M. Lescure" Date: Thu, 15 Oct 2020 20:07:33 -0600 Subject: [PATCH] fix: unsafe eval in function constructor #35 --- .github/workflows/main.yml | 6 +- .vscode/settings.json | 3 +- README.md | 19 +++++- assets/cookie-policy/index.html | 111 ++++++++++++++++++++++++++++++++ dist/short-unique-id.js | 13 ++-- dist/short-unique-id.min.js | 2 +- docs/assets/css/main.css | 22 +++++-- docs/classes/shortuniqueid.html | 21 +++--- docs/cookie-policy/index.html | 111 ++++++++++++++++++++++++++++++++ docs/globals.html | 23 ++++--- docs/index.html | 42 +++++++++--- lib/short-unique-id.js | 13 ++-- lib/version.js | 2 +- package.json | 8 ++- short_uuid | 2 +- 15 files changed, 338 insertions(+), 60 deletions(-) create mode 100644 assets/cookie-policy/index.html create mode 100644 docs/cookie-policy/index.html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac32416..532c091 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,14 +1,14 @@ name: tests # Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch +# events but only for the main branch on: push: branches: - - master + - main pull_request: branches: - - master + - main # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: diff --git a/.vscode/settings.json b/.vscode/settings.json index 8f8df68..b03b026 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { "deno.enable": true, - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "god.tsconfig": "./tsconfig.json" } \ No newline at end of file diff --git a/README.md b/README.md index 3a6ba55..38b734f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,18 @@ Generate random or sequential UUID of any length. +This project is open to updates by its users, I ensure that PRs are relevant to the community. +In other words, if you find a bug or want a new feature, please help us by becoming one of the +[contributors](#contributors-) ✌️ ! See the [contributing section](#contributing). + +## Like this module? :heart: + +Please consider: + +- [Buying me a coffee](https://www.buymeacoffee.com/jeanlescure) :coffee: +- Supporting me on [Patreon](https://www.patreon.com/jeanlescure) :trophy: +- Starring this repo on [Github](https://github.com/jeanlescure/string-crypto) :star2: + ### Use as module ```js @@ -167,6 +179,11 @@ yarn dist:build **IMPORTANT**: The `dist:build` script depends on the files generated by `lib:build`. +## Contributing + +Yes, thank you! This plugin is community-driven, most of its features are from different authors. +Please update the docs and tests and add your name to the `package.json` file. + ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): @@ -197,5 +214,5 @@ This project follows the [all-contributors](https://github.com/all-contributors/ ## License -Copyright (c) 2018-2020 [Short Unique ID Contributors](https://github.com/jeanlescure/short-unique-id/graphs/contributors).
+Copyright (c) 2018-2020 [Short Unique ID Contributors](https://github.com/jeanlescure/short-unique-id/#contributors-).
Licensed under the Apache License 2.0. \ No newline at end of file diff --git a/assets/cookie-policy/index.html b/assets/cookie-policy/index.html new file mode 100644 index 0000000..553e7f3 --- /dev/null +++ b/assets/cookie-policy/index.html @@ -0,0 +1,111 @@ + + + + + + + + + Short Unique Id - Cookie Policy + + +
+
+
+

+ < Back +

+
+
+
+
+

Cookie policy

+

Understand how we use cookies.

+
+
+
+
+

What are cookies

+

+ As is common practice with almost all professional websites this site uses cookies, which + are tiny files that are downloaded to your computer, to improve your experience. + This page describes what information they gather, how we use it and why we sometimes need + to store these cookies. We will also share how you can prevent these cookies from being + stored however this may downgrade or "break" certain elements of the sites functionality. +

+
+
+
+
+

How we use cookies

+

+ We use cookies for a variety of reasons detailed below. Unfortunately in most cases there + are no industry standard options for disabling cookies without completely disabling the + functionality and features they add to this site. It is recommended that you leave on all + cookies if you are not sure whether you need them or not in case they are used to provide + a service that you use. +

+
+
+
+
+

Disabling cookies

+

+ You can prevent the setting of cookies by adjusting the settings on your browser + (see your browser Help for how to do this). Be aware that disabling cookies will affect + the functionality of this and many other websites that you visit. Disabling cookies will + usually result in also disabling certain functionality and features of the this site. + Therefore it is recommended that you do not disable cookies. +

+
+
+
+
+

The cookies we set

+

Site preference cookies

+

+ In order to provide you with a great experience on this site we provide the functionality + to set your preferences for how this site runs when you use it. In order to remember your + preferences we need to set cookies so that this information can be called whenever you + interact with a page is affected by your preferences. +

+

Third party cookies

+

+ In some special cases we also use cookies provided by trusted third parties. + The following section details which third party cookies you might encounter through this site. +

+

Google Analytics cookies

+

+ This site uses Google Analytics which is one of the most widespread and trusted analytics + solutions on the web, as well as Hotjar in order to help us understand how you use the + site and ways that we can improve your experience. These cookies may track things such as + how long you spend on the site and the pages that you visit so we can continue to produce + engaging content. +

+

+ For more information on Google Analytics cookies, see the official Google Analytics page. +

+
+
+
+
+

More information

+

+ Hopefully that has clarified things for you and as was previously mentioned if there is + something that you aren't sure whether you need or not it's usually safer to leave + cookies enabled in case it does interact with one of the features you use on our site. + However if you are still looking for more information then you can contact us via email + at opensource@jeanlescure.io. +

+
+
+
+
+

+ < Back +

+
+
+
+ + diff --git a/dist/short-unique-id.js b/dist/short-unique-id.js index a8e089e..80eab5c 100644 --- a/dist/short-unique-id.js +++ b/dist/short-unique-id.js @@ -106,7 +106,7 @@ System.register("version", [], function (exports_1, context_1) { return { setters: [], execute: function () { - exports_1("default", '3.0.4'); + exports_1("default", '3.0.5'); } }; }); @@ -141,7 +141,7 @@ System.register("mod", ["version"], function (exports_2, context_2) { }; ShortUniqueId = class ShortUniqueId extends Function { constructor(argOptions = {}) { - super('...args', 'return this.randomUUID(...args)'); + super(); this.dictIndex = 0; this.dictRange = []; this.lowerBound = 0; @@ -183,14 +183,9 @@ System.register("mod", ["version"], function (exports_2, context_2) { this.debug = options.debug; this.log(this.dict); this.log((`Generator instantiated with Dictionary Size ${this.dictLength}`)); - const instance = this.bind(this); - Object.getOwnPropertyNames(this).forEach((prop) => { - if (!(/arguments|caller|callee|length|name|prototype/).test(prop)) { - const propKey = prop; - instance[prop] = this[propKey]; - } + return new Proxy(this, { + apply: (target, that, args) => this.randomUUID(...args), }); - return instance; } log(...args) { const finalArgs = [...args]; diff --git a/dist/short-unique-id.min.js b/dist/short-unique-id.min.js index 50e3582..2ad700f 100644 --- a/dist/short-unique-id.min.js +++ b/dist/short-unique-id.min.js @@ -1 +1 @@ -var __suid_module=function t(e,i,n){function s(o,u){if(!i[o]){if(!e[o]){var h="function"==typeof require&&require;if(!u&&h)return h(o,!0);if(r)return r(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var a=i[o]={exports:{}};e[o][0].call(a.exports,(function(t){return s(e[o][1][t]||t)}),a,a.exports,t,e,i,n)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o{const e=new Map;function i(i,n){return{id:i,import:n=>async function(i,n){let s=i.replace(/\.\w+$/i,"");if(s.includes("./")){const[t,...e]=s.split("/").reverse(),[,...i]=n.split("/").reverse(),r=[t];let o,u=0;for(;o=e.shift();)if(".."===o)u++;else{if("."===o)break;r.push(o)}ut(i))}(n,i),meta:{url:i,main:n}}}function r(t){return(e,i)=>{i="string"==typeof e?{[e]:i}:e;for(const[e,n]of Object.entries(i))Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0})}}async function o(t){if(!e.has(t))return;const i=e.get(t);if(i.s){const{d:t,e:e,s:n}=i;delete i.s,delete i.e;for(let e=0;e(n=s=void 0,function(t){for(const[n,s]of e.entries()){const{f:e,exp:o}=s,{execute:u,setters:h}=e(r(o),i(n,n===t));delete s.f,s.e=u,s.s=h}}(t),u?o(t):function t(i){if(!e.has(i))return;const n=e.get(i);if(n.s){const{d:e,e:i,s:s}=n;delete n.s,delete n.e;for(let i=0;i1)this.setDictionary(r);else{let t;this.dictIndex=t=0,Object.keys(n).forEach(e=>{const i=e;for(this.dictRange=n[i],this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1],this.dictIndex=t=this.lowerBound;this.lowerBound<=this.upperBound?tthis.upperBound;this.dictIndex=this.lowerBound<=this.upperBound?t+=1:t-=1)this.dict.push(String.fromCharCode(this.dictIndex))})}if(o){const t=.5;this.setDictionary(this.dict.sort(()=>Math.random()-t))}else this.setDictionary(this.dict);this.debug=e.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size "+this.dictLength);const h=this.bind(this);return Object.getOwnPropertyNames(this).forEach(t=>{if(!/arguments|caller|callee|length|name|prototype/.test(t)){const e=t;h[t]=this[e]}}),h}log(...t){const e=[...t];if(e[0]="[short-unique-id] "+t[0],!0===this.debug&&"undefined"!=typeof console&&null!==console)return console.log(...e)}setDictionary(t){this.dict=t,this.dictLength=this.dict.length,this.counter=0}seq(){return this.sequentialUUID()}sequentialUUID(){let t,e,i="";for(t=this.counter;e=t%this.dictLength,t=Math.trunc(t/this.dictLength),i+=this.dict[e],0!==t;);return this.counter+=1,i}randomUUID(t=this.uuidLength||6){let e,i,n,s;if(null==t||t<1)throw new Error("Invalid UUID Length Provided");for(e="",s=n=0;0<=t?nt;s=0<=t?n+=1:n-=1)i=parseInt((Math.random()*this.dictLength).toFixed(0),10)%this.dictLength,e+=this.dict[i];return e}availableUUIDs(t=this.uuidLength){return parseFloat(Math.pow([...new Set(this.dict)].length,t).toFixed(0))}approxMaxBeforeCollision(t=this.availableUUIDs(this.uuidLength)){return parseFloat(Math.sqrt(Math.PI/2*t).toFixed(20))}collisionProbability(t=this.availableUUIDs(this.uuidLength),e=this.uuidLength){return parseFloat((this.approxMaxBeforeCollision(t)/this.availableUUIDs(e)).toFixed(20))}uniqueness(t=this.availableUUIDs(this.uuidLength)){const e=parseFloat((1-this.approxMaxBeforeCollision(t)/t).toFixed(20));return e>1?1:e<0?0:e}getVersion(){return this.version}})}}}));const r=s("mod",!1);i.default=r.default},{}]},{},[1]),ShortUniqueId=__suid_module(1).default; +var __suid_module=function t(e,i,n){function s(o,u){if(!i[o]){if(!e[o]){var h="function"==typeof require&&require;if(!u&&h)return h(o,!0);if(r)return r(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var a=i[o]={exports:{}};e[o][0].call(a.exports,(function(t){return s(e[o][1][t]||t)}),a,a.exports,t,e,i,n)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o{const e=new Map;function i(i,n){return{id:i,import:n=>async function(i,n){let s=i.replace(/\.\w+$/i,"");if(s.includes("./")){const[t,...e]=s.split("/").reverse(),[,...i]=n.split("/").reverse(),r=[t];let o,u=0;for(;o=e.shift();)if(".."===o)u++;else{if("."===o)break;r.push(o)}ut(i))}(n,i),meta:{url:i,main:n}}}function r(t){return(e,i)=>{i="string"==typeof e?{[e]:i}:e;for(const[e,n]of Object.entries(i))Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0})}}async function o(t){if(!e.has(t))return;const i=e.get(t);if(i.s){const{d:t,e:e,s:n}=i;delete i.s,delete i.e;for(let e=0;e(n=s=void 0,function(t){for(const[n,s]of e.entries()){const{f:e,exp:o}=s,{execute:u,setters:h}=e(r(o),i(n,n===t));delete s.f,s.e=u,s.s=h}}(t),u?o(t):function t(i){if(!e.has(i))return;const n=e.get(i);if(n.s){const{d:e,e:i,s:s}=n;delete n.s,delete n.e;for(let i=0;i1)this.setDictionary(r);else{let t;this.dictIndex=t=0,Object.keys(n).forEach(e=>{const i=e;for(this.dictRange=n[i],this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1],this.dictIndex=t=this.lowerBound;this.lowerBound<=this.upperBound?tthis.upperBound;this.dictIndex=this.lowerBound<=this.upperBound?t+=1:t-=1)this.dict.push(String.fromCharCode(this.dictIndex))})}if(o){const t=.5;this.setDictionary(this.dict.sort(()=>Math.random()-t))}else this.setDictionary(this.dict);return this.debug=e.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size "+this.dictLength),new Proxy(this,{apply:(t,e,i)=>this.randomUUID(...i)})}log(...t){const e=[...t];if(e[0]="[short-unique-id] "+t[0],!0===this.debug&&"undefined"!=typeof console&&null!==console)return console.log(...e)}setDictionary(t){this.dict=t,this.dictLength=this.dict.length,this.counter=0}seq(){return this.sequentialUUID()}sequentialUUID(){let t,e,i="";for(t=this.counter;e=t%this.dictLength,t=Math.trunc(t/this.dictLength),i+=this.dict[e],0!==t;);return this.counter+=1,i}randomUUID(t=this.uuidLength||6){let e,i,n,s;if(null==t||t<1)throw new Error("Invalid UUID Length Provided");for(e="",s=n=0;0<=t?nt;s=0<=t?n+=1:n-=1)i=parseInt((Math.random()*this.dictLength).toFixed(0),10)%this.dictLength,e+=this.dict[i];return e}availableUUIDs(t=this.uuidLength){return parseFloat(Math.pow([...new Set(this.dict)].length,t).toFixed(0))}approxMaxBeforeCollision(t=this.availableUUIDs(this.uuidLength)){return parseFloat(Math.sqrt(Math.PI/2*t).toFixed(20))}collisionProbability(t=this.availableUUIDs(this.uuidLength),e=this.uuidLength){return parseFloat((this.approxMaxBeforeCollision(t)/this.availableUUIDs(e)).toFixed(20))}uniqueness(t=this.availableUUIDs(this.uuidLength)){const e=parseFloat((1-this.approxMaxBeforeCollision(t)/t).toFixed(20));return e>1?1:e<0?0:e}getVersion(){return this.version}})}}}));const r=s("mod",!1);i.default=r.default},{}]},{},[1]),ShortUniqueId=__suid_module(1).default; diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css index e46310d..e31f430 100644 --- a/docs/assets/css/main.css +++ b/docs/assets/css/main.css @@ -2717,11 +2717,24 @@ ul.tsd-type-parameters .tsd-comment { right: 0; left: 0; margin: 0; - padding: 50px; - background: #4da6ff; + padding: 0; display: none; z-index: 100; } +.tsd-page-cookieconsent .message::before { + content: ""; + opacity: 0.85; + background: #000; + top: 0; + left: 0; + bottom: 0; + right: 0; + position: absolute; + z-index: -1; +} +.tsd-page-cookieconsent .message { + padding: 40px; +} .tsd-page-cookieconsent.show { display: block; } @@ -2899,8 +2912,9 @@ input[type=checkbox]:checked + .tsd-widget:before { } @media (prefers-color-scheme: dark) { - .tsd-page-cookieconsent { - background: #4da6ff; + .tsd-page-cookieconsent .message::before { + opacity: 0.85; + background: #000; } .tsd-page-toolbar { diff --git a/docs/classes/shortuniqueid.html b/docs/classes/shortuniqueid.html index 4619022..7149000 100644 --- a/docs/classes/shortuniqueid.html +++ b/docs/classes/shortuniqueid.html @@ -4,7 +4,7 @@ Short Unique ID - Short UUID Generator - + @@ -12,12 +12,17 @@ -
-
-

This site uses cookies. To consent, continue navigating this site or click the "Accept cookies" button.

-
-
diff --git a/docs/cookie-policy/index.html b/docs/cookie-policy/index.html new file mode 100644 index 0000000..553e7f3 --- /dev/null +++ b/docs/cookie-policy/index.html @@ -0,0 +1,111 @@ + + + + + + + + + Short Unique Id - Cookie Policy + + +
+
+
+

+ < Back +

+
+
+
+
+

Cookie policy

+

Understand how we use cookies.

+
+
+
+
+

What are cookies

+

+ As is common practice with almost all professional websites this site uses cookies, which + are tiny files that are downloaded to your computer, to improve your experience. + This page describes what information they gather, how we use it and why we sometimes need + to store these cookies. We will also share how you can prevent these cookies from being + stored however this may downgrade or "break" certain elements of the sites functionality. +

+
+
+
+
+

How we use cookies

+

+ We use cookies for a variety of reasons detailed below. Unfortunately in most cases there + are no industry standard options for disabling cookies without completely disabling the + functionality and features they add to this site. It is recommended that you leave on all + cookies if you are not sure whether you need them or not in case they are used to provide + a service that you use. +

+
+
+
+
+

Disabling cookies

+

+ You can prevent the setting of cookies by adjusting the settings on your browser + (see your browser Help for how to do this). Be aware that disabling cookies will affect + the functionality of this and many other websites that you visit. Disabling cookies will + usually result in also disabling certain functionality and features of the this site. + Therefore it is recommended that you do not disable cookies. +

+
+
+
+
+

The cookies we set

+

Site preference cookies

+

+ In order to provide you with a great experience on this site we provide the functionality + to set your preferences for how this site runs when you use it. In order to remember your + preferences we need to set cookies so that this information can be called whenever you + interact with a page is affected by your preferences. +

+

Third party cookies

+

+ In some special cases we also use cookies provided by trusted third parties. + The following section details which third party cookies you might encounter through this site. +

+

Google Analytics cookies

+

+ This site uses Google Analytics which is one of the most widespread and trusted analytics + solutions on the web, as well as Hotjar in order to help us understand how you use the + site and ways that we can improve your experience. These cookies may track things such as + how long you spend on the site and the pages that you visit so we can continue to produce + engaging content. +

+

+ For more information on Google Analytics cookies, see the official Google Analytics page. +

+
+
+
+
+

More information

+

+ Hopefully that has clarified things for you and as was previously mentioned if there is + something that you aren't sure whether you need or not it's usually safer to leave + cookies enabled in case it does interact with one of the features you use on our site. + However if you are still looking for more information then you can contact us via email + at opensource@jeanlescure.io. +

+
+
+
+
+

+ < Back +

+
+
+
+ + diff --git a/docs/globals.html b/docs/globals.html index c732fbd..5542bd5 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -4,7 +4,7 @@ Short Unique ID - Short UUID Generator - + @@ -12,12 +12,17 @@ -
-
-

This site uses cookies. To consent, continue navigating this site or click the "Accept cookies" button.

-
-
@@ -58,7 +63,7 @@
-

short-unique-id - v3.0.4

+

short-unique-id - v3.0.5

diff --git a/docs/index.html b/docs/index.html index 095f575..559f223 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ Short Unique ID - Short UUID Generator - + @@ -12,12 +12,17 @@ -
-
-

This site uses cookies. To consent, continue navigating this site or click the "Accept cookies" button.

-
-
@@ -58,7 +63,7 @@
-

short-unique-id - v3.0.4

+

short-unique-id - v3.0.5

@@ -175,6 +180,18 @@

Short Unique ID (UUID) Generating Library

8 Contributors

Generate random or sequential UUID of any length.

+

This project is open to updates by its users, I ensure that PRs are relevant to the community. + In other words, if you find a bug or want a new feature, please help us by becoming one of the + contributors ✌️ ! See the contributing section.

+ +

Like this module? :heart:

+
+

Please consider:

+

Use as module

@@ -295,6 +312,11 @@

Build

In order to publish the latest changes you must build the library and distribution files:

yarn lib:build
 yarn dist:build

IMPORTANT: The dist:build script depends on the files generated by lib:build.

+ +

Contributing

+
+

Yes, thank you! This plugin is community-driven, most of its features are from different authors. + Please update the docs and tests and add your name to the package.json file.

Contributors ✨

@@ -323,7 +345,7 @@

Contributors ✨

License

-

Copyright (c) 2018-2020 Short Unique ID Contributors.
+

Copyright (c) 2018-2020 Short Unique ID Contributors.
Licensed under the Apache License 2.0.

diff --git a/lib/short-unique-id.js b/lib/short-unique-id.js index c471c10..d035565 100644 --- a/lib/short-unique-id.js +++ b/lib/short-unique-id.js @@ -104,7 +104,7 @@ System.register("version", [], function (exports_1, context_1) { return { setters: [], execute: function () { - exports_1("default", '3.0.4'); + exports_1("default", '3.0.5'); } }; }); @@ -139,7 +139,7 @@ System.register("mod", ["version"], function (exports_2, context_2) { }; ShortUniqueId = class ShortUniqueId extends Function { constructor(argOptions = {}) { - super('...args', 'return this.randomUUID(...args)'); + super(); this.dictIndex = 0; this.dictRange = []; this.lowerBound = 0; @@ -181,14 +181,9 @@ System.register("mod", ["version"], function (exports_2, context_2) { this.debug = options.debug; this.log(this.dict); this.log((`Generator instantiated with Dictionary Size ${this.dictLength}`)); - const instance = this.bind(this); - Object.getOwnPropertyNames(this).forEach((prop) => { - if (!(/arguments|caller|callee|length|name|prototype/).test(prop)) { - const propKey = prop; - instance[prop] = this[propKey]; - } + return new Proxy(this, { + apply: (target, that, args) => this.randomUUID(...args), }); - return instance; } log(...args) { const finalArgs = [...args]; diff --git a/lib/version.js b/lib/version.js index b207d9d..1734b55 100644 --- a/lib/version.js +++ b/lib/version.js @@ -104,7 +104,7 @@ System.register("version", [], function (exports_1, context_1) { return { setters: [], execute: function () { - exports_1("default", '3.0.4'); + exports_1("default", '3.0.5'); } }; }); diff --git a/package.json b/package.json index 9e75726..47f0446 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "short-unique-id", - "version": "3.0.4", + "version": "3.0.5", "description": "Generate random or sequential UUID of any length", "keywords": [ "short", @@ -8,7 +8,9 @@ "uid", "uuid", "guid", + "node", "unique id", + "generator", "tiny" ], "license": "Apache-2.0", @@ -23,7 +25,7 @@ "runkitExampleFilename": "./test/runkit.js", "scripts": { "gen:version": "echo \"export default '`jq -r .version package.json`';\" > short_uuid/version.ts", - "gen:docs": "cd short_uuid && typedoc --gaID UA-159642755-1 --readme ../README.md --theme ../node_modules/short_uuid_typedoc_template/bin/default --out ../docs . && cd .. && cp -r ./assets ./docs && mv ./docs/assets/favicon.ico ./docs/ && echo shortunique.id > ./docs/CNAME", + "gen:docs": "cd short_uuid && typedoc --gaID UA-159642755-1 --readme ../README.md --theme ../node_modules/short_uuid_typedoc_template/bin/default --out ../docs . && cd .. && cp -r ./assets ./docs && mv ./docs/assets/favicon.ico ./docs/ && mv ./docs/assets/cookie-policy ./docs/ && echo shortunique.id > ./docs/CNAME", "gen:typings": "tsc --lib dom,es2015 --downlevelIteration --declaration --emitDeclarationOnly ./short_uuid/mod.ts ; mv ./short_uuid/mod.d.ts ./typings/short-unique-id.d.ts", "lib:build": "yarn gen:version && rm ./lib/* ; mkdir -p tmp && cd short_uuid && deno bundle mod.ts ../tmp/mod.js && deno bundle version.ts ../tmp/version.js && cd .. && sucrase ./tmp -d ./lib -t imports && mv ./lib/mod.js ./lib/short-unique-id.js && rm -rf ./tmp", "dist:build": "yarn lib:build && rm ./dist/* ; echo 'var __suid_module = ' > ./dist/short-unique-id.js && browserify ./lib/short-unique-id.js >> ./dist/short-unique-id.js && echo 'var ShortUniqueId = __suid_module(1)[\"default\"];' >> ./dist/short-unique-id.js && minify ./dist/short-unique-id.js > ./dist/short-unique-id.min.js", @@ -34,7 +36,7 @@ "devDependencies": { "browserify": "^16.5.1", "minify": "^5.1.1", - "short_uuid_typedoc_template": "^1.0.9", + "short_uuid_typedoc_template": "^1.0.10", "sucrase": "^3.13.0", "tslint": "^6.1.1", "tslint-config-airbnb-base": "^0.3.0", diff --git a/short_uuid b/short_uuid index aed5860..03d0346 160000 --- a/short_uuid +++ b/short_uuid @@ -1 +1 @@ -Subproject commit aed58607a7d7f6600b8928044b7c2ad3023d1529 +Subproject commit 03d03465371218550bb1ae40d2539b02be67f470