html-crush 5.1.18 → 5.1.19

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
@@ -5,19 +5,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
5
5
 
6
6
  ## [5.0.22](https://github.com/codsen/codsen/compare/html-crush@5.0.21...html-crush@5.0.22) (2022-08-02)
7
7
 
8
- ### Bug Fixes
8
+ ### Fixed
9
9
 
10
10
  - export Opts and Res types ([a91c313](https://github.com/codsen/codsen/commit/a91c31378be43a93a51893d3383a3b53cb2bc5f0))
11
11
 
12
12
  ## 5.0.16 (2022-04-18)
13
13
 
14
- ### Bug Fixes
14
+ ### Fixed
15
15
 
16
16
  - tweak types ([104a64a](https://github.com/codsen/codsen/commit/104a64ab783c05af4ae8bd3eb653742eb95d0cd2))
17
17
 
18
18
  ## 5.0.0 (2021-09-09)
19
19
 
20
- ### Bug Fixes
20
+ ### Fixed
21
21
 
22
22
  - tweaks to the line length calculation ([4ec1fe2](https://github.com/codsen/codsen/commit/4ec1fe224f8e2c32e94c085afb8cf517cc806a8c))
23
23
 
@@ -44,7 +44,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
44
44
 
45
45
  ## 4.1.5 (2021-03-28)
46
46
 
47
- ### Bug Fixes
47
+ ### Fixed
48
48
 
49
49
  - retain the same type of line endings as the input ([b171628](https://github.com/codsen/codsen/commit/b171628d3fc1c0909af61530c1bcaf970c310159))
50
50
 
@@ -56,7 +56,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
56
56
 
57
57
  ## 4.0.1 (2021-01-28)
58
58
 
59
- ### Bug Fixes
59
+ ### Fixed
60
60
 
61
61
  - add testStats to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29))
62
62
  - correct the line length calculation around inline tags ([073f7a5](https://github.com/codsen/codsen/commit/073f7a5a2bb3f8ce0460e674deed9cf1eff63409))
@@ -73,13 +73,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
73
73
 
74
74
  ## 2.0.5 (2020-09-15)
75
75
 
76
- ### Bug Fixes
76
+ ### Fixed
77
77
 
78
78
  - improve CRLF line ending recognition ([ff3e3e7](https://gitlab.com/codsen/codsen/commit/ff3e3e7d7943a52e2339fb78e0cbd4677b72a11a))
79
79
 
80
80
  ## 2.0.0 (2020-07-04)
81
81
 
82
- ### Bug Fixes
82
+ ### Fixed
83
83
 
84
84
  - fix typo in the output, in log.timeTakenInMilliseconds ([48debda](https://gitlab.com/codsen/codsen/commit/48debda98858aa83d6f7df4a3b7f85895756d67e))
85
85
 
@@ -102,7 +102,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
102
102
 
103
103
  ## 1.9.35 (2020-05-24)
104
104
 
105
- ### Bug Fixes
105
+ ### Fixed
106
106
 
107
107
  - fixes the pre, code, CDATA and other code chunk skipping ([ec0408a](https://gitlab.com/codsen/codsen/commit/ec0408afee0b1a09cd711549cab6fefdc55efde8)), closes [#29](https://gitlab.com/codsen/codsen/issues/29)
108
108
 
@@ -128,19 +128,19 @@ That's now implemented.
128
128
 
129
129
  ## 1.8.5 (2019-09-04)
130
130
 
131
- ### Bug Fixes
131
+ ### Fixed
132
132
 
133
133
  - stop breaking `<!--<![endif]-->` into two parts, in front of `<![endif]` ([af421c7](https://gitlab.com/codsen/codsen/commit/af421c7))
134
134
 
135
135
  ## 1.8.3 (2019-08-24)
136
136
 
137
- ### Bug Fixes
137
+ ### Fixed
138
138
 
139
139
  - adding one more breaking point for insurance, thanks Mark Robbins ([b21651b](https://gitlab.com/codsen/codsen/commit/b21651b))
140
140
 
141
141
  ## 1.8.0 (2019-08-08)
142
142
 
143
- ### Bug Fixes
143
+ ### Fixed
144
144
 
145
145
  - previously inner tag whitespace removal was too lax, risking false positives ([ab59492](https://gitlab.com/codsen/codsen/commit/ab59492))
146
146
  - update the program's name on throw error reports ([abd093a](https://gitlab.com/codsen/codsen/commit/abd093a))
@@ -157,7 +157,7 @@ That's now implemented.
157
157
 
158
158
  ## 1.6.0 (2019-07-15)
159
159
 
160
- ### Bug Fixes
160
+ ### Fixed
161
161
 
162
162
  - Fix the rare cases where state of being within style tag was not terminated properly ([fefc206](https://gitlab.com/codsen/codsen/commit/fefc206)), closes [#11](https://gitlab.com/codsen/codsen/issues/11)
163
163
 
@@ -199,7 +199,7 @@ That's now implemented.
199
199
 
200
200
  ## 1.0.11 (2019-04-06)
201
201
 
202
- ### Bug Fixes
202
+ ### Fixed
203
203
 
204
204
  - Algorithm improvement not to break in front of `</a>` to prevent accidentally adding new spaces ([8939654](https://gitlab.com/codsen/codsen/commit/8939654))
205
205
 
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minify email templates
4
- * @version 5.1.18
4
+ * @version 5.1.19
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- import{rApply as ne}from"ranges-apply";import{Ranges as le}from"ranges-push";import{matchLeft as oe,matchRight as F,matchRightIncl as X}from"string-match-left-right";import{expander as _}from"string-range-expander";import{left as G,right as a}from"string-left-right";var Y="5.1.18";var ge=Y,$=new le({limitToBeAddedWhitespace:!0}),te={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function N(n){return typeof n=="string"}function A(n){return typeof n=="string"&&n.toUpperCase()!==n.toLowerCase()}function ce(n,E){let W=Date.now();if(!N(n))throw n===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
10
+ import{rApply as ne}from"ranges-apply";import{Ranges as le}from"ranges-push";import{matchLeft as oe,matchRight as F,matchRightIncl as X}from"string-match-left-right";import{expander as _}from"string-range-expander";import{left as G,right as a}from"string-left-right";var Y="5.1.19";var ge=Y,$=new le({limitToBeAddedWhitespace:!0}),te={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function N(n){return typeof n=="string"}function A(n){return typeof n=="string"&&n.toUpperCase()!==n.toLowerCase()}function ce(n,E){let W=Date.now();if(!N(n))throw n===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
11
11
  ${JSON.stringify(n,null,4)}`);if(E&&typeof E!="object")throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof E}, equal to ${JSON.stringify(E,null,4)}`);if(E&&Array.isArray(E.breakToTheLeftOf)&&E.breakToTheLeftOf.length){for(let e=0,w=E.breakToTheLeftOf.length;e<w;e++)if(!N(E.breakToTheLeftOf[e]))throw new TypeError(`html-crush: [THROW_ID_05] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${e} is of a type "${typeof E.breakToTheLeftOf[e]}" and is equal to:
12
12
  ${JSON.stringify(E.breakToTheLeftOf[e],null,4)}`)}let l={...te,...E};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let v="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(v=[...new Set(l.breakToTheLeftOf.map(e=>e[0]))].join(""));let L={removeHTMLComments:!1,removeCSSComments:!1},p=null,i=null,S=!1,m=0,H=0,g=!1,O=!1,c=null,f=null,V=null,U=null,u,t=null,s=null,r=null,T=null,D=null,M=null,P=">};",I="<",K="!",q=">",z="<",B="{},:;<>~+",k=B,J=B,C=!0,h=n.length,Q=Math.floor(h/2),x=.01,j;l.reportProgressFunc&&(j=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*x-l.reportProgressFuncFrom));let d,R=0,b=`
13
13
  `;if(n.includes(`\r
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minify email templates
4
- * @version 5.1.18
4
+ * @version 5.1.19
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
@@ -24,7 +24,7 @@ ${JSON.stringify(a.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that arr
24
24
  \r`.includes(e[a])||n&&e[a]===K)return a;return null}function D(e,t=0){return oi({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function si({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||r&&`
25
25
  \r`.includes(e[~-t])||n&&e[~-t]===K))return~-t;if(e[t-2]&&(e[t-2].trim()||r&&`
26
26
  \r`.includes(e[t-2])||n&&e[t-2]===K))return t-2;for(let a=t;a--;)if(e[a]&&(e[a].trim()||r&&`
27
- \r`.includes(e[a])||n&&e[a]===K))return a;return null}function de(e,t=0){return si({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var zt="5.1.18";var ai=zt,E=new et({limitToBeAddedWhitespace:!0}),Zt={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function Y(e){return typeof e=="string"}function X(e){return typeof e=="string"&&e.toUpperCase()!==e.toLowerCase()}function ui(e,t){let r=Date.now();if(!Y(e))throw e===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
27
+ \r`.includes(e[a])||n&&e[a]===K))return a;return null}function de(e,t=0){return si({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var zt="5.1.19";var ai=zt,E=new et({limitToBeAddedWhitespace:!0}),Zt={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function Y(e){return typeof e=="string"}function X(e){return typeof e=="string"&&e.toUpperCase()!==e.toLowerCase()}function ui(e,t){let r=Date.now();if(!Y(e))throw e===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
28
28
  ${JSON.stringify(e,null,4)}`);if(t&&typeof t!="object")throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof t}, equal to ${JSON.stringify(t,null,4)}`);if(t&&Array.isArray(t.breakToTheLeftOf)&&t.breakToTheLeftOf.length){for(let i=0,Q=t.breakToTheLeftOf.length;i<Q;i++)if(!Y(t.breakToTheLeftOf[i]))throw new TypeError(`html-crush: [THROW_ID_05] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${i} is of a type "${typeof t.breakToTheLeftOf[i]}" and is equal to:
29
29
  ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.removeHTMLComments=="boolean"&&(n.removeHTMLComments=n.removeHTMLComments?1:0);let a="";Array.isArray(n.breakToTheLeftOf)&&n.breakToTheLeftOf.length&&(a=[...new Set(n.breakToTheLeftOf.map(i=>i[0]))].join(""));let o={removeHTMLComments:!1,removeCSSComments:!1},u=null,l=null,c=!1,s=0,d=0,p=!1,T=!1,f=null,m=null,w=null,L=null,b,h=null,$=null,y=null,A=null,I=null,V=null,z=">};",Z="<",Qt="!",en=">",tn="<",We="{},:;<>~+",be=We,Te=We,j=!0,v=e.length,nn=Math.floor(v/2),je=.01,Je;n.reportProgressFunc&&(Je=Math.floor(n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*je-n.reportProgressFuncFrom));let R,oe=0,C=`
30
30
  `;if(e.includes(`\r
@@ -42,7 +42,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
42
42
  /**
43
43
  * @name arrayiffy-if-string
44
44
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
45
- * @version 4.1.2
45
+ * @version 4.1.3
46
46
  * @author Roy Revelt, Codsen Ltd
47
47
  * @license MIT
48
48
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -50,7 +50,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
50
50
  /**
51
51
  * @name ranges-apply
52
52
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
53
- * @version 6.2.8
53
+ * @version 6.2.9
54
54
  * @author Roy Revelt, Codsen Ltd
55
55
  * @license MIT
56
56
  * {@link https://codsen.com/os/ranges-apply/}
@@ -58,7 +58,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
58
58
  /**
59
59
  * @name ranges-merge
60
60
  * @fileoverview Merge and sort string index ranges
61
- * @version 8.2.3
61
+ * @version 8.2.4
62
62
  * @author Roy Revelt, Codsen Ltd
63
63
  * @license MIT
64
64
  * {@link https://codsen.com/os/ranges-merge/}
@@ -66,7 +66,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
66
66
  /**
67
67
  * @name ranges-push
68
68
  * @fileoverview Gather string index ranges
69
- * @version 6.2.3
69
+ * @version 6.2.4
70
70
  * @author Roy Revelt, Codsen Ltd
71
71
  * @license MIT
72
72
  * {@link https://codsen.com/os/ranges-push/}
@@ -74,7 +74,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
74
74
  /**
75
75
  * @name ranges-sort
76
76
  * @fileoverview Sort string index ranges
77
- * @version 5.1.2
77
+ * @version 5.1.3
78
78
  * @author Roy Revelt, Codsen Ltd
79
79
  * @license MIT
80
80
  * {@link https://codsen.com/os/ranges-sort/}
@@ -82,7 +82,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
82
82
  /**
83
83
  * @name string-collapse-leading-whitespace
84
84
  * @fileoverview Collapse the leading and trailing whitespace of a string
85
- * @version 6.1.3
85
+ * @version 6.1.4
86
86
  * @author Roy Revelt, Codsen Ltd
87
87
  * @license MIT
88
88
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
@@ -90,7 +90,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
90
90
  /**
91
91
  * @name string-left-right
92
92
  * @fileoverview Looks up the first non-whitespace character to the left/right of a given index
93
- * @version 5.1.3
93
+ * @version 5.1.4
94
94
  * @author Roy Revelt, Codsen Ltd
95
95
  * @license MIT
96
96
  * {@link https://codsen.com/os/string-left-right/}
@@ -98,7 +98,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
98
98
  /**
99
99
  * @name string-match-left-right
100
100
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
101
- * @version 8.2.3
101
+ * @version 8.2.4
102
102
  * @author Roy Revelt, Codsen Ltd
103
103
  * @license MIT
104
104
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -106,7 +106,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
106
106
  /**
107
107
  * @name string-range-expander
108
108
  * @fileoverview Expands string index ranges within whitespace boundaries until letters are met
109
- * @version 3.1.2
109
+ * @version 3.1.3
110
110
  * @author Roy Revelt, Codsen Ltd
111
111
  * @license MIT
112
112
  * {@link https://codsen.com/os/string-range-expander/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-crush",
3
- "version": "5.1.18",
3
+ "version": "5.1.19",
4
4
  "description": "Minify email templates",
5
5
  "keywords": [
6
6
  "breaks",
@@ -78,11 +78,11 @@
78
78
  }
79
79
  },
80
80
  "dependencies": {
81
- "ranges-apply": "^6.2.8",
82
- "ranges-push": "^6.2.3",
83
- "string-left-right": "^5.1.3",
84
- "string-match-left-right": "^8.2.3",
85
- "string-range-expander": "^3.1.2",
86
- "test-mixer": "^3.1.2"
81
+ "ranges-apply": "^6.2.9",
82
+ "ranges-push": "^6.2.4",
83
+ "string-left-right": "^5.1.4",
84
+ "string-match-left-right": "^8.2.4",
85
+ "string-range-expander": "^3.1.3",
86
+ "test-mixer": "^3.1.3"
87
87
  }
88
88
  }