string-remove-widows 4.0.36 → 4.1.0
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/.eslintcache +1 -0
- package/CHANGELOG.md +6 -0
- package/LICENSE +2 -2
- package/README.md +3 -3
- package/dist/string-remove-widows.esm.js +5 -5
- package/dist/string-remove-widows.umd.js +21 -21
- package/package.json +8 -8
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"/home/runner/work/codsen/codsen/packages/string-remove-widows/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/string-remove-widows/examples/widow-word-removal-from-html.js":"2","/home/runner/work/codsen/codsen/packages/string-remove-widows/perf/check.js":"3","/home/runner/work/codsen/codsen/packages/string-remove-widows/rollup.config.js":"4","/home/runner/work/codsen/codsen/packages/string-remove-widows/src/main.ts":"5","/home/runner/work/codsen/codsen/packages/string-remove-widows/src/util.ts":"6","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/api.js":"7","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/basic.js":"8","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/convertEntities.js":"9","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/eol.js":"10","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/hyphens.js":"11","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/ignore-nunj.js":"12","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/minCharCount.js":"13","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/minWordCount.js":"14","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/postcodes.js":"15","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/removeMeasures.js":"16","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/reportProgressFunc.js":"17","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/tagRanges.js":"18","/home/runner/work/codsen/codsen/packages/string-remove-widows/test/util.js":"19"},{"size":350,"mtime":1760566739155,"results":"20","hashOfConfig":"21"},{"size":907,"mtime":1760566739155,"results":"22","hashOfConfig":"21"},{"size":732,"mtime":1760566739155,"results":"23","hashOfConfig":"24"},{"size":373,"mtime":1760566739155,"results":"25","hashOfConfig":"21"},{"size":36374,"mtime":1760566739155,"results":"26","hashOfConfig":"24"},{"size":2244,"mtime":1760566739155,"results":"27","hashOfConfig":"24"},{"size":1390,"mtime":1760566739155,"results":"28","hashOfConfig":"29"},{"size":16886,"mtime":1760566739155,"results":"30","hashOfConfig":"29"},{"size":9537,"mtime":1760566739155,"results":"31","hashOfConfig":"29"},{"size":3722,"mtime":1760566739155,"results":"32","hashOfConfig":"29"},{"size":3613,"mtime":1760566739155,"results":"33","hashOfConfig":"29"},{"size":4132,"mtime":1760566739155,"results":"34","hashOfConfig":"29"},{"size":2455,"mtime":1760566739155,"results":"35","hashOfConfig":"29"},{"size":2384,"mtime":1760566739156,"results":"36","hashOfConfig":"29"},{"size":13269,"mtime":1760566739156,"results":"37","hashOfConfig":"29"},{"size":7382,"mtime":1760566739156,"results":"38","hashOfConfig":"29"},{"size":18614,"mtime":1760566739156,"results":"39","hashOfConfig":"29"},{"size":2397,"mtime":1760566739156,"results":"40","hashOfConfig":"29"},{"size":606,"mtime":1760566739156,"results":"41","hashOfConfig":"29"},{"filePath":"42","messages":"43","suppressedMessages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"45","messages":"46","suppressedMessages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","suppressedMessages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"filePath":"51","messages":"52","suppressedMessages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","suppressedMessages":"56","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","suppressedMessages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","suppressedMessages":"62","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"nrihsz",{"filePath":"63","messages":"64","suppressedMessages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","suppressedMessages":"68","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","suppressedMessages":"71","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","suppressedMessages":"74","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","suppressedMessages":"77","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","suppressedMessages":"80","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","suppressedMessages":"83","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"84","messages":"85","suppressedMessages":"86","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"87","messages":"88","suppressedMessages":"89","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"90","messages":"91","suppressedMessages":"92","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","suppressedMessages":"95","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","suppressedMessages":"98","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/codsen/codsen/packages/string-remove-widows/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/string-remove-widows/examples/widow-word-removal-from-html.js",[],[],"/home/runner/work/codsen/codsen/packages/string-remove-widows/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/string-remove-widows/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/string-remove-widows/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/string-remove-widows/src/util.ts",[],[],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/api.js",[],["99","100","101","102","103","104"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/basic.js",[],["105","106","107","108","109","110"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/convertEntities.js",[],["111","112","113","114","115","116"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/eol.js",[],["117","118","119","120","121","122"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/hyphens.js",[],["123","124","125","126","127","128"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/ignore-nunj.js",[],["129","130","131","132","133","134"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/minCharCount.js",[],["135","136","137","138","139","140"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/minWordCount.js",[],["141","142","143","144","145","146"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/postcodes.js",[],["147","148","149","150","151","152"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/removeMeasures.js",[],["153","154","155","156","157","158"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/reportProgressFunc.js",[],["159","160","161","162","163"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/tagRanges.js",[],["164","165","166","167","168","169"],"/home/runner/work/codsen/codsen/packages/string-remove-widows/test/util.js",[],[],{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"173"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"175"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"177"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"179"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"181"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"183"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"184"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"185"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"186"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"187"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"188"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"189"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"190"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"191"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"192"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"193"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"194"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"195"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"196"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"197"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"198"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"199"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"200"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"201"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"202"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"203"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"204"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"205"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"206"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"207"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"208"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"209"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"210"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"211"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"212"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"213"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"214"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"215"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"216"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"217"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"218"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"219"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"220"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"221"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"222"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"223"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"224"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"225"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"226"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"227"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"228"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"229"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"230"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"231"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"232"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"233"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"234"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"235"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"236"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"237"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"238"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"239"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"240"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"241"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"242"},{"ruleId":"170","severity":2,"message":"171","line":3,"column":17,"nodeType":null,"messageId":"172","endLine":3,"endColumn":19,"suppressions":"243"},{"ruleId":"170","severity":2,"message":"174","line":3,"column":21,"nodeType":null,"messageId":"172","endLine":3,"endColumn":23,"suppressions":"244"},{"ruleId":"170","severity":2,"message":"176","line":3,"column":25,"nodeType":null,"messageId":"172","endLine":3,"endColumn":31,"suppressions":"245"},{"ruleId":"170","severity":2,"message":"178","line":3,"column":33,"nodeType":null,"messageId":"172","endLine":3,"endColumn":37,"suppressions":"246"},{"ruleId":"170","severity":2,"message":"180","line":3,"column":39,"nodeType":null,"messageId":"172","endLine":3,"endColumn":42,"suppressions":"247"},{"ruleId":"170","severity":2,"message":"182","line":3,"column":44,"nodeType":null,"messageId":"172","endLine":3,"endColumn":49,"suppressions":"248"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["249"],"'ok' is defined but never used.",["250"],"'throws' is defined but never used.",["251"],"'type' is defined but never used.",["252"],"'not' is defined but never used.",["253"],"'match' is defined but never used.",["254"],["255"],["256"],["257"],["258"],["259"],["260"],["261"],["262"],["263"],["264"],["265"],["266"],["267"],["268"],["269"],["270"],["271"],["272"],["273"],["274"],["275"],["276"],["277"],["278"],["279"],["280"],["281"],["282"],["283"],["284"],["285"],["286"],["287"],["288"],["289"],["290"],["291"],["292"],["293"],["294"],["295"],["296"],["297"],["298"],["299"],["300"],["301"],["302"],["303"],["304"],["305"],["306"],["307"],["308"],["309"],["310"],["311"],["312"],["313"],["314"],["315"],["316"],["317"],["318"],["319"],{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},{"kind":"320","justification":"321"},"directive",""]
|
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
|
+
## 4.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
|
## 4.0.0 (2022-12-01)
|
|
7
13
|
|
|
8
14
|
### BREAKING CHANGES
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright
|
|
3
|
+
Copyright © 2010-2025 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ assert.equal(res, "Some text with many words on one line.");
|
|
|
46
46
|
|
|
47
47
|
## Documentation
|
|
48
48
|
|
|
49
|
-
Please [visit codsen.com](https://codsen.com/os/string-remove-widows/) for a full description of the API.
|
|
49
|
+
Please [visit codsen.com](https://codsen.com/os/string-remove-widows/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/string-remove-widows/CHANGELOG.md).
|
|
50
50
|
|
|
51
51
|
## Contributing
|
|
52
52
|
|
|
@@ -54,8 +54,8 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
54
54
|
|
|
55
55
|
## Licence
|
|
56
56
|
|
|
57
|
-
MIT License
|
|
57
|
+
MIT License
|
|
58
58
|
|
|
59
|
-
Copyright © 2010-2025 Roy Revelt and other contributors
|
|
59
|
+
Copyright © 2010-2025 Roy Revelt and other contributors
|
|
60
60
|
|
|
61
61
|
<p align="center"><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"></p>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-remove-widows
|
|
3
3
|
* @fileoverview Helps to prevent widow words in a text
|
|
4
|
-
* @version 4.0
|
|
5
|
-
* @author Roy Revelt
|
|
4
|
+
* @version 4.1.0
|
|
5
|
+
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-remove-widows/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{matchRightIncl as Q}from"string-match-left-right";import{left as T,right as D}from"string-left-right";import{Ranges as X}from"ranges-push";import{rApply as q}from"ranges-apply";import{rawNbsp as w,rawNDash as ee,rawMDash as te}from"codsen-utils";var R="4.0
|
|
11
|
-
${JSON.stringify(t,null,4)}`);if(h&&typeof h!="object")throw new Error(`string-remove-widows: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof h}, equal to ${JSON.stringify(h,null,4)}`);let b=Array.isArray,L=t.length,a=new X({mergeType:2}),K=["."],Z=/[A-Z]{1,2}[0-9][0-9A-Z]?$/,Y=/^[0-9][A-Z]{2}/,V=.06,$,A=0,g=0,W=0,y,N,
|
|
10
|
+
import{matchRightIncl as Q}from"string-match-left-right";import{left as T,right as D}from"string-left-right";import{Ranges as X}from"ranges-push";import{rApply as q}from"ranges-apply";import{rawNbsp as w,rawNDash as ee,rawMDash as te}from"codsen-utils";var R="4.1.0";var f=" ",E="\\00A0",S="\\u00A0",j="–",M="\\2013",J="\\u2013",U="—",k="\\2014",I="\\u2014",C=[{heads:"{{",tails:"}}"},{heads:["{% if","{%- if"],tails:["{% endif","{%- endif"]},{heads:["{% for","{%- for"],tails:["{% endfor","{%- endfor"]},{heads:["{%","{%-"],tails:["%}","-%}"]},{heads:"{#",tails:"#}"}],B=[{heads:"{{",tails:"}}"}],P=[{heads:["<%","<%=","<%-"],tails:["%>","=%>","-%>"]}],_=["abbr","address","area","article","aside","audio","base","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","param","picture","pre","progress","rb","rp","rt","rtc","ruby","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","ul","var","video","wbr","xml"];var ce=R,oe={removeWidowPreventionMeasures:!1,convertEntities:!0,targetLanguage:"html",UKPostcodes:!1,hyphens:!0,minWordCount:4,minCharCount:5,ignore:[],reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,tagRanges:[]};function me(t,h){let G=Date.now();if(typeof t!="string")throw t===void 0?new Error("string-remove-widows: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`string-remove-widows: [THROW_ID_02] the first input argument must be string! It was given as "${typeof t}", equal to:
|
|
11
|
+
${JSON.stringify(t,null,4)}`);if(h&&typeof h!="object")throw new Error(`string-remove-widows: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof h}, equal to ${JSON.stringify(h,null,4)}`);let b=Array.isArray,L=t.length,a=new X({mergeType:2}),K=["."],Z=/[A-Z]{1,2}[0-9][0-9A-Z]?$/,Y=/^[0-9][A-Z]{2}/,V=.06,$,A=0,g=0,W=0,y,N,l,c,r,d,s,p,o={...oe,...h},m={removeWidows:!1,convertEntities:!1};if(!o.ignore||!b(o.ignore)&&typeof o.ignore!="string")o.ignore=[];else if(typeof o.ignore=="string"&&(o.ignore=[o.ignore]),o.ignore.includes("all"))o.ignore=o.ignore.concat(C.concat(P));else if(o.ignore.some(e=>typeof e=="string")){let e=[];o.ignore=o.ignore.filter(i=>typeof i=="string"&&i.length?(["nunjucks","jinja","liquid"].includes(i.trim().toLowerCase())?e=e.concat(C):["hugo"].includes(i.trim().toLowerCase())?e=e.concat(B):["hexo"].includes(i.trim().toLowerCase())&&(e=e.concat(P)),!1):typeof i=="object"),e.length&&(o.ignore=o.ignore.concat(e))}let x;o.reportProgressFunc&&(x=Math.floor(o.reportProgressFuncTo-(o.reportProgressFuncTo-o.reportProgressFuncFrom)*V-o.reportProgressFuncFrom));function v(e,i){let n=w;o.removeWidowPreventionMeasures?n=" ":o.convertEntities&&(n=f,typeof o.targetLanguage=="string"&&(o.targetLanguage.trim().toLowerCase()==="css"?n=E:o.targetLanguage.trim().toLowerCase()==="js"&&(n=S))),t.slice(e,i)!==n&&a.push(e,i,n)}function O(){g=0,W=0,y=void 0,N=void 0,l=void 0,c=void 0,r=void 0,d=void 0}O();for(let e=0;e<=L;e++){if(!s&&b(o.ignore)&&o.ignore.length&&o.ignore.some((n,u)=>{if(b(n.heads)&&n.heads.some(H=>t.startsWith(H,e))||typeof n.heads=="string"&&t.startsWith(n.heads,e))return g+=1,s=o.ignore[u].tails,!0}),!s&&p&&p===e&&(g+=1,p=void 0),typeof o.reportProgressFunc=="function"&&($=o.reportProgressFuncFrom+Math.floor(e/L*(x||1)),$!==A&&(A=$,o.reportProgressFunc($))),!s&&e&&t[e]?.trim()&&(!t[e-1]||t[e-1]&&!t[e-1].trim())&&(c=e),!s&&t[e]?.trim()&&(W+=1),!s&&o.hyphens&&(`-${te}${ee}`.includes(t[e])||t.startsWith(j,e)||t.startsWith(M,e)||t.startsWith(J,e)||t.startsWith(U,e)||t.startsWith(k,e)||t.startsWith(I,e))&&t[e+1]&&(!t[e+1].trim()||t[e]==="&")&&t[e-1]&&!t[e-1].trim()&&t[T(t,e)]&&(v(T(t,e)+1,e),m.removeWidows=!0),!s&&(t.startsWith(" ",e)||t.startsWith(" ",e))&&(r=e,d=e+6,t[e+6]?.trim()&&(p=e+6),o.convertEntities?(o.targetLanguage==="css"||o.targetLanguage==="js")&&(a.push(e,e+6,o.targetLanguage==="css"?E:S),m.convertEntities=!0):(a.push(e,e+6,w),m.convertEntities=!0)),!s&&t[e+4]&&t[e]==="\\"&&t[e+1]==="0"&&t[e+2]==="0"&&t[e+3].toUpperCase()==="A"&&t[e+4]==="0"&&(r=e,d=e+5,t[e+5]?.trim()&&(p=e+5),o.convertEntities?(o.targetLanguage==="html"||o.targetLanguage==="js")&&(a.push(e,e+5,o.targetLanguage==="html"?f:S),m.convertEntities=!0):(a.push(e,e+5,w),m.convertEntities=!0)),!s&&t[e]==="\\"&&t[e+1]&&t[e+1].toLowerCase()==="u"&&t[e+2]==="0"&&t[e+3]==="0"&&t[e+4]&&t[e+4].toUpperCase()==="A"&&t[e+5]==="0"&&(r=e,d=e+6,t[e+6]?.trim()&&(p=e+6),o.convertEntities?(o.targetLanguage==="html"||o.targetLanguage==="css")&&a.push(e,e+6,o.targetLanguage==="html"?f:E):a.push(e,e+6,w)),!s&&t[e]===w&&(r=e,d=e+1,o.convertEntities&&a.push(e,e+1,o.targetLanguage==="css"?E:o.targetLanguage==="js"?S:f)),!s&&t[e]?.trim()&&!t[e-1]?.trim()&&(g+=1),!s&&(!t[e]||`\r
|
|
12
12
|
`.includes(t[e])||(t[e]===`
|
|
13
13
|
`||t[e]==="\r"||t[e]==="\r"&&t[e+1]===`
|
|
14
|
-
`)&&T(t,e)&&K.includes(t[T(t,e)]))){if((!o.minWordCount||g>=o.minWordCount)&&(!o.minCharCount||W>=o.minCharCount)){let n,l
|
|
14
|
+
`)&&T(t,e)&&K.includes(t[T(t,e)]))){if((!o.minWordCount||g>=o.minWordCount)&&(!o.minCharCount||W>=o.minCharCount)){let n,u;l!==void 0&&c!==void 0&&r!==void 0&&d!==void 0?l>r?(n=l,u=c):(n=r,u=d):l!==void 0&&c!==void 0?(n=l,u=c):r!==void 0&&d!==void 0&&(n=r,u=d),!(n&&u)&&y&&N&&(n=y,u=N),n&&u&&(v(n,u),m.removeWidows=!0)}O()}o.UKPostcodes&&t[e]&&!t[e].trim()&&t[e-1]?.trim()&&Z.test(t.slice(0,e))&&t[D(t,e)]&&Y.test(t.slice(D(t,e)))&&(v(e,D(t,e)),m.removeWidows=!0),!s&&t[e]&&!t[e].trim()&&t[e-1]?.trim()&&(l===void 0||t[l-1]?.trim())&&!"/>".includes(t[D(t,e)])&&!t.slice(0,e).trim().endsWith("br")&&!t.slice(0,e).trim().endsWith("hr")&&!(t.slice(0,e).endsWith("<")&&_.some(n=>t.startsWith(n,D(t,e))))&&(y=l,N=c,l=e,c=void 0,(r!==void 0||d!==void 0)&&(r=void 0,d=void 0));let i;s&&(typeof s=="string"&&(!s.length||t.startsWith(s,e))?s=void 0:b(s)&&(!s.length||s.some(n=>{if(t.startsWith(n,e))return i=n,!0}))&&(s=void 0,e+=i.length,b(o.ignore)&&o.ignore.length&&t[e+1]&&o.ignore.some(n=>Q(t,e,n.tails,{trimBeforeMatching:!0,cb:(u,H,F)=>(F&&(e=F-1,t[e+1]?.trim()&&(g+=1)),!0)})))),t[e]&&`\r
|
|
15
15
|
`.includes(t[e])&&(g=0,W=0),b(o.tagRanges)&&o.tagRanges.length&&o.tagRanges.some(n=>{if(e>=n[0]&&e<=n[1]&&n[1]-1>e)return e=n[1]-1,!0})}return q(t,a.current()).split("").forEach((e,i)=>{}),{res:q(t,a.current(),o.reportProgressFunc?e=>{$=Math.floor((o.reportProgressFuncTo-o.reportProgressFuncFrom)*(1-V)+e/100*(o.reportProgressFuncTo-o.reportProgressFuncFrom)*V),$!==A&&(A=$,o.reportProgressFunc($))}:void 0),ranges:a.current(),log:{timeTakenInMilliseconds:Date.now()-G},whatWasDone:m}}export{oe as defaults,me as removeWidows,ce as version};
|
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-remove-widows
|
|
3
3
|
* @fileoverview Helps to prevent widow words in a text
|
|
4
|
-
* @version 4.0
|
|
5
|
-
* @author Roy Revelt
|
|
4
|
+
* @version 4.1.0
|
|
5
|
+
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-remove-widows/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var stringRemoveWidows=(()=>{var Pe=Object.create;var F=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,ke=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable;var q=(e,t,i)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,T=(e,t)=>{for(var i in t||(t={}))me.call(t,i)&&q(e,i,t[i]);if(de)for(var i of de(t))Ue.call(t,i)&&q(e,i,t[i]);return e};var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qe=(e,t)=>{for(var i in t)F(e,i,{get:t[i],enumerable:!0})},he=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let g of Je(t))!me.call(e,g)&&g!==i&&F(e,g,{get:()=>t[g],enumerable:!(n=Be(t,g))||n.enumerable});return e};var pe=(e,t,i)=>(i=e!=null?Pe(ke(e)):{},he(t||!e||!e.__esModule?F(i,"default",{value:e,enumerable:!0}):i,e)),Ge=e=>he(F({},"__esModule",{value:!0}),e);var Q=(e,t,i)=>q(e,typeof t!="symbol"?t+"":t,i);var G=qe((ft,be)=>{"use strict";be.exports=Ke;function x(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function Ke(e){if(e=e||{},e.circles)return Ze(e);let t=new Map;if(t.set(Date,c=>new Date(c)),t.set(Map,(c,u)=>new Map(n(Array.from(c),u))),t.set(Set,(c,u)=>new Set(n(Array.from(c),u))),e.constructorHandlers)for(let c of e.constructorHandlers)t.set(c[0],c[1]);let i=null;return e.proto?r:g;function n(c,u){let l=Object.keys(c),o=new Array(l.length);for(let a=0;a<l.length;a++){let d=l[a],p=c[d];typeof p!="object"||p===null?o[d]=p:p.constructor!==Object&&(i=t.get(p.constructor))?o[d]=i(p,u):ArrayBuffer.isView(p)?o[d]=x(p):o[d]=u(p)}return o}function g(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return n(c,g);if(c.constructor!==Object&&(i=t.get(c.constructor)))return i(c,g);let u={};for(let l in c){if(Object.hasOwnProperty.call(c,l)===!1)continue;let o=c[l];typeof o!="object"||o===null?u[l]=o:o.constructor!==Object&&(i=t.get(o.constructor))?u[l]=i(o,g):ArrayBuffer.isView(o)?u[l]=x(o):u[l]=g(o)}return u}function r(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return n(c,r);if(c.constructor!==Object&&(i=t.get(c.constructor)))return i(c,r);let u={};for(let l in c){let o=c[l];typeof o!="object"||o===null?u[l]=o:o.constructor!==Object&&(i=t.get(o.constructor))?u[l]=i(o,r):ArrayBuffer.isView(o)?u[l]=x(o):u[l]=r(o)}return u}}function Ze(e){let t=[],i=[],n=new Map;if(n.set(Date,l=>new Date(l)),n.set(Map,(l,o)=>new Map(r(Array.from(l),o))),n.set(Set,(l,o)=>new Set(r(Array.from(l),o))),e.constructorHandlers)for(let l of e.constructorHandlers)n.set(l[0],l[1]);let g=null;return e.proto?u:c;function r(l,o){let a=Object.keys(l),d=new Array(a.length);for(let p=0;p<a.length;p++){let h=a[p],m=l[h];if(typeof m!="object"||m===null)d[h]=m;else if(m.constructor!==Object&&(g=n.get(m.constructor)))d[h]=g(m,o);else if(ArrayBuffer.isView(m))d[h]=x(m);else{let y=t.indexOf(m);y!==-1?d[h]=i[y]:d[h]=o(m)}}return d}function c(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return r(l,c);if(l.constructor!==Object&&(g=n.get(l.constructor)))return g(l,c);let o={};t.push(l),i.push(o);for(let a in l){if(Object.hasOwnProperty.call(l,a)===!1)continue;let d=l[a];if(typeof d!="object"||d===null)o[a]=d;else if(d.constructor!==Object&&(g=n.get(d.constructor)))o[a]=g(d,c);else if(ArrayBuffer.isView(d))o[a]=x(d);else{let p=t.indexOf(d);p!==-1?o[a]=i[p]:o[a]=c(d)}}return t.pop(),i.pop(),o}function u(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return r(l,u);if(l.constructor!==Object&&(g=n.get(l.constructor)))return g(l,u);let o={};t.push(l),i.push(o);for(let a in l){let d=l[a];if(typeof d!="object"||d===null)o[a]=d;else if(d.constructor!==Object&&(g=n.get(d.constructor)))o[a]=g(d,u);else if(ArrayBuffer.isView(d))o[a]=x(d);else{let p=t.indexOf(d);p!==-1?o[a]=i[p]:o[a]=u(d)}}return t.pop(),i.pop(),o}}});var ut={};Qe(ut,{defaults:()=>_e,removeWidows:()=>lt,version:()=>at});function $e(e){return typeof e!="string"?e:e.length?[e]:[]}var ye=pe(G(),1);var dt=(0,ye.default)();var we="\u2013",Ee="\u2014",I="\xA0";function H(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function D(e){return typeof e=="string"}function C(e){return Number.isSafeInteger(e)&&e>=0}function R(e){return e!=null}function Ae(e,t){return H(e)&&D(t)&&t in e}var Te={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ze=e=>e+1;function Ye(e,t,i,n,g=!1,r=ze){var w;let c=typeof i=="function"?i():i;if(+t<0&&g&&c==="EOL")return c;let u=T(T({},Te),n);if(t>=e.length&&!g)return!1;let l=g?1:i.length,o=0,a=!1,d=!1,p=!1,h=u.maxMismatches,m=t,y=!1,v=!1,E=!1;function A(){return o===1&&h<u.maxMismatches-1}for(;e[m];){let $=r(m);if(u.trimBeforeMatching&&e[m].trim()===""){if(!e[$]&&g&&i==="EOL")return!0;m=r(m);continue}if(u&&!u.i&&((w=u==null?void 0:u.trimCharsBeforeMatching)!=null&&w.includes(e[m]))||u!=null&&u.i&&u.trimCharsBeforeMatching&&u.trimCharsBeforeMatching.map(f=>f.toLowerCase()).includes(e[m].toLowerCase())){if(g&&i==="EOL"&&!e[$])return!0;m=r(m);continue}let O=$>m?i[i.length-l]:i[l-1];if(!u.i&&e[m]===O||u.i&&e[m].toLowerCase()===O.toLowerCase()){if(y||(y=!0),p||(p=!0),l===i.length){if(v=!0,h!==u.maxMismatches)return!1}else l===1&&(E=!0);if(l-=1,o++,A())return!1;if(!l)return o!==i.length||h===u.maxMismatches||!a?m:!1}else if(!a&&!o&&(a=!0),u.maxMismatches&&h&&m){h-=1;for(let f=0;f<=h;f++){let S=$>m?i[i.length-l+1+f]:i[l-2-f],M=e[r(m)];if(S&&(!u.i&&e[m]===S||u.i&&e[m].toLowerCase()===S.toLowerCase())&&(!u.firstMustMatch||l!==i.length)){if(o++,A())return!1;l-=2,y=!0;break}else if(M&&S&&(!u.i&&M===S||u.i&&M.toLowerCase()===S.toLowerCase())&&(!u.firstMustMatch||l!==i.length)){if(!o&&!u.hungry)return!1;l-=1,y=!0;break}else if(S===void 0&&h>=0&&y&&(!u.firstMustMatch||v)&&(!u.lastMustMatch||E))return m}y||(d=m)}else return m===0&&l===1&&!u.lastMustMatch&&p?0:!1;if(d!==!1&&d!==m&&(d=!1),l<1)return m;m=r(m)}if(l>0)return g&&c==="EOL"?!0:u&&u.maxMismatches>=l&&p?d||0:!1}function Xe(e,t,i,n,g){var a,d,p;if(H(g)&&Ae(g,"trimBeforeMatching")&&g&&typeof g.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(g.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let r=T(T({},Te),g);if(typeof r.trimCharsBeforeMatching=="string"&&(r.trimCharsBeforeMatching=$e(r.trimCharsBeforeMatching)),r.trimCharsBeforeMatching=r.trimCharsBeforeMatching.map(h=>D(h)?h:String(h)),!D(t)||!t.length)return!1;if(!Number.isInteger(i)||i<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ").concat(typeof i,", equal to:\n").concat(JSON.stringify(i,null,4)));let c,u;if(D(n))c=[n];else if(Array.isArray(n))c=n;else if(!n)c=n;else if(typeof n=="function")c=[],c.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));if(g&&!H(g))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof g,'", and equal to:\n').concat(JSON.stringify(g,null,4)));let l=0,o="";if((a=r==null?void 0:r.trimCharsBeforeMatching)!=null&&a.some((h,m)=>h.length>1?(l=m,o=h,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(l," is longer than 1 character, ").concat(o.length," (equals to ").concat(o,"). Please split it into separate characters and put into array as separate elements."));if(!c||!Array.isArray(c)||Array.isArray(c)&&!c.length||Array.isArray(c)&&c.length===1&&D(c[0])&&!c[0].trim()){if(typeof r.cb=="function"){let m,y=i;if((e==="matchLeftIncl"||e==="matchRight")&&(y+=1),e[5]==="L")for(let w=y;w--;){let $=t[w];if((!r.trimBeforeMatching||r.trimBeforeMatching&&($!=null&&$.trim()))&&(!((d=r.trimCharsBeforeMatching)!=null&&d.length)||$!==void 0&&!r.trimCharsBeforeMatching.includes($))){m=w;break}}else if(e.startsWith("matchRight"))for(let w=y;w<t.length;w++){let $=t[w];if((!r.trimBeforeMatching||r.trimBeforeMatching&&$.trim())&&(!((p=r.trimCharsBeforeMatching)!=null&&p.length)||!r.trimCharsBeforeMatching.includes($))){m=w;break}}if(m===void 0)return!1;let v=t[m],E=m+1,A="";return E&&E>0&&(A=t.slice(0,E)),e[5]==="L"||m&&m>0&&(A=t.slice(m)),r.cb(v,A,m)}let h="";throw g||(h=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(h))}for(let h=0,m=c.length;h<m;h++){u=typeof c[h]=="function";let y=c[h],v,E,A="",w=i;e==="matchRight"?w+=1:e==="matchLeft"&&(w-=1);let $=Ye(t,w,y,r,u,O=>e[5]==="L"?O-1:O+1);if($&&u&&typeof y=="function"&&y()==="EOL")return y()&&(!r.cb||r.cb(v,A,E))?y():!1;if(Number.isInteger($)&&(E=e.startsWith("matchLeft")?$-1:$+1,e[5]==="L"?A=t.slice(0,$):A=t.slice(E)),E<0&&(E=void 0),t[E]&&(v=t[E]),Number.isInteger($)&&(!r.cb||r.cb(v,A,E)))return y}return!1}function ve(e,t,i,n){return Xe("matchRightIncl",e,t,i,n)}var Se=pe(G(),1);var wt=(0,Se.default)();var L="\xA0";function et({str:e,idx:t=0,stopAtNewlines:i=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),!e[t+1]))return null;if(e[t+1]&&(e[t+1].trim()||i&&"\n\r".includes(e[t+1])||n&&e[t+1]===L))return t+1;if(e[t+2]&&(e[t+2].trim()||i&&"\n\r".includes(e[t+2])||n&&e[t+2]===L))return t+2;for(let g=t+1,r=e.length;g<r;g++)if(e[g].trim()||i&&"\n\r".includes(e[g])||n&&e[g]===L)return g;return null}function j(e,t=0){return et({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function tt({str:e,idx:t,stopAtNewlines:i,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||i&&"\n\r".includes(e[~-t])||n&&e[~-t]===L))return~-t;if(e[t-2]&&(e[t-2].trim()||i&&"\n\r".includes(e[t-2])||n&&e[t-2]===L))return t-2;for(let g=t;g--;)if(e[g]&&(e[g].trim()||i&&"\n\r".includes(e[g])||n&&e[g]===L))return g;return null}function _(e,t=0){return tt({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function k(e,t=1){let i="\xA0";function n(r){return Array.from(r).reverse().join("")}function g(r,c,u){let l=u?"\n":"\r",o=u?"\r":"\n";if(!r)return r;let a=0,d=0,p="";for(let h=0,m=r.length;h<m;h++)(r[h]===l||r[h]===o&&r[h-1]!==l)&&d++,"\r\n".includes(r[h])||r[h]===i?(a=0,r[h]===i?p+=r[h]:r[h]===l?d<=c&&(p+=r[h],r[h+1]===o&&(p+=r[h+1],h++)):r[h]===o&&(r==null?void 0:r[h-1])!==l&&d<=c&&(p+=r[h])):(a++,!r[h+1]&&!d&&(p+=" "));return p}if(typeof e=="string"&&e.length){let r=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(r=+t);let c="",u="";if(!e.trim())c=e;else if(!e[0].trim()){for(let l=0,o=e.length;l<o;l++)if(e[l].trim()){c=e.slice(0,l);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===i)){for(let l=e.length;l--;)if(e[l].trim()){u=e.slice(l+1);break}}return"".concat(g(c,r,!1)).concat(e.trim()).concat(n(g(n(u),r,!0)))}return e}var rt={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function V(e,t){if(!Array.isArray(e)||!e.length)return e;let i=T(T({},rt),t),n,g;if(i.strictlyTwoElementsInRangeArrays&&!e.every((u,l)=>!Array.isArray(u)||u.length!==2?(n=l,g=u.length,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(n,"th range (").concat(JSON.stringify(e[n],null,4),") has not two but ").concat(g," elements!"));if(!e.every((u,l)=>!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0?(n=l,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(n,"th range (").concat(JSON.stringify(e[n],null,4),") does not consist of only natural numbers!"));let r=e.length**2,c=0;return Array.from(e).sort((u,l)=>(i.progressFn&&(c+=1,i.progressFn(Math.floor(c*100/r))),u[0]===l[0]?u[1]<l[1]?-1:u[1]>l[1]?1:0:u[0]<l[0]?-1:1))}var Ne={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function nt(e,t){var o;function i(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(i(t)){if(n=T(T({},Ne),t),n.progressFn&&i(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(JSON.stringify(n.progressFn,null,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new Error('ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(JSON.stringify(n.mergeType,null,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(n.joinRangesThatTouchEdges,null,4)))}else throw new Error("ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(t,null,4)," (type ").concat(typeof t,")"));else n=T({},Ne);let g=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),r,c,u;n.progressFn?r=V(g,{progressFn:a=>{u=Math.floor(a/5),u!==c&&(c=u,n.progressFn!=null&&n.progressFn(u))}}):r=V(g);let l=r.length-1;for(let a=l;a>0;a--)n.progressFn&&(u=Math.floor((1-a/l)*78)+21,u!==c&&u>c&&(c=u,n.progressFn(u))),(r[a][0]<=r[a-1][0]||!n.joinRangesThatTouchEdges&&r[a][0]<r[a-1][1]||n.joinRangesThatTouchEdges&&r[a][0]<=r[a-1][1])&&(r[a-1][0]=Math.min(r[a][0],r[a-1][0]),r[a-1][1]=Math.max(r[a][1],r[a-1][1]),r[a][2]!==void 0&&(r[a-1][0]>=r[a][0]||r[a-1][1]<=r[a][1])&&r[a-1][2]!==null&&(r[a][2]===null&&r[a-1][2]!==null?r[a-1][2]=null:r[a-1][2]!=null?+((o=n||{})==null?void 0:o.mergeType)==2&&r[a-1][0]===r[a][0]?r[a-1][2]=r[a][2]:r[a-1][2]+=r[a][2]:r[a-1][2]=r[a][2]),r.splice(a,1),a=r.length);return r.length?r:null}var st={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},De=class{constructor(e){Q(this,"ranges");Q(this,"opts");let t=T(T({},st),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(D(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(D(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error('ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof t.mergeType,'", equal to ').concat(JSON.stringify(t.mergeType,null,4)));this.opts=t,this.ranges=[]}add(e,t,i){var r;if(e==null&&t==null)return;if(R(e)&&!R(t)){if(Array.isArray(e)){if(e.length){if(e.some(c=>Array.isArray(c))){e.forEach(c=>{Array.isArray(c)&&this.add(...c)});return}e.length&&C(+e[0])&&C(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set ('.concat(JSON.stringify(e,null,0),') but second-one, "to" is not (').concat(JSON.stringify(t,null,0),")"))}else if(!R(e)&&R(t))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set ('.concat(JSON.stringify(t,null,0),') but first-one, "from" is not (').concat(JSON.stringify(e,null,0),")"));let n=+e,g=+t;if(C(i)&&(i=String(i)),C(n)&&C(g)){if(R(i)&&!D(i)&&!C(i))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ".concat(typeof i,", equal to:\n").concat(JSON.stringify(i,null,4)));if(R(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=g,this.last()[2],this.last()[2]!==null&&R(i)){let c=this.last()[2]&&this.last()[2].length&&(!((r=this.opts)!=null&&r.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(i):i;this.opts.limitToBeAddedWhitespace&&(c=k(c,this.opts.limitLinebreaksCount)),D(c)&&!c.length||(this.last()[2]=c)}}else{this.ranges||(this.ranges=[]);let c=i!==void 0&&!(D(i)&&!i.length)?[n,g,i&&this.opts.limitToBeAddedWhitespace?k(i,this.opts.limitLinebreaksCount):i]:[n,g];this.ranges.push(c)}}else throw C(n)&&n>=0?new TypeError('ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof g,'" equal to: ').concat(JSON.stringify(g,null,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof n,'" equal to: ').concat(JSON.stringify(n,null,4)))}push(e,t,i){this.add(e,t,i)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=nt(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>R(e[2])?[e[0],e[1],k(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&C(e[0][0]))this.ranges=Array.from(e);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ".concat(JSON.stringify(e[0],null,4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var Oe={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function We(e,t){function i(o){return!!o&&typeof o=="object"&&!Array.isArray(o)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(i(t)){if(n=T(T({},Oe),t),n.progressFn&&i(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(JSON.stringify(n.progressFn,null,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new Error('ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(JSON.stringify(n.mergeType,null,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(n.joinRangesThatTouchEdges,null,4)))}else throw new Error("emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(t,null,4)," (type ").concat(typeof t,")"));else n=T({},Oe);let g=e.filter(o=>Array.isArray(o)).map(o=>[...o]).filter(o=>o[2]!==void 0||o[0]!==o[1]),r,c,u;n.progressFn?r=V(g,{progressFn:o=>{u=Math.floor(o/5),u!==c&&(c=u,n.progressFn(u))}}):r=V(g);let l=r.length-1;for(let o=l;o>0;o--)n.progressFn&&(u=Math.floor((1-o/l)*78)+21,u!==c&&u>c&&(c=u,n.progressFn(u))),(r[o][0]<=r[o-1][0]||!n.joinRangesThatTouchEdges&&r[o][0]<r[o-1][1]||n.joinRangesThatTouchEdges&&r[o][0]<=r[o-1][1])&&(r[o-1][0]=Math.min(r[o][0],r[o-1][0]),r[o-1][1]=Math.max(r[o][1],r[o-1][1]),r[o][2]!==void 0&&(r[o-1][0]>=r[o][0]||r[o-1][1]<=r[o][1])&&r[o-1][2]!==null&&(r[o][2]===null&&r[o-1][2]!==null?r[o-1][2]=null:r[o-1][2]!=null?+n.mergeType==2&&r[o-1][0]===r[o][0]?r[o-1][2]=r[o][2]:r[o-1][2]+=r[o][2]:r[o-1][2]=r[o][2]),r.splice(o,1),o=r.length);return r.length?r:null}var ot=!0,K="Invariant failed";function Ce(e,t){if(!e){if(ot)throw new Error(K);var i=typeof t=="function"?t():t,n=i?"".concat(K,": ").concat(i):K;throw new Error(n)}}function Z(e,t,i){let n=0,g=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(t&&!Array.isArray(t))throw new TypeError("ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(JSON.stringify(t,null,4)));if(i&&typeof i!="function")throw new TypeError("ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ".concat(typeof i,", equal to: ").concat(JSON.stringify(i,null,4)));if(!(t!=null&&t.filter(a=>a).length))return e;let r;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?r=[Array.from(t)]:r=Array.from(t);let c=r.length,u=0;r.filter(a=>a).forEach((a,d)=>{if(i&&(n=Math.floor(u/c*10),n!==g&&(g=n,i(n))),!Array.isArray(a))throw new TypeError("ranges-apply: [THROW_ID_05] ranges array, second input arg., has ".concat(d,"th element not an array: ").concat(JSON.stringify(a,null,4),", which is ").concat(typeof a));if(!Number.isInteger(a[0])){if(!Number.isInteger(+a[0])||+a[0]<0)throw new TypeError("ranges-apply: [THROW_ID_06] ranges array, second input arg. has ".concat(d,"th element, array ").concat(JSON.stringify(a,null,0),". Its first element is not an integer, string index, but ").concat(typeof a[0],", equal to: ").concat(JSON.stringify(a[0],null,4),"."));r[d][0]=+r[d][0]}if(!Number.isInteger(a[1])){if(!Number.isInteger(+a[1])||+a[1]<0)throw new TypeError("ranges-apply: [THROW_ID_07] ranges array, second input arg. has ".concat(d,"th element, array ").concat(JSON.stringify(a,null,0),". Its second element is not an integer, string index, but ").concat(typeof a[1],", equal to: ").concat(JSON.stringify(a[1],null,4),"."));r[d][1]=+r[d][1]}u+=1});let l=We(r,{progressFn:a=>{i&&(n=10+Math.floor(a/10),n!==g&&(g=n,i(n)))}});Ce(l);let o=l.length;if(o>0){let a=e.slice(l[o-1][1]);e=l.reduce((d,p,h,m)=>{i&&(n=20+Math.floor(h/o*80),n!==g&&(g=n,i(n)));let y=h===0?0:m[h-1][1],v=m[h][0];return"".concat(d).concat(e.slice(y,v)).concat(m[h][2]||"")},""),e+=a}return e}var Re="4.0.36";var P=" ",B="\\00A0",J="\\u00A0",Me="–",xe="\\2013",Ie="\\u2013",Le="—",je="\\2014",Ve="\\u2014",z=[{heads:"{{",tails:"}}"},{heads:["{% if","{%- if"],tails:["{% endif","{%- endif"]},{heads:["{% for","{%- for"],tails:["{% endfor","{%- endfor"]},{heads:["{%","{%-"],tails:["%}","-%}"]},{heads:"{#",tails:"#}"}],Fe=[{heads:"{{",tails:"}}"}],Y=[{heads:["<%","<%=","<%-"],tails:["%>","=%>","-%>"]}],He=["abbr","address","area","article","aside","audio","base","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","param","picture","pre","progress","rb","rp","rt","rtc","ruby","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","ul","var","video","wbr","xml"];var at=Re,_e={removeWidowPreventionMeasures:!1,convertEntities:!0,targetLanguage:"html",UKPostcodes:!1,hyphens:!0,minWordCount:4,minCharCount:5,ignore:[],reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,tagRanges:[]};function lt(e,t){var ee,te,re,ne,se,oe,ie,ae,le,ue;let i=Date.now();if(typeof e!="string")throw e===void 0?new Error("string-remove-widows: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('string-remove-widows: [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(JSON.stringify(e,null,4)));if(t&&typeof t!="object")throw new Error("string-remove-widows: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof t,", equal to ").concat(JSON.stringify(t,null,4)));let n=Array.isArray,g=e.length,r=new De({mergeType:2}),c=["."],u=/[A-Z]{1,2}[0-9][0-9A-Z]?$/,l=/^[0-9][A-Z]{2}/,o=.06,a,d=0,p=0,h=0,m,y,v,E,A,w,$,O,f=T(T({},_e),t),S={removeWidows:!1,convertEntities:!1};if(!f.ignore||!n(f.ignore)&&typeof f.ignore!="string")f.ignore=[];else if(typeof f.ignore=="string"&&(f.ignore=[f.ignore]),f.ignore.includes("all"))f.ignore=f.ignore.concat(z.concat(Y));else if(f.ignore.some(s=>typeof s=="string")){let s=[];f.ignore=f.ignore.filter(N=>typeof N=="string"&&N.length?(["nunjucks","jinja","liquid"].includes(N.trim().toLowerCase())?s=s.concat(z):["hugo"].includes(N.trim().toLowerCase())?s=s.concat(Fe):["hexo"].includes(N.trim().toLowerCase())&&(s=s.concat(Y)),!1):typeof N=="object"),s.length&&(f.ignore=f.ignore.concat(s))}let M;f.reportProgressFunc&&(M=Math.floor(f.reportProgressFuncTo-(f.reportProgressFuncTo-f.reportProgressFuncFrom)*o-f.reportProgressFuncFrom));function U(s,N){let b=I;f.removeWidowPreventionMeasures?b=" ":f.convertEntities&&(b=P,typeof f.targetLanguage=="string"&&(f.targetLanguage.trim().toLowerCase()==="css"?b=B:f.targetLanguage.trim().toLowerCase()==="js"&&(b=J))),e.slice(s,N)!==b&&r.push(s,N,b)}function X(){p=0,h=0,m=void 0,y=void 0,v=void 0,E=void 0,A=void 0,w=void 0}X();for(let s=0;s<=g;s++){if(!$&&n(f.ignore)&&f.ignore.length&&f.ignore.some((b,W)=>{if(n(b.heads)&&b.heads.some(ce=>e.startsWith(ce,s))||typeof b.heads=="string"&&e.startsWith(b.heads,s))return p+=1,$=f.ignore[W].tails,!0}),!$&&O&&O===s&&(p+=1,O=void 0),typeof f.reportProgressFunc=="function"&&(a=f.reportProgressFuncFrom+Math.floor(s/g*(M||1)),a!==d&&(d=a,f.reportProgressFunc(a))),!$&&s&&((ee=e[s])!=null&&ee.trim())&&(!e[s-1]||e[s-1]&&!e[s-1].trim())&&(E=s),!$&&((te=e[s])!=null&&te.trim())&&(h+=1),!$&&f.hyphens&&("-".concat(Ee).concat(we).includes(e[s])||e.startsWith(Me,s)||e.startsWith(xe,s)||e.startsWith(Ie,s)||e.startsWith(Le,s)||e.startsWith(je,s)||e.startsWith(Ve,s))&&e[s+1]&&(!e[s+1].trim()||e[s]==="&")&&e[s-1]&&!e[s-1].trim()&&e[_(e,s)]&&(U(_(e,s)+1,s),S.removeWidows=!0),!$&&(e.startsWith(" ",s)||e.startsWith(" ",s))&&(A=s,w=s+6,(re=e[s+6])!=null&&re.trim()&&(O=s+6),f.convertEntities?(f.targetLanguage==="css"||f.targetLanguage==="js")&&(r.push(s,s+6,f.targetLanguage==="css"?B:J),S.convertEntities=!0):(r.push(s,s+6,I),S.convertEntities=!0)),!$&&e[s+4]&&e[s]==="\\"&&e[s+1]==="0"&&e[s+2]==="0"&&e[s+3].toUpperCase()==="A"&&e[s+4]==="0"&&(A=s,w=s+5,(ne=e[s+5])!=null&&ne.trim()&&(O=s+5),f.convertEntities?(f.targetLanguage==="html"||f.targetLanguage==="js")&&(r.push(s,s+5,f.targetLanguage==="html"?P:J),S.convertEntities=!0):(r.push(s,s+5,I),S.convertEntities=!0)),!$&&e[s]==="\\"&&e[s+1]&&e[s+1].toLowerCase()==="u"&&e[s+2]==="0"&&e[s+3]==="0"&&e[s+4]&&e[s+4].toUpperCase()==="A"&&e[s+5]==="0"&&(A=s,w=s+6,(se=e[s+6])!=null&&se.trim()&&(O=s+6),f.convertEntities?(f.targetLanguage==="html"||f.targetLanguage==="css")&&r.push(s,s+6,f.targetLanguage==="html"?P:B):r.push(s,s+6,I)),!$&&e[s]===I&&(A=s,w=s+1,f.convertEntities&&r.push(s,s+1,f.targetLanguage==="css"?B:f.targetLanguage==="js"?J:P)),!$&&((oe=e[s])!=null&&oe.trim())&&!((ie=e[s-1])!=null&&ie.trim())&&(p+=1),!$&&(!e[s]||"\r\n".includes(e[s])||(e[s]==="\n"||e[s]==="\r"||e[s]==="\r"&&e[s+1]==="\n")&&_(e,s)&&c.includes(e[_(e,s)]))){if((!f.minWordCount||p>=f.minWordCount)&&(!f.minCharCount||h>=f.minCharCount)){let b,W;v!==void 0&&E!==void 0&&A!==void 0&&w!==void 0?v>A?(b=v,W=E):(b=A,W=w):v!==void 0&&E!==void 0?(b=v,W=E):A!==void 0&&w!==void 0&&(b=A,W=w),!(b&&W)&&m&&y&&(b=m,W=y),b&&W&&(U(b,W),S.removeWidows=!0)}X()}f.UKPostcodes&&e[s]&&!e[s].trim()&&((ae=e[s-1])!=null&&ae.trim())&&u.test(e.slice(0,s))&&e[j(e,s)]&&l.test(e.slice(j(e,s)))&&(U(s,j(e,s)),S.removeWidows=!0),!$&&e[s]&&!e[s].trim()&&((le=e[s-1])!=null&&le.trim())&&(v===void 0||(ue=e[v-1])!=null&&ue.trim())&&!"/>".includes(e[j(e,s)])&&!e.slice(0,s).trim().endsWith("br")&&!e.slice(0,s).trim().endsWith("hr")&&!(e.slice(0,s).endsWith("<")&&He.some(b=>e.startsWith(b,j(e,s))))&&(m=v,y=E,v=s,E=void 0,(A!==void 0||w!==void 0)&&(A=void 0,w=void 0));let N;$&&(typeof $=="string"&&(!$.length||e.startsWith($,s))?$=void 0:n($)&&(!$.length||$.some(b=>{if(e.startsWith(b,s))return N=b,!0}))&&($=void 0,s+=N.length,n(f.ignore)&&f.ignore.length&&e[s+1]&&f.ignore.some(b=>ve(e,s,b.tails,{trimBeforeMatching:!0,cb:(W,ce,ge)=>{var fe;return ge&&(s=ge-1,(fe=e[s+1])!=null&&fe.trim()&&(p+=1)),!0}})))),e[s]&&"\r\n".includes(e[s])&&(p=0,h=0),n(f.tagRanges)&&f.tagRanges.length&&f.tagRanges.some(b=>{if(s>=b[0]&&s<=b[1]&&b[1]-1>s)return s=b[1]-1,!0})}return Z(e,r.current()).split("").forEach((s,N)=>{}),{res:Z(e,r.current(),f.reportProgressFunc?s=>{a=Math.floor((f.reportProgressFuncTo-f.reportProgressFuncFrom)*(1-o)+s/100*(f.reportProgressFuncTo-f.reportProgressFuncFrom)*o),a!==d&&(d=a,f.reportProgressFunc(a))}:void 0),ranges:r.current(),log:{timeTakenInMilliseconds:Date.now()-i},whatWasDone:S}}return Ge(ut);})();
|
|
10
|
+
"use strict";var stringRemoveWidows=(()=>{var Be=Object.create;var F=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,Ue=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var q=(e,t,i)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,T=(e,t)=>{for(var i in t||(t={}))me.call(t,i)&&q(e,i,t[i]);if(de)for(var i of de(t))qe.call(t,i)&&q(e,i,t[i]);return e};var Qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ge=(e,t)=>{for(var i in t)F(e,i,{get:t[i],enumerable:!0})},he=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let g of ke(t))!me.call(e,g)&&g!==i&&F(e,g,{get:()=>t[g],enumerable:!(n=Je(t,g))||n.enumerable});return e};var pe=(e,t,i)=>(i=e!=null?Be(Ue(e)):{},he(t||!e||!e.__esModule?F(i,"default",{value:e,enumerable:!0}):i,e)),Ke=e=>he(F({},"__esModule",{value:!0}),e);var Q=(e,t,i)=>q(e,typeof t!="symbol"?t+"":t,i);var G=Qe((dt,be)=>{"use strict";be.exports=Ze;function x(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function Ze(e){if(e=e||{},e.circles)return ze(e);let t=new Map;if(t.set(Date,c=>new Date(c)),t.set(Map,(c,u)=>new Map(n(Array.from(c),u))),t.set(Set,(c,u)=>new Set(n(Array.from(c),u))),e.constructorHandlers)for(let c of e.constructorHandlers)t.set(c[0],c[1]);let i=null;return e.proto?r:g;function n(c,u){let l=Object.keys(c),o=new Array(l.length);for(let a=0;a<l.length;a++){let d=l[a],p=c[d];typeof p!="object"||p===null?o[d]=p:p.constructor!==Object&&(i=t.get(p.constructor))?o[d]=i(p,u):ArrayBuffer.isView(p)?o[d]=x(p):o[d]=u(p)}return o}function g(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return n(c,g);if(c.constructor!==Object&&(i=t.get(c.constructor)))return i(c,g);let u={};for(let l in c){if(Object.hasOwnProperty.call(c,l)===!1)continue;let o=c[l];typeof o!="object"||o===null?u[l]=o:o.constructor!==Object&&(i=t.get(o.constructor))?u[l]=i(o,g):ArrayBuffer.isView(o)?u[l]=x(o):u[l]=g(o)}return u}function r(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return n(c,r);if(c.constructor!==Object&&(i=t.get(c.constructor)))return i(c,r);let u={};for(let l in c){let o=c[l];typeof o!="object"||o===null?u[l]=o:o.constructor!==Object&&(i=t.get(o.constructor))?u[l]=i(o,r):ArrayBuffer.isView(o)?u[l]=x(o):u[l]=r(o)}return u}}function ze(e){let t=[],i=[],n=new Map;if(n.set(Date,l=>new Date(l)),n.set(Map,(l,o)=>new Map(r(Array.from(l),o))),n.set(Set,(l,o)=>new Set(r(Array.from(l),o))),e.constructorHandlers)for(let l of e.constructorHandlers)n.set(l[0],l[1]);let g=null;return e.proto?u:c;function r(l,o){let a=Object.keys(l),d=new Array(a.length);for(let p=0;p<a.length;p++){let h=a[p],m=l[h];if(typeof m!="object"||m===null)d[h]=m;else if(m.constructor!==Object&&(g=n.get(m.constructor)))d[h]=g(m,o);else if(ArrayBuffer.isView(m))d[h]=x(m);else{let y=t.indexOf(m);y!==-1?d[h]=i[y]:d[h]=o(m)}}return d}function c(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return r(l,c);if(l.constructor!==Object&&(g=n.get(l.constructor)))return g(l,c);let o={};t.push(l),i.push(o);for(let a in l){if(Object.hasOwnProperty.call(l,a)===!1)continue;let d=l[a];if(typeof d!="object"||d===null)o[a]=d;else if(d.constructor!==Object&&(g=n.get(d.constructor)))o[a]=g(d,c);else if(ArrayBuffer.isView(d))o[a]=x(d);else{let p=t.indexOf(d);p!==-1?o[a]=i[p]:o[a]=c(d)}}return t.pop(),i.pop(),o}function u(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return r(l,u);if(l.constructor!==Object&&(g=n.get(l.constructor)))return g(l,u);let o={};t.push(l),i.push(o);for(let a in l){let d=l[a];if(typeof d!="object"||d===null)o[a]=d;else if(d.constructor!==Object&&(g=n.get(d.constructor)))o[a]=g(d,u);else if(ArrayBuffer.isView(d))o[a]=x(d);else{let p=t.indexOf(d);p!==-1?o[a]=i[p]:o[a]=u(d)}}return t.pop(),i.pop(),o}}});var ct={};Ge(ct,{defaults:()=>Pe,removeWidows:()=>ut,version:()=>lt});function $e(e){return typeof e!="string"?e:e.length?[e]:[]}var ye=pe(G(),1);var mt=(0,ye.default)();var we="\u2013",Ee="\u2014",I="\xA0";function H(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function D(e){return typeof e=="string"}function Ae(e){return Number.isFinite(e)}function R(e){return Number.isSafeInteger(e)&&e>=0}function C(e){return e!=null}function Te(e,t){return H(e)&&D(t)&&t in e}var ve={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},Ye=e=>e+1;function Xe(e,t,i,n,g=!1,r=Ye){var w;let c=typeof i=="function"?i():i;if(+t<0&&g&&c==="EOL")return c;let u=T(T({},ve),n);if(t>=e.length&&!g)return!1;let l=g?1:i.length,o=0,a=!1,d=!1,p=!1,h=u.maxMismatches,m=t,y=!1,v=!1,E=!1;function A(){return o===1&&h<u.maxMismatches-1}for(;e[m];){let $=r(m);if(u.trimBeforeMatching&&e[m].trim()===""){if(!e[$]&&g&&i==="EOL")return!0;m=r(m);continue}if(u&&!u.i&&((w=u==null?void 0:u.trimCharsBeforeMatching)!=null&&w.includes(e[m]))||u!=null&&u.i&&u.trimCharsBeforeMatching&&u.trimCharsBeforeMatching.map(f=>f.toLowerCase()).includes(e[m].toLowerCase())){if(g&&i==="EOL"&&!e[$])return!0;m=r(m);continue}let O=$>m?i[i.length-l]:i[l-1];if(!u.i&&e[m]===O||u.i&&e[m].toLowerCase()===O.toLowerCase()){if(y||(y=!0),p||(p=!0),l===i.length){if(v=!0,h!==u.maxMismatches)return!1}else l===1&&(E=!0);if(l-=1,o++,A())return!1;if(!l)return o!==i.length||h===u.maxMismatches||!a?m:!1}else if(!a&&!o&&(a=!0),u.maxMismatches&&h&&m){h-=1;for(let f=0;f<=h;f++){let S=$>m?i[i.length-l+1+f]:i[l-2-f],M=e[r(m)];if(S&&(!u.i&&e[m]===S||u.i&&e[m].toLowerCase()===S.toLowerCase())&&(!u.firstMustMatch||l!==i.length)){if(o++,A())return!1;l-=2,y=!0;break}else if(M&&S&&(!u.i&&M===S||u.i&&M.toLowerCase()===S.toLowerCase())&&(!u.firstMustMatch||l!==i.length)){if(!o&&!u.hungry)return!1;l-=1,y=!0;break}else if(S===void 0&&h>=0&&y&&(!u.firstMustMatch||v)&&(!u.lastMustMatch||E))return m}y||(d=m)}else return m===0&&l===1&&!u.lastMustMatch&&p?0:!1;if(d!==!1&&d!==m&&(d=!1),l<1)return m;m=r(m)}if(l>0)return g&&c==="EOL"?!0:u&&u.maxMismatches>=l&&p?d||0:!1}function et(e,t,i,n,g){var a,d,p;if(H(g)&&Te(g,"trimBeforeMatching")&&g&&typeof g.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(g.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let r=T(T({},ve),g);if(typeof r.trimCharsBeforeMatching=="string"&&(r.trimCharsBeforeMatching=$e(r.trimCharsBeforeMatching)),r.trimCharsBeforeMatching=r.trimCharsBeforeMatching.map(h=>D(h)?h:String(h)),!D(t)||!t.length)return!1;if(!Number.isInteger(i)||i<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ").concat(typeof i,", equal to:\n").concat(JSON.stringify(i,null,4)));let c,u;if(D(n))c=[n];else if(Array.isArray(n))c=n;else if(!n)c=n;else if(typeof n=="function")c=[],c.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));if(g&&!H(g))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof g,'", and equal to:\n').concat(JSON.stringify(g,null,4)));let l=0,o="";if((a=r==null?void 0:r.trimCharsBeforeMatching)!=null&&a.some((h,m)=>h.length>1?(l=m,o=h,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(l," is longer than 1 character, ").concat(o.length," (equals to ").concat(o,"). Please split it into separate characters and put into array as separate elements."));if(!c||!Array.isArray(c)||Array.isArray(c)&&!c.length||Array.isArray(c)&&c.length===1&&D(c[0])&&!c[0].trim()){if(typeof r.cb=="function"){let m,y=i;if((e==="matchLeftIncl"||e==="matchRight")&&(y+=1),e[5]==="L")for(let w=y;w--;){let $=t[w];if((!r.trimBeforeMatching||r.trimBeforeMatching&&($!=null&&$.trim()))&&(!((d=r.trimCharsBeforeMatching)!=null&&d.length)||$!==void 0&&!r.trimCharsBeforeMatching.includes($))){m=w;break}}else if(e.startsWith("matchRight"))for(let w=y;w<t.length;w++){let $=t[w];if((!r.trimBeforeMatching||r.trimBeforeMatching&&$.trim())&&(!((p=r.trimCharsBeforeMatching)!=null&&p.length)||!r.trimCharsBeforeMatching.includes($))){m=w;break}}if(m===void 0)return!1;let v=t[m],E=m+1,A="";return E&&E>0&&(A=t.slice(0,E)),e[5]==="L"||m&&m>0&&(A=t.slice(m)),r.cb(v,A,m)}let h="";throw g||(h=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(h))}for(let h=0,m=c.length;h<m;h++){u=typeof c[h]=="function";let y=c[h],v,E,A="",w=i;e==="matchRight"?w+=1:e==="matchLeft"&&(w-=1);let $=Xe(t,w,y,r,u,O=>e[5]==="L"?O-1:O+1);if($&&u&&typeof y=="function"&&y()==="EOL")return y()&&(!r.cb||r.cb(v,A,E))?y():!1;if(Number.isInteger($)&&(E=e.startsWith("matchLeft")?$-1:$+1,e[5]==="L"?A=t.slice(0,$):A=t.slice(E)),E<0&&(E=void 0),t[E]&&(v=t[E]),Number.isInteger($)&&(!r.cb||r.cb(v,A,E)))return y}return!1}function Se(e,t,i,n){return et("matchRightIncl",e,t,i,n)}var Ne=pe(G(),1);var Et=(0,Ne.default)();var L="\xA0";function tt({str:e,idx:t=0,stopAtNewlines:i=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),!e[t+1]))return null;if(e[t+1]&&(e[t+1].trim()||i&&"\n\r".includes(e[t+1])||n&&e[t+1]===L))return t+1;if(e[t+2]&&(e[t+2].trim()||i&&"\n\r".includes(e[t+2])||n&&e[t+2]===L))return t+2;for(let g=t+1,r=e.length;g<r;g++)if(e[g].trim()||i&&"\n\r".includes(e[g])||n&&e[g]===L)return g;return null}function j(e,t=0){return tt({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function rt({str:e,idx:t,stopAtNewlines:i,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||i&&"\n\r".includes(e[~-t])||n&&e[~-t]===L))return~-t;if(e[t-2]&&(e[t-2].trim()||i&&"\n\r".includes(e[t-2])||n&&e[t-2]===L))return t-2;for(let g=t;g--;)if(e[g]&&(e[g].trim()||i&&"\n\r".includes(e[g])||n&&e[g]===L))return g;return null}function _(e,t=0){return rt({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function k(e,t=1){let i="\xA0";function n(r){return Array.from(r).reverse().join("")}function g(r,c,u){let l=u?"\n":"\r",o=u?"\r":"\n";if(!r)return r;let a=0,d=0,p="";for(let h=0,m=r.length;h<m;h++)(r[h]===l||r[h]===o&&r[h-1]!==l)&&d++,"\r\n".includes(r[h])||r[h]===i?(a=0,r[h]===i?p+=r[h]:r[h]===l?d<=c&&(p+=r[h],r[h+1]===o&&(p+=r[h+1],h++)):r[h]===o&&(r==null?void 0:r[h-1])!==l&&d<=c&&(p+=r[h])):(a++,!r[h+1]&&!d&&(p+=" "));return p}if(typeof e=="string"&&e.length){let r=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(r=+t);let c="",u="";if(!e.trim())c=e;else if(!e[0].trim()){for(let l=0,o=e.length;l<o;l++)if(e[l].trim()){c=e.slice(0,l);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===i)){for(let l=e.length;l--;)if(e[l].trim()){u=e.slice(l+1);break}}return"".concat(g(c,r,!1)).concat(e.trim()).concat(n(g(n(u),r,!0)))}return e}var nt={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function V(e,t){if(!Array.isArray(e)||!e.length)return e;let i=T(T({},nt),t),n,g;if(i.strictlyTwoElementsInRangeArrays&&!e.every((u,l)=>!Array.isArray(u)||u.length!==2?(n=l,g=u.length,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(n,"th range (").concat(JSON.stringify(e[n],null,4),") has not two but ").concat(g," elements!"));if(!e.every((u,l)=>!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0?(n=l,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(n,"th range (").concat(JSON.stringify(e[n],null,4),") does not consist of only natural numbers!"));let r=e.length**2,c=0;return Array.from(e).sort((u,l)=>(i.progressFn&&(c+=1,i.progressFn(Math.floor(c*100/r))),u[0]===l[0]?u[1]<l[1]?-1:u[1]>l[1]?1:0:u[0]<l[0]?-1:1))}var De={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function st(e,t){var o;function i(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(i(t)){if(n=T(T({},De),t),n.progressFn&&i(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(JSON.stringify(n.progressFn,null,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new Error('ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(JSON.stringify(n.mergeType,null,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(n.joinRangesThatTouchEdges,null,4)))}else throw new Error("ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(t,null,4)," (type ").concat(typeof t,")"));else n=T({},De);let g=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),r,c,u;n.progressFn?r=V(g,{progressFn:a=>{u=Math.floor(a/5),u!==c&&(c=u,n.progressFn!=null&&n.progressFn(u))}}):r=V(g);let l=r.length-1;for(let a=l;a>0;a--)n.progressFn&&(u=Math.floor((1-a/l)*78)+21,u!==c&&u>c&&(c=u,n.progressFn(u))),(r[a][0]<=r[a-1][0]||!n.joinRangesThatTouchEdges&&r[a][0]<r[a-1][1]||n.joinRangesThatTouchEdges&&r[a][0]<=r[a-1][1])&&(r[a-1][0]=Math.min(r[a][0],r[a-1][0]),r[a-1][1]=Math.max(r[a][1],r[a-1][1]),r[a][2]!==void 0&&(r[a-1][0]>=r[a][0]||r[a-1][1]<=r[a][1])&&r[a-1][2]!==null&&(r[a][2]===null&&r[a-1][2]!==null?r[a-1][2]=null:r[a-1][2]!=null?+((o=n||{})==null?void 0:o.mergeType)==2&&r[a-1][0]===r[a][0]?r[a-1][2]=r[a][2]:r[a-1][2]+=r[a][2]:r[a-1][2]=r[a][2]),r.splice(a,1),a=r.length);return r.length?r:null}var ot={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Oe=class{constructor(e){Q(this,"ranges");Q(this,"opts");let t=T(T({},ot),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(D(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(D(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error('ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof t.mergeType,'", equal to ').concat(JSON.stringify(t.mergeType,null,4)));this.opts=t,this.ranges=[]}add(e,t,i){var r;if(e==null&&t==null)return;if(C(e)&&!C(t)){if(Array.isArray(e)){if(e.length){if(e.some(c=>Array.isArray(c))){e.forEach(c=>{Array.isArray(c)&&this.add(...c)});return}e.length&&R(+e[0])&&R(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set ('.concat(JSON.stringify(e,null,0),') but second-one, "to" is not (').concat(JSON.stringify(t,null,0),")"))}else if(!C(e)&&C(t))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set ('.concat(JSON.stringify(t,null,0),') but first-one, "from" is not (').concat(JSON.stringify(e,null,0),")"));let n=+e,g=+t;if(R(n)&&R(g)){if(C(i)&&!D(i)&&!Ae(i))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ".concat(typeof i,", equal to:\n").concat(JSON.stringify(i,null,4)));if(C(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=g,this.last()[2],this.last()[2]!==null&&C(i)){let c=this.last()[2]&&this.last()[2].length&&(!((r=this.opts)!=null&&r.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(i):i;this.opts.limitToBeAddedWhitespace&&(c=k(c,this.opts.limitLinebreaksCount)),D(c)&&!c.length||(this.last()[2]=c)}}else{this.ranges||(this.ranges=[]);let c=i!==void 0&&!(D(i)&&!i.length)?[n,g,i&&this.opts.limitToBeAddedWhitespace?k(i,this.opts.limitLinebreaksCount):i]:[n,g];this.ranges.push(c)}}else throw R(n)&&n>=0?new TypeError('ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof g,'" equal to: ').concat(JSON.stringify(g,null,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof n,'" equal to: ').concat(JSON.stringify(n,null,4)))}push(e,t,i){this.add(e,t,i)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=st(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>C(e[2])?[e[0],e[1],k(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&R(e[0][0]))this.ranges=Array.from(e);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ".concat(JSON.stringify(e[0],null,4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var We={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ce(e,t){function i(o){return!!o&&typeof o=="object"&&!Array.isArray(o)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(i(t)){if(n=T(T({},We),t),n.progressFn&&i(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(JSON.stringify(n.progressFn,null,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new Error('ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(JSON.stringify(n.mergeType,null,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(n.joinRangesThatTouchEdges,null,4)))}else throw new Error("emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(t,null,4)," (type ").concat(typeof t,")"));else n=T({},We);let g=e.filter(o=>Array.isArray(o)).map(o=>[...o]).filter(o=>o[2]!==void 0||o[0]!==o[1]),r,c,u;n.progressFn?r=V(g,{progressFn:o=>{u=Math.floor(o/5),u!==c&&(c=u,n.progressFn(u))}}):r=V(g);let l=r.length-1;for(let o=l;o>0;o--)n.progressFn&&(u=Math.floor((1-o/l)*78)+21,u!==c&&u>c&&(c=u,n.progressFn(u))),(r[o][0]<=r[o-1][0]||!n.joinRangesThatTouchEdges&&r[o][0]<r[o-1][1]||n.joinRangesThatTouchEdges&&r[o][0]<=r[o-1][1])&&(r[o-1][0]=Math.min(r[o][0],r[o-1][0]),r[o-1][1]=Math.max(r[o][1],r[o-1][1]),r[o][2]!==void 0&&(r[o-1][0]>=r[o][0]||r[o-1][1]<=r[o][1])&&r[o-1][2]!==null&&(r[o][2]===null&&r[o-1][2]!==null?r[o-1][2]=null:r[o-1][2]!=null?+n.mergeType==2&&r[o-1][0]===r[o][0]?r[o-1][2]=r[o][2]:r[o-1][2]+=r[o][2]:r[o-1][2]=r[o][2]),r.splice(o,1),o=r.length);return r.length?r:null}var it=!0,K="Invariant failed";function Re(e,t){if(!e){if(it)throw new Error(K);var i=typeof t=="function"?t():t,n=i?"".concat(K,": ").concat(i):K;throw new Error(n)}}function Z(e,t,i){let n=0,g=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(t&&!Array.isArray(t))throw new TypeError("ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(JSON.stringify(t,null,4)));if(i&&typeof i!="function")throw new TypeError("ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ".concat(typeof i,", equal to: ").concat(JSON.stringify(i,null,4)));if(!(t!=null&&t.filter(a=>a).length))return e;let r;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?r=[Array.from(t)]:r=Array.from(t);let c=r.length,u=0;r.filter(a=>a).forEach((a,d)=>{if(i&&(n=Math.floor(u/c*10),n!==g&&(g=n,i(n))),!Array.isArray(a))throw new TypeError("ranges-apply: [THROW_ID_05] ranges array, second input arg., has ".concat(d,"th element not an array: ").concat(JSON.stringify(a,null,4),", which is ").concat(typeof a));if(!Number.isInteger(a[0])){if(!Number.isInteger(+a[0])||+a[0]<0)throw new TypeError("ranges-apply: [THROW_ID_06] ranges array, second input arg. has ".concat(d,"th element, array ").concat(JSON.stringify(a,null,0),". Its first element is not an integer, string index, but ").concat(typeof a[0],", equal to: ").concat(JSON.stringify(a[0],null,4),"."));r[d][0]=+r[d][0]}if(!Number.isInteger(a[1])){if(!Number.isInteger(+a[1])||+a[1]<0)throw new TypeError("ranges-apply: [THROW_ID_07] ranges array, second input arg. has ".concat(d,"th element, array ").concat(JSON.stringify(a,null,0),". Its second element is not an integer, string index, but ").concat(typeof a[1],", equal to: ").concat(JSON.stringify(a[1],null,4),"."));r[d][1]=+r[d][1]}u+=1});let l=Ce(r,{progressFn:a=>{i&&(n=10+Math.floor(a/10),n!==g&&(g=n,i(n)))}});Re(l);let o=l.length;if(o>0){let a=e.slice(l[o-1][1]);e=l.reduce((d,p,h,m)=>{i&&(n=20+Math.floor(h/o*80),n!==g&&(g=n,i(n)));let y=h===0?0:m[h-1][1],v=m[h][0];return"".concat(d).concat(e.slice(y,v)).concat(m[h][2]||"")},""),e+=a}return e}var Me="4.1.0";var P=" ",B="\\00A0",J="\\u00A0",xe="–",Ie="\\2013",Le="\\u2013",je="—",Ve="\\2014",Fe="\\u2014",z=[{heads:"{{",tails:"}}"},{heads:["{% if","{%- if"],tails:["{% endif","{%- endif"]},{heads:["{% for","{%- for"],tails:["{% endfor","{%- endfor"]},{heads:["{%","{%-"],tails:["%}","-%}"]},{heads:"{#",tails:"#}"}],He=[{heads:"{{",tails:"}}"}],Y=[{heads:["<%","<%=","<%-"],tails:["%>","=%>","-%>"]}],_e=["abbr","address","area","article","aside","audio","base","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","param","picture","pre","progress","rb","rp","rt","rtc","ruby","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","ul","var","video","wbr","xml"];var lt=Me,Pe={removeWidowPreventionMeasures:!1,convertEntities:!0,targetLanguage:"html",UKPostcodes:!1,hyphens:!0,minWordCount:4,minCharCount:5,ignore:[],reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,tagRanges:[]};function ut(e,t){var ee,te,re,ne,se,oe,ie,ae,le,ue;let i=Date.now();if(typeof e!="string")throw e===void 0?new Error("string-remove-widows: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('string-remove-widows: [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(JSON.stringify(e,null,4)));if(t&&typeof t!="object")throw new Error("string-remove-widows: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof t,", equal to ").concat(JSON.stringify(t,null,4)));let n=Array.isArray,g=e.length,r=new Oe({mergeType:2}),c=["."],u=/[A-Z]{1,2}[0-9][0-9A-Z]?$/,l=/^[0-9][A-Z]{2}/,o=.06,a,d=0,p=0,h=0,m,y,v,E,A,w,$,O,f=T(T({},Pe),t),S={removeWidows:!1,convertEntities:!1};if(!f.ignore||!n(f.ignore)&&typeof f.ignore!="string")f.ignore=[];else if(typeof f.ignore=="string"&&(f.ignore=[f.ignore]),f.ignore.includes("all"))f.ignore=f.ignore.concat(z.concat(Y));else if(f.ignore.some(s=>typeof s=="string")){let s=[];f.ignore=f.ignore.filter(N=>typeof N=="string"&&N.length?(["nunjucks","jinja","liquid"].includes(N.trim().toLowerCase())?s=s.concat(z):["hugo"].includes(N.trim().toLowerCase())?s=s.concat(He):["hexo"].includes(N.trim().toLowerCase())&&(s=s.concat(Y)),!1):typeof N=="object"),s.length&&(f.ignore=f.ignore.concat(s))}let M;f.reportProgressFunc&&(M=Math.floor(f.reportProgressFuncTo-(f.reportProgressFuncTo-f.reportProgressFuncFrom)*o-f.reportProgressFuncFrom));function U(s,N){let b=I;f.removeWidowPreventionMeasures?b=" ":f.convertEntities&&(b=P,typeof f.targetLanguage=="string"&&(f.targetLanguage.trim().toLowerCase()==="css"?b=B:f.targetLanguage.trim().toLowerCase()==="js"&&(b=J))),e.slice(s,N)!==b&&r.push(s,N,b)}function X(){p=0,h=0,m=void 0,y=void 0,v=void 0,E=void 0,A=void 0,w=void 0}X();for(let s=0;s<=g;s++){if(!$&&n(f.ignore)&&f.ignore.length&&f.ignore.some((b,W)=>{if(n(b.heads)&&b.heads.some(ce=>e.startsWith(ce,s))||typeof b.heads=="string"&&e.startsWith(b.heads,s))return p+=1,$=f.ignore[W].tails,!0}),!$&&O&&O===s&&(p+=1,O=void 0),typeof f.reportProgressFunc=="function"&&(a=f.reportProgressFuncFrom+Math.floor(s/g*(M||1)),a!==d&&(d=a,f.reportProgressFunc(a))),!$&&s&&((ee=e[s])!=null&&ee.trim())&&(!e[s-1]||e[s-1]&&!e[s-1].trim())&&(E=s),!$&&((te=e[s])!=null&&te.trim())&&(h+=1),!$&&f.hyphens&&("-".concat(Ee).concat(we).includes(e[s])||e.startsWith(xe,s)||e.startsWith(Ie,s)||e.startsWith(Le,s)||e.startsWith(je,s)||e.startsWith(Ve,s)||e.startsWith(Fe,s))&&e[s+1]&&(!e[s+1].trim()||e[s]==="&")&&e[s-1]&&!e[s-1].trim()&&e[_(e,s)]&&(U(_(e,s)+1,s),S.removeWidows=!0),!$&&(e.startsWith(" ",s)||e.startsWith(" ",s))&&(A=s,w=s+6,(re=e[s+6])!=null&&re.trim()&&(O=s+6),f.convertEntities?(f.targetLanguage==="css"||f.targetLanguage==="js")&&(r.push(s,s+6,f.targetLanguage==="css"?B:J),S.convertEntities=!0):(r.push(s,s+6,I),S.convertEntities=!0)),!$&&e[s+4]&&e[s]==="\\"&&e[s+1]==="0"&&e[s+2]==="0"&&e[s+3].toUpperCase()==="A"&&e[s+4]==="0"&&(A=s,w=s+5,(ne=e[s+5])!=null&&ne.trim()&&(O=s+5),f.convertEntities?(f.targetLanguage==="html"||f.targetLanguage==="js")&&(r.push(s,s+5,f.targetLanguage==="html"?P:J),S.convertEntities=!0):(r.push(s,s+5,I),S.convertEntities=!0)),!$&&e[s]==="\\"&&e[s+1]&&e[s+1].toLowerCase()==="u"&&e[s+2]==="0"&&e[s+3]==="0"&&e[s+4]&&e[s+4].toUpperCase()==="A"&&e[s+5]==="0"&&(A=s,w=s+6,(se=e[s+6])!=null&&se.trim()&&(O=s+6),f.convertEntities?(f.targetLanguage==="html"||f.targetLanguage==="css")&&r.push(s,s+6,f.targetLanguage==="html"?P:B):r.push(s,s+6,I)),!$&&e[s]===I&&(A=s,w=s+1,f.convertEntities&&r.push(s,s+1,f.targetLanguage==="css"?B:f.targetLanguage==="js"?J:P)),!$&&((oe=e[s])!=null&&oe.trim())&&!((ie=e[s-1])!=null&&ie.trim())&&(p+=1),!$&&(!e[s]||"\r\n".includes(e[s])||(e[s]==="\n"||e[s]==="\r"||e[s]==="\r"&&e[s+1]==="\n")&&_(e,s)&&c.includes(e[_(e,s)]))){if((!f.minWordCount||p>=f.minWordCount)&&(!f.minCharCount||h>=f.minCharCount)){let b,W;v!==void 0&&E!==void 0&&A!==void 0&&w!==void 0?v>A?(b=v,W=E):(b=A,W=w):v!==void 0&&E!==void 0?(b=v,W=E):A!==void 0&&w!==void 0&&(b=A,W=w),!(b&&W)&&m&&y&&(b=m,W=y),b&&W&&(U(b,W),S.removeWidows=!0)}X()}f.UKPostcodes&&e[s]&&!e[s].trim()&&((ae=e[s-1])!=null&&ae.trim())&&u.test(e.slice(0,s))&&e[j(e,s)]&&l.test(e.slice(j(e,s)))&&(U(s,j(e,s)),S.removeWidows=!0),!$&&e[s]&&!e[s].trim()&&((le=e[s-1])!=null&&le.trim())&&(v===void 0||(ue=e[v-1])!=null&&ue.trim())&&!"/>".includes(e[j(e,s)])&&!e.slice(0,s).trim().endsWith("br")&&!e.slice(0,s).trim().endsWith("hr")&&!(e.slice(0,s).endsWith("<")&&_e.some(b=>e.startsWith(b,j(e,s))))&&(m=v,y=E,v=s,E=void 0,(A!==void 0||w!==void 0)&&(A=void 0,w=void 0));let N;$&&(typeof $=="string"&&(!$.length||e.startsWith($,s))?$=void 0:n($)&&(!$.length||$.some(b=>{if(e.startsWith(b,s))return N=b,!0}))&&($=void 0,s+=N.length,n(f.ignore)&&f.ignore.length&&e[s+1]&&f.ignore.some(b=>Se(e,s,b.tails,{trimBeforeMatching:!0,cb:(W,ce,ge)=>{var fe;return ge&&(s=ge-1,(fe=e[s+1])!=null&&fe.trim()&&(p+=1)),!0}})))),e[s]&&"\r\n".includes(e[s])&&(p=0,h=0),n(f.tagRanges)&&f.tagRanges.length&&f.tagRanges.some(b=>{if(s>=b[0]&&s<=b[1]&&b[1]-1>s)return s=b[1]-1,!0})}return Z(e,r.current()).split("").forEach((s,N)=>{}),{res:Z(e,r.current(),f.reportProgressFunc?s=>{a=Math.floor((f.reportProgressFuncTo-f.reportProgressFuncFrom)*(1-o)+s/100*(f.reportProgressFuncTo-f.reportProgressFuncFrom)*o),a!==d&&(d=a,f.reportProgressFunc(a))}:void 0),ranges:r.current(),log:{timeTakenInMilliseconds:Date.now()-i},whatWasDone:S}}return Ke(ct);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name arrayiffy-if-string
|
|
13
13
|
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
|
|
14
|
-
* @version 5.0
|
|
15
|
-
* @author Roy Revelt
|
|
14
|
+
* @version 5.1.0
|
|
15
|
+
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/arrayiffy-if-string/}
|
|
18
18
|
*/
|
|
19
19
|
/**
|
|
20
20
|
* @name codsen-utils
|
|
21
21
|
* @fileoverview Various utility functions
|
|
22
|
-
* @version 1.
|
|
23
|
-
* @author Roy Revelt
|
|
22
|
+
* @version 1.7.0
|
|
23
|
+
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
26
26
|
*/
|
|
27
27
|
/**
|
|
28
28
|
* @name string-match-left-right
|
|
29
29
|
* @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
|
|
30
|
-
* @version 9.0
|
|
31
|
-
* @author Roy Revelt
|
|
30
|
+
* @version 9.1.0
|
|
31
|
+
* @author Roy Revelt
|
|
32
32
|
* @license MIT
|
|
33
33
|
* {@link https://codsen.com/os/string-match-left-right/}
|
|
34
34
|
*/
|
|
35
35
|
/**
|
|
36
36
|
* @name string-left-right
|
|
37
37
|
* @fileoverview Looks up the first non-whitespace character to the left/right of a given index
|
|
38
|
-
* @version 6.0
|
|
39
|
-
* @author Roy Revelt
|
|
38
|
+
* @version 6.1.0
|
|
39
|
+
* @author Roy Revelt
|
|
40
40
|
* @license MIT
|
|
41
41
|
* {@link https://codsen.com/os/string-left-right/}
|
|
42
42
|
*/
|
|
43
43
|
/**
|
|
44
44
|
* @name string-collapse-leading-whitespace
|
|
45
45
|
* @fileoverview Collapse the leading and trailing whitespace of a string
|
|
46
|
-
* @version 7.0
|
|
47
|
-
* @author Roy Revelt
|
|
46
|
+
* @version 7.1.0
|
|
47
|
+
* @author Roy Revelt
|
|
48
48
|
* @license MIT
|
|
49
49
|
* {@link https://codsen.com/os/string-collapse-leading-whitespace/}
|
|
50
50
|
*/
|
|
51
51
|
/**
|
|
52
52
|
* @name ranges-sort
|
|
53
53
|
* @fileoverview Sort string index ranges
|
|
54
|
-
* @version 6.0
|
|
55
|
-
* @author Roy Revelt
|
|
54
|
+
* @version 6.1.0
|
|
55
|
+
* @author Roy Revelt
|
|
56
56
|
* @license MIT
|
|
57
57
|
* {@link https://codsen.com/os/ranges-sort/}
|
|
58
58
|
*/
|
|
59
59
|
/**
|
|
60
60
|
* @name ranges-push
|
|
61
61
|
* @fileoverview Gather string index ranges
|
|
62
|
-
* @version 7.0
|
|
63
|
-
* @author Roy Revelt
|
|
62
|
+
* @version 7.1.0
|
|
63
|
+
* @author Roy Revelt
|
|
64
64
|
* @license MIT
|
|
65
65
|
* {@link https://codsen.com/os/ranges-push/}
|
|
66
66
|
*/
|
|
67
67
|
/**
|
|
68
68
|
* @name ranges-merge
|
|
69
69
|
* @fileoverview Merge and sort string index ranges
|
|
70
|
-
* @version 9.0
|
|
71
|
-
* @author Roy Revelt
|
|
70
|
+
* @version 9.1.0
|
|
71
|
+
* @author Roy Revelt
|
|
72
72
|
* @license MIT
|
|
73
73
|
* {@link https://codsen.com/os/ranges-merge/}
|
|
74
74
|
*/
|
|
75
75
|
/**
|
|
76
76
|
* @name ranges-apply
|
|
77
77
|
* @fileoverview Take an array of string index ranges, delete/replace the string according to them
|
|
78
|
-
* @version 7.0
|
|
79
|
-
* @author Roy Revelt
|
|
78
|
+
* @version 7.1.0
|
|
79
|
+
* @author Roy Revelt
|
|
80
80
|
* @license MIT
|
|
81
81
|
* {@link https://codsen.com/os/ranges-apply/}
|
|
82
82
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-remove-widows",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Helps to prevent widow words in a text",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"against",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
49
49
|
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
50
50
|
"letspublish": "npm publish --provenance || :",
|
|
51
|
-
"lint": "eslint . --fix",
|
|
51
|
+
"lint": "eslint . --fix --concurrency=auto --cache",
|
|
52
52
|
"perf": "node perf/check.js",
|
|
53
53
|
"prep": "echo 'ready'",
|
|
54
54
|
"prettier": "prettier",
|
|
@@ -75,14 +75,14 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"codsen-utils": "^1.
|
|
79
|
-
"ranges-apply": "^7.0
|
|
80
|
-
"ranges-push": "^7.0
|
|
81
|
-
"string-left-right": "^6.0
|
|
82
|
-
"string-match-left-right": "^9.0
|
|
78
|
+
"codsen-utils": "^1.7.0",
|
|
79
|
+
"ranges-apply": "^7.1.0",
|
|
80
|
+
"ranges-push": "^7.1.0",
|
|
81
|
+
"string-left-right": "^6.1.0",
|
|
82
|
+
"string-match-left-right": "^9.1.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"string-strip-html": "^13.
|
|
85
|
+
"string-strip-html": "^13.5.0"
|
|
86
86
|
},
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"registry": "https://registry.npmjs.org/"
|