string-uglify 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-uglify
|
|
3
3
|
* @fileoverview Shorten sets of strings deterministically, to be git-friendly
|
|
4
|
-
* @version 2.0.
|
|
4
|
+
* @version 2.0.4
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-uglify/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var version$1 = "2.0.
|
|
10
|
+
var version$1 = "2.0.4";
|
|
11
11
|
|
|
12
12
|
const version = version$1;
|
|
13
13
|
function tellcp(str, idNum = 0) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-uglify
|
|
3
3
|
* @fileoverview Shorten sets of strings deterministically, to be git-friendly
|
|
4
|
-
* @version 2.0.
|
|
4
|
+
* @version 2.0.4
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-uglify/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).stringUglify={})}(this,(function(e){"use strict";function t(e,t=0){return e.codePointAt(t)||0}function i(e){const i="abcdefghijklmnopqrstuvwxyz",s="abcdefghijklmnopqrstuvwxyz0123456789",l={a:!1,b:!1,c:!1,d:!1,e:!1,f:!1,g:!1,h:!1,i:!1,j:!1,k:!1,l:!1,m:!1,n:!1,o:!1,p:!1,q:!1,r:!1,s:!1,t:!1,u:!1,v:!1,w:!1,x:!1,y:!1,z:!1},n={a:!1,b:!1,c:!1,d:!1,e:!1,f:!1,g:!1,h:!1,i:!1,j:!1,k:!1,l:!1,m:!1,n:!1,o:!1,p:!1,q:!1,r:!1,s:!1,t:!1,u:!1,v:!1,w:!1,x:!1,y:!1,z:!1},r={a:!1,b:!1,c:!1,d:!1,e:!1,f:!1,g:!1,h:!1,i:!1,j:!1,k:!1,l:!1,m:!1,n:!1,o:!1,p:!1,q:!1,r:!1,s:!1,t:!1,u:!1,v:!1,w:!1,x:!1,y:!1,z:!1},c=[];if(!Array.isArray(e)||!e.length)return e;for(let o=0,u=e.length;o<u;o++){if(e.indexOf(e[o])<o){c.push(c[e.indexOf(e[o])]);continue}const u=".#".includes(e[o][0])?e[o][0]:"",h=Array.from(e[o]).reduce(((e,i)=>e+t(i)),0);if(".#".includes(e[o][0])&&e[o].length<4||!".#".includes(e[o][0])&&e[o].length<3){const t=e[o];if(!c.includes(t)){c.push(t),t.startsWith(".")&&2===t.length&&!1===l[t.slice(1)]?l[t.slice(1)]=!0:t.startsWith("#")&&2===t.length&&!1===n[t.slice(1)]?n[t.slice(1)]=!0:t.startsWith(".")||t.startsWith("#")||1!==t.length||!1!==r[t]||(r[t]=!0);continue}}let f=`${u}${i[h%i.length]}${s[h%s.length]}`;if(c.includes(f)){let i=f,l=0;const n=Array.from(e[o]).reduce(((e,i)=>e<200?e+t(i):(e+t(i))%s.length),0),r=Array.from(e[o]).map((e=>t(e))).reduce(((e,t)=>{let i=e+t;do{i=String(i).split("").reduce(((e,t)=>e+Number.parseInt(t,10)),0)}while(i>=10);return i}),0);for(;c.includes(i);)l+=1,i+=s[n*r*l%s.length];f=i}c.push(f),f.startsWith(".")&&2===f.length&&!1===l[f.slice(1)]?l[f.slice(1)]=!0:f.startsWith("#")&&2===f.length&&!1===n[f.slice(1)]?n[f.slice(1)]=!0:f.startsWith(".")||f.startsWith("#")||1!==f.length||!1!==r[f]||(r[f]=!0)}for(let e=0,t=c.length;e<t;e++)c[e].startsWith(".")?!1===l[c[e].slice(1,2)]?(l[c[e].slice(1,2)]=c[e],c[e]=c[e].slice(0,2)):l[c[e].slice(1,2)]===c[e]&&(c[e]=c[e].slice(0,2)):c[e].startsWith("#")?!1===n[c[e].slice(1,2)]?(n[c[e].slice(1,2)]=c[e],c[e]=c[e].slice(0,2)):n[c[e].slice(1,2)]===c[e]&&(c[e]=c[e].slice(0,2)):c[e].startsWith(".")||c[e].startsWith("#")||(r[c[e].slice(0,1)]?r[c[e].slice(0,1)]===c[e]&&(c[e]=c[e].slice(0,1)):(r[c[e].slice(0,1)]=c[e],c[e]=c[e].slice(0,1)));return c}e.uglifyArr=i,e.uglifyById=function(e,t){return i(e)[t]},e.version="2.0.
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).stringUglify={})}(this,(function(e){"use strict";function t(e,t=0){return e.codePointAt(t)||0}function i(e){const i="abcdefghijklmnopqrstuvwxyz",s="abcdefghijklmnopqrstuvwxyz0123456789",l={a:!1,b:!1,c:!1,d:!1,e:!1,f:!1,g:!1,h:!1,i:!1,j:!1,k:!1,l:!1,m:!1,n:!1,o:!1,p:!1,q:!1,r:!1,s:!1,t:!1,u:!1,v:!1,w:!1,x:!1,y:!1,z:!1},n={a:!1,b:!1,c:!1,d:!1,e:!1,f:!1,g:!1,h:!1,i:!1,j:!1,k:!1,l:!1,m:!1,n:!1,o:!1,p:!1,q:!1,r:!1,s:!1,t:!1,u:!1,v:!1,w:!1,x:!1,y:!1,z:!1},r={a:!1,b:!1,c:!1,d:!1,e:!1,f:!1,g:!1,h:!1,i:!1,j:!1,k:!1,l:!1,m:!1,n:!1,o:!1,p:!1,q:!1,r:!1,s:!1,t:!1,u:!1,v:!1,w:!1,x:!1,y:!1,z:!1},c=[];if(!Array.isArray(e)||!e.length)return e;for(let o=0,u=e.length;o<u;o++){if(e.indexOf(e[o])<o){c.push(c[e.indexOf(e[o])]);continue}const u=".#".includes(e[o][0])?e[o][0]:"",h=Array.from(e[o]).reduce(((e,i)=>e+t(i)),0);if(".#".includes(e[o][0])&&e[o].length<4||!".#".includes(e[o][0])&&e[o].length<3){const t=e[o];if(!c.includes(t)){c.push(t),t.startsWith(".")&&2===t.length&&!1===l[t.slice(1)]?l[t.slice(1)]=!0:t.startsWith("#")&&2===t.length&&!1===n[t.slice(1)]?n[t.slice(1)]=!0:t.startsWith(".")||t.startsWith("#")||1!==t.length||!1!==r[t]||(r[t]=!0);continue}}let f=`${u}${i[h%i.length]}${s[h%s.length]}`;if(c.includes(f)){let i=f,l=0;const n=Array.from(e[o]).reduce(((e,i)=>e<200?e+t(i):(e+t(i))%s.length),0),r=Array.from(e[o]).map((e=>t(e))).reduce(((e,t)=>{let i=e+t;do{i=String(i).split("").reduce(((e,t)=>e+Number.parseInt(t,10)),0)}while(i>=10);return i}),0);for(;c.includes(i);)l+=1,i+=s[n*r*l%s.length];f=i}c.push(f),f.startsWith(".")&&2===f.length&&!1===l[f.slice(1)]?l[f.slice(1)]=!0:f.startsWith("#")&&2===f.length&&!1===n[f.slice(1)]?n[f.slice(1)]=!0:f.startsWith(".")||f.startsWith("#")||1!==f.length||!1!==r[f]||(r[f]=!0)}for(let e=0,t=c.length;e<t;e++)c[e].startsWith(".")?!1===l[c[e].slice(1,2)]?(l[c[e].slice(1,2)]=c[e],c[e]=c[e].slice(0,2)):l[c[e].slice(1,2)]===c[e]&&(c[e]=c[e].slice(0,2)):c[e].startsWith("#")?!1===n[c[e].slice(1,2)]?(n[c[e].slice(1,2)]=c[e],c[e]=c[e].slice(0,2)):n[c[e].slice(1,2)]===c[e]&&(c[e]=c[e].slice(0,2)):c[e].startsWith(".")||c[e].startsWith("#")||(r[c[e].slice(0,1)]?r[c[e].slice(0,1)]===c[e]&&(c[e]=c[e].slice(0,1)):(r[c[e].slice(0,1)]=c[e],c[e]=c[e].slice(0,1)));return c}e.uglifyArr=i,e.uglifyById=function(e,t){return i(e)[t]},e.version="2.0.4",Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-uglify",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Shorten sets of strings deterministically, to be git-friendly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"class",
|
|
@@ -109,12 +109,12 @@
|
|
|
109
109
|
"@rollup/plugin-typescript": "^8.3.0",
|
|
110
110
|
"@types/node": "^16.11.6",
|
|
111
111
|
"@types/tap": "^15.0.5",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
113
|
-
"@typescript-eslint/parser": "^5.
|
|
114
|
-
"core-js": "^3.19.
|
|
112
|
+
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
|
113
|
+
"@typescript-eslint/parser": "^5.3.0",
|
|
114
|
+
"core-js": "^3.19.1",
|
|
115
115
|
"cross-env": "^7.0.3",
|
|
116
116
|
"eslint": "^8.1.0",
|
|
117
|
-
"lect": "^0.18.
|
|
117
|
+
"lect": "^0.18.4",
|
|
118
118
|
"rollup": "^2.59.0",
|
|
119
119
|
"rollup-plugin-ascii": "^0.0.3",
|
|
120
120
|
"rollup-plugin-banner": "^0.2.1",
|