string-uglify 3.0.25 → 3.1.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 +6 -0
- package/dist/string-uglify.esm.js +2 -2
- package/dist/string-uglify.umd.js +2 -2
- package/package.json +1 -1
- package/.eslintcache +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
## 3.1.0 (2025-10-15)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
|
|
11
|
+
|
|
6
12
|
## 3.0.0 (2022-12-01)
|
|
7
13
|
|
|
8
14
|
### BREAKING CHANGES
|
|
@@ -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 3.
|
|
4
|
+
* @version 3.1.3
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-uglify/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var $="3.
|
|
10
|
+
var $="3.1.3";var D=$;function d(l,o=0){return l.codePointAt(o)||0}function w(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},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},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},s=[];if(!Array.isArray(l)||!l.length)return l;for(let e=0,p=l.length;e<p;e++){if(l.indexOf(l[e])<e){s.push(s[l.indexOf(l[e])]);continue}let b=".#".includes(l[e][0])?l[e][0]:"",h=Array.from(l[e]).reduce((t,c)=>t+d(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&&r[t.slice(1)]===!1?r[t.slice(1)]=!0:!t.startsWith(".")&&!t.startsWith("#")&&t.length===1&&f[t]===!1&&(f[t]=!0);continue}}let i=`${b}${o[h%o.length]}${u[h%u.length]}`;if(s.includes(i)){let t=i,c=0,y=Array.from(l[e]).reduce((a,g)=>a<200?a+d(g):(a+d(g))%u.length,0),x=Array.from(l[e]).map(a=>d(a)).reduce((a,g)=>{let m=a+g;do m=String(m).split("").reduce((v,j)=>v+Number.parseInt(j,10),0);while(m>=10);return m},0);for(;s.includes(t);)c+=1,t+=u[y*x*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&&r[i.slice(1)]===!1?r[i.slice(1)]=!0:!i.startsWith(".")&&!i.startsWith("#")&&i.length===1&&f[i]===!1&&(f[i]=!0)}for(let e=0,p=s.length;e<p;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("#")?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(".")&&!s[e].startsWith("#")&&(f[s[e].slice(0,1)]?f[s[e].slice(0,1)]===s[e]&&(s[e]=s[e].slice(0,1)):(f[s[e].slice(0,1)]=s[e],s[e]=s[e].slice(0,1)));return s}function A(l,o){return w(l)[o]}export{w as uglifyArr,A as uglifyById,D 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 3.
|
|
4
|
+
* @version 3.1.3
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-uglify/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var stringUglify=(()=>{var h=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var A=(l,n)=>{for(var f in n)h(l,f,{get:n[f],enumerable:!0})},N=(l,n,f,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of k(n))!D.call(l,r)&&r!==f&&h(l,r,{get:()=>n[r],enumerable:!(a=E(n,r))||a.enumerable});return l};var O=l=>N(h({},"__esModule",{value:!0}),l);var I={};A(I,{uglifyArr:()=>y,uglifyById:()=>S,version:()=>C});var b="3.
|
|
10
|
+
"use strict";var stringUglify=(()=>{var h=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var A=(l,n)=>{for(var f in n)h(l,f,{get:n[f],enumerable:!0})},N=(l,n,f,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of k(n))!D.call(l,r)&&r!==f&&h(l,r,{get:()=>n[r],enumerable:!(a=E(n,r))||a.enumerable});return l};var O=l=>N(h({},"__esModule",{value:!0}),l);var I={};A(I,{uglifyArr:()=>y,uglifyById:()=>S,version:()=>C});var b="3.1.3";var C=b;function d(l,n=0){return l.codePointAt(n)||0}function y(l){let n="abcdefghijklmnopqrstuvwxyz",f="abcdefghijklmnopqrstuvwxyz0123456789",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},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},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,p=l.length;e<p;e++){if(l.indexOf(l[e])<e){s.push(s[l.indexOf(l[e])]);continue}let x=".#".includes(l[e][0])?l[e][0]:"",$=Array.from(l[e]).reduce((t,c)=>t+d(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&&a[t.slice(1)]===!1?a[t.slice(1)]=!0:t.startsWith("#")&&t.length===2&&r[t.slice(1)]===!1?r[t.slice(1)]=!0:!t.startsWith(".")&&!t.startsWith("#")&&t.length===1&&o[t]===!1&&(o[t]=!0);continue}}let i="".concat(x).concat(n[$%n.length]).concat(f[$%f.length]);if(s.includes(i)){let t=i,c=0,v=Array.from(l[e]).reduce((u,g)=>u<200?u+d(g):(u+d(g))%f.length,0),j=Array.from(l[e]).map(u=>d(u)).reduce((u,g)=>{let m=u+g;do m=String(m).split("").reduce((W,w)=>W+Number.parseInt(w,10),0);while(m>=10);return m},0);for(;s.includes(t);)c+=1,t+=f[v*j*c%f.length];i=t}s.push(i),i.startsWith(".")&&i.length===2&&a[i.slice(1)]===!1?a[i.slice(1)]=!0:i.startsWith("#")&&i.length===2&&r[i.slice(1)]===!1?r[i.slice(1)]=!0:!i.startsWith(".")&&!i.startsWith("#")&&i.length===1&&o[i]===!1&&(o[i]=!0)}for(let e=0,p=s.length;e<p;e++)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("#")?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(".")&&!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 S(l,n){return y(l)[n]}return O(I);})();
|
package/package.json
CHANGED
package/.eslintcache
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"/home/runner/work/codsen/codsen/packages/string-uglify/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/string-uglify/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/string-uglify/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/string-uglify/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/string-uglify/test/test.js":"5"},{"size":603,"mtime":1760280945979,"results":"6","hashOfConfig":"7"},{"size":539,"mtime":1760280945979,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760280945979,"results":"10","hashOfConfig":"7"},{"size":8785,"mtime":1760280945979,"results":"11","hashOfConfig":"9"},{"size":7919,"mtime":1760280945979,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1f1u168",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"91l1rm",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ns3qdb","/home/runner/work/codsen/codsen/packages/string-uglify/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/string-uglify/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/string-uglify/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/string-uglify/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/string-uglify/test/test.js",[],["29","30","31","32"],{"ruleId":"33","severity":2,"message":"34","line":3,"column":25,"nodeType":null,"messageId":"35","endLine":3,"endColumn":31,"suppressions":"36"},{"ruleId":"33","severity":2,"message":"37","line":3,"column":33,"nodeType":null,"messageId":"35","endLine":3,"endColumn":37,"suppressions":"38"},{"ruleId":"33","severity":2,"message":"39","line":3,"column":39,"nodeType":null,"messageId":"35","endLine":3,"endColumn":42,"suppressions":"40"},{"ruleId":"33","severity":2,"message":"41","line":3,"column":44,"nodeType":null,"messageId":"35","endLine":3,"endColumn":49,"suppressions":"42"},"@typescript-eslint/no-unused-vars","'throws' is defined but never used.","unusedVar",["43"],"'type' is defined but never used.",["44"],"'not' is defined but never used.",["45"],"'match' is defined but never used.",["46"],{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},"directive",""]
|