string-uglify 2.0.7 → 2.0.10
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/README.md +4 -1
- package/dist/string-uglify.esm.js +2 -209
- package/dist/string-uglify.umd.js +2 -2
- package/examples/_quickTake.js +2 -0
- package/package.json +22 -73
- package/types/index.d.ts +0 -0
- package/examples/api.json +0 -1
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ If you need a legacy version which works with `require`, use version 1.5.0
|
|
|
38
38
|
|
|
39
39
|
```js
|
|
40
40
|
import { strict as assert } from "assert";
|
|
41
|
+
|
|
41
42
|
import { uglifyById, uglifyArr, version } from "string-uglify";
|
|
42
43
|
|
|
43
44
|
// notice we put dots and hashes for classes and id's but algorithm will work
|
|
@@ -59,7 +60,7 @@ assert.equal(uglifyById(names, 3), "#l");
|
|
|
59
60
|
|
|
60
61
|
## Documentation
|
|
61
62
|
|
|
62
|
-
Please [visit codsen.com](https://codsen.com/os/string-uglify/) for a full description of the API
|
|
63
|
+
Please [visit codsen.com](https://codsen.com/os/string-uglify/) for a full description of the API.
|
|
63
64
|
|
|
64
65
|
## Contributing
|
|
65
66
|
|
|
@@ -71,4 +72,6 @@ MIT License
|
|
|
71
72
|
|
|
72
73
|
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
73
74
|
|
|
75
|
+
|
|
74
76
|
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
77
|
+
|
|
@@ -1,217 +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.10
|
|
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
|
|
11
|
-
|
|
12
|
-
const version = version$1;
|
|
13
|
-
function tellcp(str, idNum = 0) {
|
|
14
|
-
return str.codePointAt(idNum) || 0;
|
|
15
|
-
}
|
|
16
|
-
function uglifyArr(arr) {
|
|
17
|
-
const letters = "abcdefghijklmnopqrstuvwxyz";
|
|
18
|
-
const lettersAndNumbers = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
19
|
-
const singleClasses = {
|
|
20
|
-
a: false,
|
|
21
|
-
b: false,
|
|
22
|
-
c: false,
|
|
23
|
-
d: false,
|
|
24
|
-
e: false,
|
|
25
|
-
f: false,
|
|
26
|
-
g: false,
|
|
27
|
-
h: false,
|
|
28
|
-
i: false,
|
|
29
|
-
j: false,
|
|
30
|
-
k: false,
|
|
31
|
-
l: false,
|
|
32
|
-
m: false,
|
|
33
|
-
n: false,
|
|
34
|
-
o: false,
|
|
35
|
-
p: false,
|
|
36
|
-
q: false,
|
|
37
|
-
r: false,
|
|
38
|
-
s: false,
|
|
39
|
-
t: false,
|
|
40
|
-
u: false,
|
|
41
|
-
v: false,
|
|
42
|
-
w: false,
|
|
43
|
-
x: false,
|
|
44
|
-
y: false,
|
|
45
|
-
z: false,
|
|
46
|
-
};
|
|
47
|
-
const singleIds = {
|
|
48
|
-
a: false,
|
|
49
|
-
b: false,
|
|
50
|
-
c: false,
|
|
51
|
-
d: false,
|
|
52
|
-
e: false,
|
|
53
|
-
f: false,
|
|
54
|
-
g: false,
|
|
55
|
-
h: false,
|
|
56
|
-
i: false,
|
|
57
|
-
j: false,
|
|
58
|
-
k: false,
|
|
59
|
-
l: false,
|
|
60
|
-
m: false,
|
|
61
|
-
n: false,
|
|
62
|
-
o: false,
|
|
63
|
-
p: false,
|
|
64
|
-
q: false,
|
|
65
|
-
r: false,
|
|
66
|
-
s: false,
|
|
67
|
-
t: false,
|
|
68
|
-
u: false,
|
|
69
|
-
v: false,
|
|
70
|
-
w: false,
|
|
71
|
-
x: false,
|
|
72
|
-
y: false,
|
|
73
|
-
z: false,
|
|
74
|
-
};
|
|
75
|
-
const singleNameonly = {
|
|
76
|
-
a: false,
|
|
77
|
-
b: false,
|
|
78
|
-
c: false,
|
|
79
|
-
d: false,
|
|
80
|
-
e: false,
|
|
81
|
-
f: false,
|
|
82
|
-
g: false,
|
|
83
|
-
h: false,
|
|
84
|
-
i: false,
|
|
85
|
-
j: false,
|
|
86
|
-
k: false,
|
|
87
|
-
l: false,
|
|
88
|
-
m: false,
|
|
89
|
-
n: false,
|
|
90
|
-
o: false,
|
|
91
|
-
p: false,
|
|
92
|
-
q: false,
|
|
93
|
-
r: false,
|
|
94
|
-
s: false,
|
|
95
|
-
t: false,
|
|
96
|
-
u: false,
|
|
97
|
-
v: false,
|
|
98
|
-
w: false,
|
|
99
|
-
x: false,
|
|
100
|
-
y: false,
|
|
101
|
-
z: false,
|
|
102
|
-
};
|
|
103
|
-
const res = [];
|
|
104
|
-
if (!Array.isArray(arr) || !arr.length) {
|
|
105
|
-
return arr;
|
|
106
|
-
}
|
|
107
|
-
for (let id = 0, len = arr.length; id < len; id++) {
|
|
108
|
-
if (arr.indexOf(arr[id]) < id) {
|
|
109
|
-
res.push(res[arr.indexOf(arr[id])]);
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
const prefix = `.#`.includes(arr[id][0]) ? arr[id][0] : "";
|
|
113
|
-
const codePointSum = Array.from(arr[id]).reduce((acc, curr) => acc + tellcp(curr), 0);
|
|
114
|
-
if ((`.#`.includes(arr[id][0]) && arr[id].length < 4) ||
|
|
115
|
-
(!`.#`.includes(arr[id][0]) && arr[id].length < 3)) {
|
|
116
|
-
const val = arr[id];
|
|
117
|
-
if (!res.includes(val)) {
|
|
118
|
-
res.push(val);
|
|
119
|
-
if (val.startsWith(".") &&
|
|
120
|
-
val.length === 2 &&
|
|
121
|
-
singleClasses[val.slice(1)] === false) {
|
|
122
|
-
singleClasses[val.slice(1)] = true;
|
|
123
|
-
}
|
|
124
|
-
else if (val.startsWith("#") &&
|
|
125
|
-
val.length === 2 &&
|
|
126
|
-
singleIds[val.slice(1)] === false) {
|
|
127
|
-
singleIds[val.slice(1)] = true;
|
|
128
|
-
}
|
|
129
|
-
else if (!val.startsWith(".") &&
|
|
130
|
-
!val.startsWith("#") &&
|
|
131
|
-
val.length === 1 &&
|
|
132
|
-
singleNameonly[val] === false) {
|
|
133
|
-
singleNameonly[val] = true;
|
|
134
|
-
}
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
let generated = `${prefix}${letters[codePointSum % letters.length]}${lettersAndNumbers[codePointSum % lettersAndNumbers.length]}`;
|
|
139
|
-
if (res.includes(generated)) {
|
|
140
|
-
let soFarWeveGot = generated;
|
|
141
|
-
let counter = 0;
|
|
142
|
-
const reducedCodePointSum = Array.from(arr[id]).reduce((acc, curr) => acc < 200
|
|
143
|
-
? acc + tellcp(curr)
|
|
144
|
-
: (acc + tellcp(curr)) % lettersAndNumbers.length, 0);
|
|
145
|
-
const magicNumber = Array.from(arr[id])
|
|
146
|
-
.map((val) => tellcp(val))
|
|
147
|
-
.reduce((accum, curr) => {
|
|
148
|
-
let temp = accum + curr;
|
|
149
|
-
do {
|
|
150
|
-
temp = String(temp)
|
|
151
|
-
.split("")
|
|
152
|
-
.reduce((acc, curr1) => acc + Number.parseInt(curr1, 10), 0);
|
|
153
|
-
} while (temp >= 10);
|
|
154
|
-
return temp;
|
|
155
|
-
}, 0);
|
|
156
|
-
while (res.includes(soFarWeveGot)) {
|
|
157
|
-
counter += 1;
|
|
158
|
-
soFarWeveGot +=
|
|
159
|
-
lettersAndNumbers[(reducedCodePointSum * magicNumber * counter) %
|
|
160
|
-
lettersAndNumbers.length];
|
|
161
|
-
}
|
|
162
|
-
generated = soFarWeveGot;
|
|
163
|
-
}
|
|
164
|
-
res.push(generated);
|
|
165
|
-
if (generated.startsWith(".") &&
|
|
166
|
-
generated.length === 2 &&
|
|
167
|
-
singleClasses[generated.slice(1)] === false) {
|
|
168
|
-
singleClasses[generated.slice(1)] = true;
|
|
169
|
-
}
|
|
170
|
-
else if (generated.startsWith("#") &&
|
|
171
|
-
generated.length === 2 &&
|
|
172
|
-
singleIds[generated.slice(1)] === false) {
|
|
173
|
-
singleIds[generated.slice(1)] = true;
|
|
174
|
-
}
|
|
175
|
-
else if (!generated.startsWith(".") &&
|
|
176
|
-
!generated.startsWith("#") &&
|
|
177
|
-
generated.length === 1 &&
|
|
178
|
-
singleNameonly[generated] === false) {
|
|
179
|
-
singleNameonly[generated] = true;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
for (let i = 0, len = res.length; i < len; i++) {
|
|
183
|
-
if (res[i].startsWith(".")) {
|
|
184
|
-
if (singleClasses[res[i].slice(1, 2)] === false) {
|
|
185
|
-
singleClasses[res[i].slice(1, 2)] = res[i];
|
|
186
|
-
res[i] = res[i].slice(0, 2);
|
|
187
|
-
}
|
|
188
|
-
else if (singleClasses[res[i].slice(1, 2)] === res[i]) {
|
|
189
|
-
res[i] = res[i].slice(0, 2);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
else if (res[i].startsWith("#")) {
|
|
193
|
-
if (singleIds[res[i].slice(1, 2)] === false) {
|
|
194
|
-
singleIds[res[i].slice(1, 2)] = res[i];
|
|
195
|
-
res[i] = res[i].slice(0, 2);
|
|
196
|
-
}
|
|
197
|
-
else if (singleIds[res[i].slice(1, 2)] === res[i]) {
|
|
198
|
-
res[i] = res[i].slice(0, 2);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
else if (!res[i].startsWith(".") && !res[i].startsWith("#")) {
|
|
202
|
-
if (!singleNameonly[res[i].slice(0, 1)]) {
|
|
203
|
-
singleNameonly[res[i].slice(0, 1)] = res[i];
|
|
204
|
-
res[i] = res[i].slice(0, 1);
|
|
205
|
-
}
|
|
206
|
-
else if (singleNameonly[res[i].slice(0, 1)] === res[i]) {
|
|
207
|
-
res[i] = res[i].slice(0, 1);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return res;
|
|
212
|
-
}
|
|
213
|
-
function uglifyById(refArr, idNum) {
|
|
214
|
-
return uglifyArr(refArr)[idNum];
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export { uglifyArr, uglifyById, version };
|
|
10
|
+
var p="2.0.10";var E=p;function m(l,o=0){return l.codePointAt(o)||0}function k(l){let o="abcdefghijklmnopqrstuvwxyz",u="abcdefghijklmnopqrstuvwxyz0123456789",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},f={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},a={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},s=[];if(!Array.isArray(l)||!l.length)return l;for(let e=0,h=l.length;e<h;e++){if(l.indexOf(l[e])<e){s.push(s[l.indexOf(l[e])]);continue}let y=".#".includes(l[e][0])?l[e][0]:"",$=Array.from(l[e]).reduce((t,c)=>t+m(c),0);if(".#".includes(l[e][0])&&l[e].length<4||!".#".includes(l[e][0])&&l[e].length<3){let t=l[e];if(!s.includes(t)){s.push(t),t.startsWith(".")&&t.length===2&&n[t.slice(1)]===!1?n[t.slice(1)]=!0:t.startsWith("#")&&t.length===2&&f[t.slice(1)]===!1?f[t.slice(1)]=!0:!t.startsWith(".")&&!t.startsWith("#")&&t.length===1&&a[t]===!1&&(a[t]=!0);continue}}let i=`${y}${o[$%o.length]}${u[$%u.length]}`;if(s.includes(i)){let t=i,c=0,b=Array.from(l[e]).reduce((r,g)=>r<200?r+m(g):(r+m(g))%u.length,0),v=Array.from(l[e]).map(r=>m(r)).reduce((r,g)=>{let d=r+g;do d=String(d).split("").reduce((x,j)=>x+Number.parseInt(j,10),0);while(d>=10);return d},0);for(;s.includes(t);)c+=1,t+=u[b*v*c%u.length];i=t}s.push(i),i.startsWith(".")&&i.length===2&&n[i.slice(1)]===!1?n[i.slice(1)]=!0:i.startsWith("#")&&i.length===2&&f[i.slice(1)]===!1?f[i.slice(1)]=!0:!i.startsWith(".")&&!i.startsWith("#")&&i.length===1&&a[i]===!1&&(a[i]=!0)}for(let e=0,h=s.length;e<h;e++)s[e].startsWith(".")?n[s[e].slice(1,2)]===!1?(n[s[e].slice(1,2)]=s[e],s[e]=s[e].slice(0,2)):n[s[e].slice(1,2)]===s[e]&&(s[e]=s[e].slice(0,2)):s[e].startsWith("#")?f[s[e].slice(1,2)]===!1?(f[s[e].slice(1,2)]=s[e],s[e]=s[e].slice(0,2)):f[s[e].slice(1,2)]===s[e]&&(s[e]=s[e].slice(0,2)):!s[e].startsWith(".")&&!s[e].startsWith("#")&&(a[s[e].slice(0,1)]?a[s[e].slice(0,1)]===s[e]&&(s[e]=s[e].slice(0,1)):(a[s[e].slice(0,1)]=s[e],s[e]=s[e].slice(0,1)));return s}function N(l,o){return k(l)[o]}export{k as uglifyArr,N as uglifyById,E as version};
|
|
@@ -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.10
|
|
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
|
-
|
|
10
|
+
var stringUglify=(()=>{var $=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var N=l=>$(l,"__esModule",{value:!0});var O=(l,i)=>{for(var f in i)$(l,f,{get:i[f],enumerable:!0})},V=(l,i,f,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of D(i))!E.call(l,a)&&(f||a!=="default")&&$(l,a,{get:()=>i[a],enumerable:!(r=w(i,a))||r.enumerable});return l};var A=(l=>(i,f)=>l&&l.get(i)||(f=V(N({}),i,1),l&&l.set(i,f),f))(typeof WeakMap!="undefined"?new WeakMap:0);var q={};O(q,{uglifyArr:()=>b,uglifyById:()=>I,version:()=>C});var y="2.0.10";var C=y;function m(l,i=0){return l.codePointAt(i)||0}function b(l){let i="abcdefghijklmnopqrstuvwxyz",f="abcdefghijklmnopqrstuvwxyz0123456789",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},a={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},o={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},s=[];if(!Array.isArray(l)||!l.length)return l;for(let e=0,h=l.length;e<h;e++){if(l.indexOf(l[e])<e){s.push(s[l.indexOf(l[e])]);continue}let v=".#".includes(l[e][0])?l[e][0]:"",p=Array.from(l[e]).reduce((t,c)=>t+m(c),0);if(".#".includes(l[e][0])&&l[e].length<4||!".#".includes(l[e][0])&&l[e].length<3){let t=l[e];if(!s.includes(t)){s.push(t),t.startsWith(".")&&t.length===2&&r[t.slice(1)]===!1?r[t.slice(1)]=!0:t.startsWith("#")&&t.length===2&&a[t.slice(1)]===!1?a[t.slice(1)]=!0:!t.startsWith(".")&&!t.startsWith("#")&&t.length===1&&o[t]===!1&&(o[t]=!0);continue}}let n=`${v}${i[p%i.length]}${f[p%f.length]}`;if(s.includes(n)){let t=n,c=0,x=Array.from(l[e]).reduce((u,g)=>u<200?u+m(g):(u+m(g))%f.length,0),j=Array.from(l[e]).map(u=>m(u)).reduce((u,g)=>{let d=u+g;do d=String(d).split("").reduce((W,k)=>W+Number.parseInt(k,10),0);while(d>=10);return d},0);for(;s.includes(t);)c+=1,t+=f[x*j*c%f.length];n=t}s.push(n),n.startsWith(".")&&n.length===2&&r[n.slice(1)]===!1?r[n.slice(1)]=!0:n.startsWith("#")&&n.length===2&&a[n.slice(1)]===!1?a[n.slice(1)]=!0:!n.startsWith(".")&&!n.startsWith("#")&&n.length===1&&o[n]===!1&&(o[n]=!0)}for(let e=0,h=s.length;e<h;e++)s[e].startsWith(".")?r[s[e].slice(1,2)]===!1?(r[s[e].slice(1,2)]=s[e],s[e]=s[e].slice(0,2)):r[s[e].slice(1,2)]===s[e]&&(s[e]=s[e].slice(0,2)):s[e].startsWith("#")?a[s[e].slice(1,2)]===!1?(a[s[e].slice(1,2)]=s[e],s[e]=s[e].slice(0,2)):a[s[e].slice(1,2)]===s[e]&&(s[e]=s[e].slice(0,2)):!s[e].startsWith(".")&&!s[e].startsWith("#")&&(o[s[e].slice(0,1)]?o[s[e].slice(0,1)]===s[e]&&(s[e]=s[e].slice(0,1)):(o[s[e].slice(0,1)]=s[e],s[e]=s[e].slice(0,1)));return s}function I(l,i){return b(l)[i]}return A(q);})();
|
package/examples/_quickTake.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-uglify",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "Shorten sets of strings deterministically, to be git-friendly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"class",
|
|
@@ -39,35 +39,28 @@
|
|
|
39
39
|
},
|
|
40
40
|
"types": "types/index.d.ts",
|
|
41
41
|
"scripts": {
|
|
42
|
-
"build": "
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"republish": "npm publish || :",
|
|
55
|
-
"tap": "tap",
|
|
56
|
-
"pretest": "npm run build",
|
|
57
|
-
"test": "npm run test:ci && npm run perf",
|
|
58
|
-
"test:ci": "npm run unittest && npm run test:examples && npm run format",
|
|
59
|
-
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
60
|
-
"tsc": "tsc",
|
|
61
|
-
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
|
|
42
|
+
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
43
|
+
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
44
|
+
"dts": "rollup -c",
|
|
45
|
+
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
46
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
47
|
+
"letspublish": "yarn publish || :",
|
|
48
|
+
"lint": "eslint . --fix",
|
|
49
|
+
"perf": "node perf/check.js",
|
|
50
|
+
"prepare": "echo 'ready'",
|
|
51
|
+
"pretest": "yarn run lect && yarn run build",
|
|
52
|
+
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
53
|
+
"unit": "uvu test"
|
|
62
54
|
},
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
57
|
+
},
|
|
58
|
+
"c8": {
|
|
59
|
+
"check-coverage": true,
|
|
60
|
+
"exclude": [
|
|
61
|
+
"**/test/**/*.*"
|
|
69
62
|
],
|
|
70
|
-
"
|
|
63
|
+
"lines": 100
|
|
71
64
|
},
|
|
72
65
|
"lect": {
|
|
73
66
|
"licence": {
|
|
@@ -75,53 +68,9 @@
|
|
|
75
68
|
""
|
|
76
69
|
]
|
|
77
70
|
},
|
|
78
|
-
"
|
|
79
|
-
"various": {
|
|
80
|
-
"devDependencies": []
|
|
81
|
-
}
|
|
71
|
+
"various": {}
|
|
82
72
|
},
|
|
83
73
|
"dependencies": {
|
|
84
74
|
"@babel/runtime": "^7.16.3"
|
|
85
|
-
},
|
|
86
|
-
"devDependencies": {
|
|
87
|
-
"@babel/cli": "^7.16.0",
|
|
88
|
-
"@babel/core": "^7.16.0",
|
|
89
|
-
"@babel/node": "^7.16.0",
|
|
90
|
-
"@babel/plugin-external-helpers": "^7.16.0",
|
|
91
|
-
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
92
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
93
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
94
|
-
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
95
|
-
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
96
|
-
"@babel/preset-env": "^7.16.4",
|
|
97
|
-
"@babel/preset-typescript": "^7.16.0",
|
|
98
|
-
"@babel/register": "^7.16.0",
|
|
99
|
-
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
100
|
-
"@rollup/plugin-babel": "^5.3.0",
|
|
101
|
-
"@rollup/plugin-commonjs": "^21.0.1",
|
|
102
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
103
|
-
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
104
|
-
"@rollup/plugin-strip": "^2.1.0",
|
|
105
|
-
"@rollup/plugin-typescript": "^8.3.0",
|
|
106
|
-
"@types/node": "^16.11.10",
|
|
107
|
-
"@types/tap": "^15.0.5",
|
|
108
|
-
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
|
109
|
-
"@typescript-eslint/parser": "^5.5.0",
|
|
110
|
-
"core-js": "^3.19.2",
|
|
111
|
-
"cross-env": "^7.0.3",
|
|
112
|
-
"eslint": "^8.3.0",
|
|
113
|
-
"lect": "^0.18.7",
|
|
114
|
-
"rollup": "^2.60.1",
|
|
115
|
-
"rollup-plugin-ascii": "^0.0.3",
|
|
116
|
-
"rollup-plugin-banner": "^0.2.1",
|
|
117
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
118
|
-
"rollup-plugin-dts": "^4.0.1",
|
|
119
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
120
|
-
"tap": "^15.1.5",
|
|
121
|
-
"tslib": "^2.3.1",
|
|
122
|
-
"typescript": "^4.5.2"
|
|
123
|
-
},
|
|
124
|
-
"engines": {
|
|
125
|
-
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
126
75
|
}
|
|
127
76
|
}
|
package/types/index.d.ts
CHANGED
|
File without changes
|
package/examples/api.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport { uglifyById, uglifyArr, version } from \"string-uglify\";\n\n// notice we put dots and hashes for classes and id's but algorithm will work\n// fine too if you won't.\nconst names = [\n \".module-promo-all\",\n \".module-promo-main\",\n \".module-promo-second\",\n \"#zzz\",\n];\n\n// notice we put dots and hashes for classes and id's but algorithm will work\n// fine too if you won't.\nassert.deepEqual(uglifyArr(names), [\".o\", \".s\", \".z\", \"#l\"]);\n\n// uglify a particular id number (inefficient):\nassert.equal(uglifyById(names, 3), \"#l\");"}}
|