string-uglify 3.0.0 → 3.0.2

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 CHANGED
@@ -3,17 +3,17 @@
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.0.0 (2022-12-01)
6
+ ## [3.0.2](https://github.com/codsen/codsen/compare/string-uglify@3.0.1...string-uglify@3.0.2) (2022-12-06)
7
7
 
8
- ### Features
8
+ **Note:** Version bump only for package string-uglify
9
9
 
10
- - drop Node v12 support; minimum version requirement now is v14.18 and above ([c8049e8](https://github.com/codsen/codsen/commit/c8049e82a5844d3f72587740f1cc74e3c9020d22))
10
+ ## 3.0.0 (2022-12-01)
11
11
 
12
12
  ### BREAKING CHANGES
13
13
 
14
14
  - Minimum supported Node version is v14.18; we're dropping v12 support
15
15
 
16
- # 2.1.0 (2022-08-12)
16
+ ## 2.1.0 (2022-08-12)
17
17
 
18
18
  ### Features
19
19
 
@@ -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.0.0
4
+ * @version 3.0.2
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 y="3.0.0";var D=y;function m(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},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,p=l.length;e<p;e++){if(l.indexOf(l[e])<e){s.push(s[l.indexOf(l[e])]);continue}let $=".#".includes(l[e][0])?l[e][0]:"",h=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&&r[t.slice(1)]===!1?r[t.slice(1)]=!0:!t.startsWith(".")&&!t.startsWith("#")&&t.length===1&&a[t]===!1&&(a[t]=!0);continue}}let i=`${$}${o[h%o.length]}${u[h%u.length]}`;if(s.includes(i)){let t=i,c=0,b=Array.from(l[e]).reduce((f,g)=>f<200?f+m(g):(f+m(g))%u.length,0),x=Array.from(l[e]).map(f=>m(f)).reduce((f,g)=>{let d=f+g;do d=String(d).split("").reduce((j,v)=>j+Number.parseInt(v,10),0);while(d>=10);return d},0);for(;s.includes(t);)c+=1,t+=u[b*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&&a[i]===!1&&(a[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("#")&&(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 A(l,o){return w(l)[o]}export{w as uglifyArr,A as uglifyById,D as version};
10
+ var $="3.0.2";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.0.0
4
+ * @version 3.0.2
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
- "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 a in n)h(l,a,{get:n[a],enumerable:!0})},N=(l,n,a,f)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of k(n))!D.call(l,r)&&r!==a&&h(l,r,{get:()=>n[r],enumerable:!(f=E(n,r))||f.enumerable});return l};var O=l=>N(h({},"__esModule",{value:!0}),l);var I={};A(I,{uglifyArr:()=>b,uglifyById:()=>C,version:()=>S});var $="3.0.0";var S=$;function m(l,n=0){return l.codePointAt(n)||0}function b(l){let n="abcdefghijklmnopqrstuvwxyz",a="abcdefghijklmnopqrstuvwxyz0123456789",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},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]:"",y=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&&f[t.slice(1)]===!1?f[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=`${x}${n[y%n.length]}${a[y%a.length]}`;if(s.includes(i)){let t=i,c=0,j=Array.from(l[e]).reduce((u,g)=>u<200?u+m(g):(u+m(g))%a.length,0),v=Array.from(l[e]).map(u=>m(u)).reduce((u,g)=>{let d=u+g;do d=String(d).split("").reduce((W,w)=>W+Number.parseInt(w,10),0);while(d>=10);return d},0);for(;s.includes(t);)c+=1,t+=a[j*v*c%a.length];i=t}s.push(i),i.startsWith(".")&&i.length===2&&f[i.slice(1)]===!1?f[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(".")?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("#")?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 C(l,n){return b(l)[n]}return O(I);})();
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:()=>C,version:()=>S});var b="3.0.2";var S=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=`${x}${n[$%n.length]}${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 C(l,n){return y(l)[n]}return O(I);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-uglify",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Shorten sets of strings deterministically, to be git-friendly",
5
5
  "keywords": [
6
6
  "class",
@@ -40,22 +40,22 @@
40
40
  },
41
41
  "types": "types/index.d.ts",
42
42
  "scripts": {
43
- "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
43
+ "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
44
44
  "cjs-off": "exit 0",
45
45
  "cjs-on": "exit 0",
46
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
47
- "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
48
- "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
46
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
47
+ "devtest": "c8 npm run unit && npm run examples && npm run lint",
48
+ "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --loglevel 'silent'",
49
49
  "examples": "node '../../ops/scripts/run-examples.js'",
50
- "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
51
- "letspublish": "yarn publish || :",
50
+ "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
51
+ "letspublish": "npm publish || :",
52
52
  "lint": "eslint . --ext .js --ext .ts --fix",
53
53
  "perf": "node perf/check.js",
54
- "prepare": "echo 'ready'",
54
+ "prep": "echo 'ready'",
55
55
  "prettier": "prettier",
56
- "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
57
- "pretest": "yarn run lect && yarn run build",
58
- "test": "yarn run devtest",
56
+ "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --loglevel 'silent'",
57
+ "pretest": "npm run lect && npm run build",
58
+ "test": "npm run devtest",
59
59
  "unit": "uvu test"
60
60
  },
61
61
  "engines": {