string-uglify 2.0.2 → 2.0.3
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.
- package/CHANGELOG.md +14 -0
- package/dist/string-uglify.esm.js +2 -2
- package/dist/string-uglify.umd.js +2 -2
- package/package.json +32 -32
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 2.0.3 (2021-11-02)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump TS and separate ESLint plugins away from this monorepo ([b1ebce1](https://github.com/codsen/codsen/commit/b1ebce1637d8c41c2d848fc24b0ba4058865bd5d))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
|
|
15
|
+
|
|
16
|
+
### BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
- programs now are in ES Modules and won't work with Common JS require()
|
|
19
|
+
|
|
6
20
|
## 2.0.1 (2021-09-13)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
|
@@ -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.3
|
|
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.3";
|
|
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.3
|
|
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.3",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.3",
|
|
4
4
|
"description": "Shorten sets of strings deterministically, to be git-friendly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"class",
|
|
@@ -40,11 +40,13 @@
|
|
|
40
40
|
"types": "types/index.d.ts",
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "rollup -c",
|
|
43
|
-
"esbuild": "node '../../scripts/esbuild.js'",
|
|
44
|
-
"esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
45
43
|
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov",
|
|
44
|
+
"clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
|
|
45
|
+
"clean_types": "../../scripts/cleanTypes.js",
|
|
46
46
|
"dev": "rollup -c --dev",
|
|
47
47
|
"devunittest": "npm run dev && tap --only -R 'base'",
|
|
48
|
+
"esbuild": "node '../../scripts/esbuild.js'",
|
|
49
|
+
"esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
48
50
|
"format": "npm run lect && npm run prettier && npm run lint",
|
|
49
51
|
"lect": "lect",
|
|
50
52
|
"lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
|
|
@@ -52,13 +54,11 @@
|
|
|
52
54
|
"prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
|
|
53
55
|
"republish": "npm publish || :",
|
|
54
56
|
"tap": "tap",
|
|
55
|
-
"tsc": "tsc",
|
|
56
57
|
"pretest": "npm run build",
|
|
57
58
|
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
|
|
58
59
|
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"clean_types": "../../scripts/cleanTypes.js"
|
|
60
|
+
"tsc": "tsc",
|
|
61
|
+
"unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
|
|
62
62
|
},
|
|
63
63
|
"tap": {
|
|
64
64
|
"check-coverage": false,
|
|
@@ -85,45 +85,45 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@babel/runtime": "^7.
|
|
88
|
+
"@babel/runtime": "^7.16.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@babel/cli": "^7.
|
|
92
|
-
"@babel/core": "^7.
|
|
93
|
-
"@babel/node": "^7.
|
|
94
|
-
"@babel/plugin-external-helpers": "^7.
|
|
95
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
96
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.
|
|
97
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
98
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
99
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
100
|
-
"@babel/preset-env": "^7.
|
|
101
|
-
"@babel/preset-typescript": "^7.
|
|
102
|
-
"@babel/register": "^7.
|
|
91
|
+
"@babel/cli": "^7.16.0",
|
|
92
|
+
"@babel/core": "^7.16.0",
|
|
93
|
+
"@babel/node": "^7.16.0",
|
|
94
|
+
"@babel/plugin-external-helpers": "^7.16.0",
|
|
95
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
96
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
97
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
98
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
99
|
+
"@babel/plugin-transform-runtime": "^7.16.0",
|
|
100
|
+
"@babel/preset-env": "^7.16.0",
|
|
101
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
102
|
+
"@babel/register": "^7.16.0",
|
|
103
103
|
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
104
104
|
"@rollup/plugin-babel": "^5.3.0",
|
|
105
|
-
"@rollup/plugin-commonjs": "^
|
|
105
|
+
"@rollup/plugin-commonjs": "^21.0.1",
|
|
106
106
|
"@rollup/plugin-json": "^4.1.0",
|
|
107
|
-
"@rollup/plugin-node-resolve": "^13.0.
|
|
107
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
108
108
|
"@rollup/plugin-strip": "^2.1.0",
|
|
109
|
-
"@rollup/plugin-typescript": "^8.
|
|
110
|
-
"@types/node": "^16.
|
|
109
|
+
"@rollup/plugin-typescript": "^8.3.0",
|
|
110
|
+
"@types/node": "^16.11.6",
|
|
111
111
|
"@types/tap": "^15.0.5",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
113
|
-
"@typescript-eslint/parser": "^
|
|
114
|
-
"core-js": "^3.
|
|
112
|
+
"@typescript-eslint/eslint-plugin": "^5.2.0",
|
|
113
|
+
"@typescript-eslint/parser": "^5.2.0",
|
|
114
|
+
"core-js": "^3.19.0",
|
|
115
115
|
"cross-env": "^7.0.3",
|
|
116
|
-
"eslint": "^
|
|
117
|
-
"lect": "^0.18.
|
|
118
|
-
"rollup": "^2.
|
|
116
|
+
"eslint": "^8.1.0",
|
|
117
|
+
"lect": "^0.18.3",
|
|
118
|
+
"rollup": "^2.59.0",
|
|
119
119
|
"rollup-plugin-ascii": "^0.0.3",
|
|
120
120
|
"rollup-plugin-banner": "^0.2.1",
|
|
121
121
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
122
122
|
"rollup-plugin-dts": "^4.0.0",
|
|
123
123
|
"rollup-plugin-terser": "^7.0.2",
|
|
124
|
-
"tap": "^15.0.
|
|
124
|
+
"tap": "^15.0.10",
|
|
125
125
|
"tslib": "^2.3.1",
|
|
126
|
-
"typescript": "^4.4.
|
|
126
|
+
"typescript": "^4.4.4"
|
|
127
127
|
},
|
|
128
128
|
"engines": {
|
|
129
129
|
"node": ">=12"
|