string-collapse-white-space
Advanced tools
Comparing version
/** | ||
* @name string-collapse-white-space | ||
* @fileoverview Replace chunks of whitespace with a single spaces | ||
* @version 11.0.12 | ||
* @version 11.0.13 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,3 +10,3 @@ * @license MIT | ||
import{rApply as w}from"ranges-apply";import{Ranges as x}from"ranges-push";import{right as D}from"string-left-right";var A="11.0.12";var L=A,O={trimStart:!0,trimEnd:!0,trimLines:!1,trimnbsp:!1,removeEmptyLines:!1,limitConsecutiveEmptyLinesTo:0,enforceSpacesOnly:!1,cb:({suggested:e})=>e},R=["suggested","whiteSpaceStartsAt","whiteSpaceEndsAt","str"];function J(e,b){if(typeof e!="string")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_01] The input is not string but ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(b&&typeof b!="object")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_02] The resolvedOpts is not a plain object but ${typeof b}, equal to: | ||
import{rApply as w}from"ranges-apply";import{Ranges as x}from"ranges-push";import{right as D}from"string-left-right";var A="11.0.13";var L=A,O={trimStart:!0,trimEnd:!0,trimLines:!1,trimnbsp:!1,removeEmptyLines:!1,limitConsecutiveEmptyLinesTo:0,enforceSpacesOnly:!1,cb:({suggested:e})=>e},R=["suggested","whiteSpaceStartsAt","whiteSpaceEndsAt","str"];function J(e,b){if(typeof e!="string")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_01] The input is not string but ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(b&&typeof b!="object")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_02] The resolvedOpts is not a plain object but ${typeof b}, equal to: | ||
${JSON.stringify(b,null,4)}`);if(!e.length)return{result:"",ranges:null};let S=new x,c="\xA0",n={...O,...b};function p(t,y){if(typeof n.cb=="function"){let o=n.cb({suggested:t,...y});Array.isArray(o)&&S.push(...o)}else t&&S.push(...t)}let l=null,s=null,i=null,a=null,E=null,m=!1,f=[],h=0;for(let t=0,y=e.length;t<=y;t++){if((e[t]==="\r"||e[t]===` | ||
@@ -13,0 +13,0 @@ `&&e[t-1]!=="\r")&&(h+=1,a===null&&(a=t),E=e[t]==="\r"&&e[t+1]===` |
/** | ||
* @name string-collapse-white-space | ||
* @fileoverview Replace chunks of whitespace with a single spaces | ||
* @version 11.0.12 | ||
* @version 11.0.13 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,13 +10,13 @@ * @license MIT | ||
"use strict";var stringCollapseWhiteSpace=(()=>{var K=Object.create;var x=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames,_=Object.getOwnPropertySymbols,Y=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var R=(e,n,o)=>n in e?x(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,h=(e,n)=>{for(var o in n||(n={}))W.call(n,o)&&R(e,o,n[o]);if(_)for(var o of _(n))X.call(n,o)&&R(e,o,n[o]);return e};var ee=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),te=(e,n)=>{for(var o in n)x(e,o,{get:n[o],enumerable:!0})},J=(e,n,o,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of G(n))!W.call(e,i)&&i!==o&&x(e,i,{get:()=>n[i],enumerable:!(s=Z(n,i))||s.enumerable});return e};var re=(e,n,o)=>(o=e!=null?K(Y(e)):{},J(n||!e||!e.__esModule?x(o,"default",{value:e,enumerable:!0}):o,e)),ne=e=>J(x({},"__esModule",{value:!0}),e);var I=(e,n,o)=>(R(e,typeof n!="symbol"?n+"":n,o),o);var k=ee((Ce,P)=>{"use strict";P.exports=oe;function v(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function oe(e){if(e=e||{},e.circles)return ue(e);return e.proto?s:o;function n(i,r){for(var a=Object.keys(i),l=new Array(a.length),u=0;u<a.length;u++){var t=a[u],g=i[t];typeof g!="object"||g===null?l[t]=g:g instanceof Date?l[t]=new Date(g):ArrayBuffer.isView(g)?l[t]=v(g):l[t]=r(g)}return l}function o(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return n(i,o);if(i instanceof Map)return new Map(n(Array.from(i),o));if(i instanceof Set)return new Set(n(Array.from(i),o));var r={};for(var a in i)if(Object.hasOwnProperty.call(i,a)!==!1){var l=i[a];typeof l!="object"||l===null?r[a]=l:l instanceof Date?r[a]=new Date(l):l instanceof Map?r[a]=new Map(n(Array.from(l),o)):l instanceof Set?r[a]=new Set(n(Array.from(l),o)):ArrayBuffer.isView(l)?r[a]=v(l):r[a]=o(l)}return r}function s(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return n(i,s);if(i instanceof Map)return new Map(n(Array.from(i),s));if(i instanceof Set)return new Set(n(Array.from(i),s));var r={};for(var a in i){var l=i[a];typeof l!="object"||l===null?r[a]=l:l instanceof Date?r[a]=new Date(l):l instanceof Map?r[a]=new Map(n(Array.from(l),s)):l instanceof Set?r[a]=new Set(n(Array.from(l),s)):ArrayBuffer.isView(l)?r[a]=v(l):r[a]=s(l)}return r}}function ue(e){var n=[],o=[];return e.proto?r:i;function s(a,l){for(var u=Object.keys(a),t=new Array(u.length),g=0;g<u.length;g++){var c=u[g],m=a[c];if(typeof m!="object"||m===null)t[c]=m;else if(m instanceof Date)t[c]=new Date(m);else if(ArrayBuffer.isView(m))t[c]=v(m);else{var p=n.indexOf(m);p!==-1?t[c]=o[p]:t[c]=l(m)}}return t}function i(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return s(a,i);if(a instanceof Map)return new Map(s(Array.from(a),i));if(a instanceof Set)return new Set(s(Array.from(a),i));var l={};n.push(a),o.push(l);for(var u in a)if(Object.hasOwnProperty.call(a,u)!==!1){var t=a[u];if(typeof t!="object"||t===null)l[u]=t;else if(t instanceof Date)l[u]=new Date(t);else if(t instanceof Map)l[u]=new Map(s(Array.from(t),i));else if(t instanceof Set)l[u]=new Set(s(Array.from(t),i));else if(ArrayBuffer.isView(t))l[u]=v(t);else{var g=n.indexOf(t);g!==-1?l[u]=o[g]:l[u]=i(t)}}return n.pop(),o.pop(),l}function r(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return s(a,r);if(a instanceof Map)return new Map(s(Array.from(a),r));if(a instanceof Set)return new Set(s(Array.from(a),r));var l={};n.push(a),o.push(l);for(var u in a){var t=a[u];if(typeof t!="object"||t===null)l[u]=t;else if(t instanceof Date)l[u]=new Date(t);else if(t instanceof Map)l[u]=new Map(s(Array.from(t),r));else if(t instanceof Set)l[u]=new Set(s(Array.from(t),r));else if(ArrayBuffer.isView(t))l[u]=v(t);else{var g=n.indexOf(t);g!==-1?l[u]=o[g]:l[u]=r(t)}}return n.pop(),o.pop(),l}}});var he={};te(he,{cbSchema:()=>ce,collapse:()=>me,defaults:()=>z,version:()=>pe});var se={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function E(e,n){if(!Array.isArray(e)||!e.length)return e;let o=h(h({},se),n),s,i;if(o.strictlyTwoElementsInRangeArrays&&!e.every((l,u)=>!Array.isArray(l)||l.length!==2?(s=u,i=l.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, ${s}th range (${JSON.stringify(e[s],null,4)}) has not two but ${i} elements!`);if(!e.every((l,u)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(s=u,!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, ${s}th range (${JSON.stringify(e[s],null,4)}) does not consist of only natural numbers!`);let r=e.length**2,a=0;return Array.from(e).sort((l,u)=>(o.progressFn&&(a+=1,o.progressFn(Math.floor(a*100/r))),l[0]===u[0]?l[1]<u[1]?-1:l[1]>u[1]?1:0:l[0]<u[0]?-1:1))}var L={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function F(e,n){function o(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}if(!Array.isArray(e)||!e.length)return null;let s;if(n)if(o(n)){if(s=h(h({},L),n),s.progressFn&&o(s.progressFn)&&!Object.keys(s.progressFn).length)s.progressFn=null;else if(s.progressFn&&typeof s.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof s.progressFn}", equal to ${JSON.stringify(s.progressFn,null,4)}`);if(![1,2,"1","2"].includes(s.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof s.mergeType}", equal to ${JSON.stringify(s.mergeType,null,4)}`);if(typeof s.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof s.joinRangesThatTouchEdges}", equal to ${JSON.stringify(s.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as: | ||
${JSON.stringify(n,null,4)} (type ${typeof n})`);else s=h({},L);let i=e.filter(t=>Array.isArray(t)).map(t=>[...t]).filter(t=>t[2]!==void 0||t[0]!==t[1]),r,a,l;s.progressFn?r=E(i,{progressFn:t=>{l=Math.floor(t/5),l!==a&&(a=l,s.progressFn(l))}}):r=E(i);let u=r.length-1;for(let t=u;t>0;t--)s.progressFn&&(l=Math.floor((1-t/u)*78)+21,l!==a&&l>a&&(a=l,s.progressFn(l))),(r[t][0]<=r[t-1][0]||!s.joinRangesThatTouchEdges&&r[t][0]<r[t-1][1]||s.joinRangesThatTouchEdges&&r[t][0]<=r[t-1][1])&&(r[t-1][0]=Math.min(r[t][0],r[t-1][0]),r[t-1][1]=Math.max(r[t][1],r[t-1][1]),r[t][2]!==void 0&&(r[t-1][0]>=r[t][0]||r[t-1][1]<=r[t][1])&&r[t-1][2]!==null&&(r[t][2]===null&&r[t-1][2]!==null?r[t-1][2]=null:r[t-1][2]!=null?+s.mergeType==2&&r[t-1][0]===r[t][0]?r[t-1][2]=r[t][2]:r[t-1][2]+=r[t][2]:r[t-1][2]=r[t][2]),r.splice(t,1),t=r.length);return r.length?r:null}var ie=!0,V="Invariant failed";function M(e,n){if(!e){if(ie)throw new Error(V);var o=typeof n=="function"?n():n,s=o?"".concat(V,": ").concat(o):V;throw new Error(s)}}function B(e,n,o){let s=0,i=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: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(n&&!Array.isArray(n))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof n}, equal to: ${JSON.stringify(n,null,4)}`);if(o&&typeof o!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof o}, equal to: ${JSON.stringify(o,null,4)}`);if(!(n!=null&&n.filter(g=>g).length))return e;let r;Array.isArray(n)&&Number.isInteger(n[0])&&Number.isInteger(n[1])?r=[Array.from(n)]:r=Array.from(n);let a=r.length,l=0;r.filter(g=>g).forEach((g,c)=>{if(o&&(s=Math.floor(l/a*10),s!==i&&(i=s,o(s))),!Array.isArray(g))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${c}th element not an array: ${JSON.stringify(g,null,4)}, which is ${typeof g}`);if(!Number.isInteger(g[0])){if(!Number.isInteger(+g[0])||+g[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its first element is not an integer, string index, but ${typeof g[0]}, equal to: ${JSON.stringify(g[0],null,4)}.`);r[c][0]=+r[c][0]}if(!Number.isInteger(g[1])){if(!Number.isInteger(+g[1])||+g[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its second element is not an integer, string index, but ${typeof g[1]}, equal to: ${JSON.stringify(g[1],null,4)}.`);r[c][1]=+r[c][1]}l+=1});let u=F(r,{progressFn:g=>{o&&(s=10+Math.floor(g/10),s!==i&&(i=s,o(s)))}});M(u);let t=u.length;if(t>0){let g=e.slice(u[t-1][1]);e=u.reduce((c,m,p,f)=>{o&&(s=20+Math.floor(p/t*80),s!==i&&(i=s,o(s)));let T=p===0?0:f[p-1][1],d=f[p][0];return`${c}${e.slice(T,d)}${f[p][2]||""}`},""),e+=g}return e}function N(e,n=1){let o="\xA0";function s(r){return Array.from(r).reverse().join("")}function i(r,a,l){let u=l?` | ||
"use strict";var stringCollapseWhiteSpace=(()=>{var G=Object.create;var x=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames,W=Object.getOwnPropertySymbols,ee=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var R=(e,n,o)=>n in e?x(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,h=(e,n)=>{for(var o in n||(n={}))J.call(n,o)&&R(e,o,n[o]);if(W)for(var o of W(n))te.call(n,o)&&R(e,o,n[o]);return e};var re=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),ne=(e,n)=>{for(var o in n)x(e,o,{get:n[o],enumerable:!0})},L=(e,n,o,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of X(n))!J.call(e,i)&&i!==o&&x(e,i,{get:()=>n[i],enumerable:!(s=Y(n,i))||s.enumerable});return e};var F=(e,n,o)=>(o=e!=null?G(ee(e)):{},L(n||!e||!e.__esModule?x(o,"default",{value:e,enumerable:!0}):o,e)),se=e=>L(x({},"__esModule",{value:!0}),e);var I=(e,n,o)=>(R(e,typeof n!="symbol"?n+"":n,o),o);var _=re((xe,P)=>{"use strict";P.exports=ae;function v(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function ae(e){if(e=e||{},e.circles)return oe(e);return e.proto?s:o;function n(i,r){for(var a=Object.keys(i),l=new Array(a.length),u=0;u<a.length;u++){var t=a[u],g=i[t];typeof g!="object"||g===null?l[t]=g:g instanceof Date?l[t]=new Date(g):ArrayBuffer.isView(g)?l[t]=v(g):l[t]=r(g)}return l}function o(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return n(i,o);if(i instanceof Map)return new Map(n(Array.from(i),o));if(i instanceof Set)return new Set(n(Array.from(i),o));var r={};for(var a in i)if(Object.hasOwnProperty.call(i,a)!==!1){var l=i[a];typeof l!="object"||l===null?r[a]=l:l instanceof Date?r[a]=new Date(l):l instanceof Map?r[a]=new Map(n(Array.from(l),o)):l instanceof Set?r[a]=new Set(n(Array.from(l),o)):ArrayBuffer.isView(l)?r[a]=v(l):r[a]=o(l)}return r}function s(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return n(i,s);if(i instanceof Map)return new Map(n(Array.from(i),s));if(i instanceof Set)return new Set(n(Array.from(i),s));var r={};for(var a in i){var l=i[a];typeof l!="object"||l===null?r[a]=l:l instanceof Date?r[a]=new Date(l):l instanceof Map?r[a]=new Map(n(Array.from(l),s)):l instanceof Set?r[a]=new Set(n(Array.from(l),s)):ArrayBuffer.isView(l)?r[a]=v(l):r[a]=s(l)}return r}}function oe(e){var n=[],o=[];return e.proto?r:i;function s(a,l){for(var u=Object.keys(a),t=new Array(u.length),g=0;g<u.length;g++){var c=u[g],m=a[c];if(typeof m!="object"||m===null)t[c]=m;else if(m instanceof Date)t[c]=new Date(m);else if(ArrayBuffer.isView(m))t[c]=v(m);else{var p=n.indexOf(m);p!==-1?t[c]=o[p]:t[c]=l(m)}}return t}function i(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return s(a,i);if(a instanceof Map)return new Map(s(Array.from(a),i));if(a instanceof Set)return new Set(s(Array.from(a),i));var l={};n.push(a),o.push(l);for(var u in a)if(Object.hasOwnProperty.call(a,u)!==!1){var t=a[u];if(typeof t!="object"||t===null)l[u]=t;else if(t instanceof Date)l[u]=new Date(t);else if(t instanceof Map)l[u]=new Map(s(Array.from(t),i));else if(t instanceof Set)l[u]=new Set(s(Array.from(t),i));else if(ArrayBuffer.isView(t))l[u]=v(t);else{var g=n.indexOf(t);g!==-1?l[u]=o[g]:l[u]=i(t)}}return n.pop(),o.pop(),l}function r(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return s(a,r);if(a instanceof Map)return new Map(s(Array.from(a),r));if(a instanceof Set)return new Set(s(Array.from(a),r));var l={};n.push(a),o.push(l);for(var u in a){var t=a[u];if(typeof t!="object"||t===null)l[u]=t;else if(t instanceof Date)l[u]=new Date(t);else if(t instanceof Map)l[u]=new Map(s(Array.from(t),r));else if(t instanceof Set)l[u]=new Set(s(Array.from(t),r));else if(ArrayBuffer.isView(t))l[u]=v(t);else{var g=n.indexOf(t);g!==-1?l[u]=o[g]:l[u]=r(t)}}return n.pop(),o.pop(),l}}});var de={};ne(de,{cbSchema:()=>me,collapse:()=>he,defaults:()=>Z,version:()=>ce});var ie={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function E(e,n){if(!Array.isArray(e)||!e.length)return e;let o=h(h({},ie),n),s,i;if(o.strictlyTwoElementsInRangeArrays&&!e.every((l,u)=>!Array.isArray(l)||l.length!==2?(s=u,i=l.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, ${s}th range (${JSON.stringify(e[s],null,4)}) has not two but ${i} elements!`);if(!e.every((l,u)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(s=u,!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, ${s}th range (${JSON.stringify(e[s],null,4)}) does not consist of only natural numbers!`);let r=e.length**2,a=0;return Array.from(e).sort((l,u)=>(o.progressFn&&(a+=1,o.progressFn(Math.floor(a*100/r))),l[0]===u[0]?l[1]<u[1]?-1:l[1]>u[1]?1:0:l[0]<u[0]?-1:1))}var M={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function B(e,n){function o(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}if(!Array.isArray(e)||!e.length)return null;let s;if(n)if(o(n)){if(s=h(h({},M),n),s.progressFn&&o(s.progressFn)&&!Object.keys(s.progressFn).length)s.progressFn=null;else if(s.progressFn&&typeof s.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof s.progressFn}", equal to ${JSON.stringify(s.progressFn,null,4)}`);if(![1,2,"1","2"].includes(s.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof s.mergeType}", equal to ${JSON.stringify(s.mergeType,null,4)}`);if(typeof s.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof s.joinRangesThatTouchEdges}", equal to ${JSON.stringify(s.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as: | ||
${JSON.stringify(n,null,4)} (type ${typeof n})`);else s=h({},M);let i=e.filter(t=>Array.isArray(t)).map(t=>[...t]).filter(t=>t[2]!==void 0||t[0]!==t[1]),r,a,l;s.progressFn?r=E(i,{progressFn:t=>{l=Math.floor(t/5),l!==a&&(a=l,s.progressFn(l))}}):r=E(i);let u=r.length-1;for(let t=u;t>0;t--)s.progressFn&&(l=Math.floor((1-t/u)*78)+21,l!==a&&l>a&&(a=l,s.progressFn(l))),(r[t][0]<=r[t-1][0]||!s.joinRangesThatTouchEdges&&r[t][0]<r[t-1][1]||s.joinRangesThatTouchEdges&&r[t][0]<=r[t-1][1])&&(r[t-1][0]=Math.min(r[t][0],r[t-1][0]),r[t-1][1]=Math.max(r[t][1],r[t-1][1]),r[t][2]!==void 0&&(r[t-1][0]>=r[t][0]||r[t-1][1]<=r[t][1])&&r[t-1][2]!==null&&(r[t][2]===null&&r[t-1][2]!==null?r[t-1][2]=null:r[t-1][2]!=null?+s.mergeType==2&&r[t-1][0]===r[t][0]?r[t-1][2]=r[t][2]:r[t-1][2]+=r[t][2]:r[t-1][2]=r[t][2]),r.splice(t,1),t=r.length);return r.length?r:null}var le=!0,V="Invariant failed";function H(e,n){if(!e){if(le)throw new Error(V);var o=typeof n=="function"?n():n,s=o?"".concat(V,": ").concat(o):V;throw new Error(s)}}function q(e,n,o){let s=0,i=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: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(n&&!Array.isArray(n))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof n}, equal to: ${JSON.stringify(n,null,4)}`);if(o&&typeof o!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof o}, equal to: ${JSON.stringify(o,null,4)}`);if(!(n!=null&&n.filter(g=>g).length))return e;let r;Array.isArray(n)&&Number.isInteger(n[0])&&Number.isInteger(n[1])?r=[Array.from(n)]:r=Array.from(n);let a=r.length,l=0;r.filter(g=>g).forEach((g,c)=>{if(o&&(s=Math.floor(l/a*10),s!==i&&(i=s,o(s))),!Array.isArray(g))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${c}th element not an array: ${JSON.stringify(g,null,4)}, which is ${typeof g}`);if(!Number.isInteger(g[0])){if(!Number.isInteger(+g[0])||+g[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its first element is not an integer, string index, but ${typeof g[0]}, equal to: ${JSON.stringify(g[0],null,4)}.`);r[c][0]=+r[c][0]}if(!Number.isInteger(g[1])){if(!Number.isInteger(+g[1])||+g[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its second element is not an integer, string index, but ${typeof g[1]}, equal to: ${JSON.stringify(g[1],null,4)}.`);r[c][1]=+r[c][1]}l+=1});let u=B(r,{progressFn:g=>{o&&(s=10+Math.floor(g/10),s!==i&&(i=s,o(s)))}});H(u);let t=u.length;if(t>0){let g=e.slice(u[t-1][1]);e=u.reduce((c,m,p,f)=>{o&&(s=20+Math.floor(p/t*80),s!==i&&(i=s,o(s)));let T=p===0?0:f[p-1][1],d=f[p][0];return`${c}${e.slice(T,d)}${f[p][2]||""}`},""),e+=g}return e}function N(e,n=1){let o="\xA0";function s(r){return Array.from(r).reverse().join("")}function i(r,a,l){let u=l?` | ||
`:"\r",t=l?"\r":` | ||
`;if(!r)return r;let g=0,c=0,m="";for(let p=0,f=r.length;p<f;p++)(r[p]===u||r[p]===t&&r[p-1]!==u)&&c++,`\r | ||
`.includes(r[p])||r[p]===o?(g=0,r[p]===o?m+=r[p]:r[p]===u?c<=a&&(m+=r[p],r[p+1]===t&&(m+=r[p+1],p++)):r[p]===t&&(r==null?void 0:r[p-1])!==u&&c<=a&&(m+=r[p])):(g++,!r[p+1]&&!c&&(m+=" "));return m}if(typeof e=="string"&&e.length){let r=1;typeof+n=="number"&&Number.isInteger(+n)&&+n>=0&&(r=+n);let a="",l="";if(!e.trim())a=e;else if(!e[0].trim()){for(let u=0,t=e.length;u<t;u++)if(e[u].trim()){a=e.slice(0,u);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===o)){for(let u=e.length;u--;)if(e[u].trim()){l=e.slice(u+1);break}}return`${i(a,r,!1)}${e.trim()}${s(i(s(l),r,!0))}`}return e}function S(e){return typeof e=="string"}function w(e){return Number.isSafeInteger(e)&&e>=0}function A(e){return e!=null}var H={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function le(e,n){function o(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}if(!Array.isArray(e)||!e.length)return null;let s;if(n)if(o(n)){if(s=h(h({},H),n),s.progressFn&&o(s.progressFn)&&!Object.keys(s.progressFn).length)s.progressFn=null;else if(s.progressFn&&typeof s.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof s.progressFn}", equal to ${JSON.stringify(s.progressFn,null,4)}`);if(![1,2,"1","2"].includes(s.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof s.mergeType}", equal to ${JSON.stringify(s.mergeType,null,4)}`);if(typeof s.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof s.joinRangesThatTouchEdges}", equal to ${JSON.stringify(s.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as: | ||
${JSON.stringify(n,null,4)} (type ${typeof n})`);else s=h({},H);let i=e.filter(t=>Array.isArray(t)).map(t=>[...t]).filter(t=>t[2]!==void 0||t[0]!==t[1]),r,a,l;s.progressFn?r=E(i,{progressFn:t=>{l=Math.floor(t/5),l!==a&&(a=l,s.progressFn(l))}}):r=E(i);let u=r.length-1;for(let t=u;t>0;t--)s.progressFn&&(l=Math.floor((1-t/u)*78)+21,l!==a&&l>a&&(a=l,s.progressFn(l))),(r[t][0]<=r[t-1][0]||!s.joinRangesThatTouchEdges&&r[t][0]<r[t-1][1]||s.joinRangesThatTouchEdges&&r[t][0]<=r[t-1][1])&&(r[t-1][0]=Math.min(r[t][0],r[t-1][0]),r[t-1][1]=Math.max(r[t][1],r[t-1][1]),r[t][2]!==void 0&&(r[t-1][0]>=r[t][0]||r[t-1][1]<=r[t][1])&&r[t-1][2]!==null&&(r[t][2]===null&&r[t-1][2]!==null?r[t-1][2]=null:r[t-1][2]!=null?+s.mergeType==2&&r[t-1][0]===r[t][0]?r[t-1][2]=r[t][2]:r[t-1][2]+=r[t][2]:r[t-1][2]=r[t][2]),r.splice(t,1),t=r.length);return r.length?r:null}var ae={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},q=class{constructor(e){I(this,"ranges");I(this,"opts");let n=h(h({},ae),e);if(n.mergeType&&n.mergeType!==1&&n.mergeType!==2)if(S(n.mergeType)&&n.mergeType.trim()==="1")n.mergeType=1;else if(S(n.mergeType)&&n.mergeType.trim()==="2")n.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: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);this.opts=n,this.ranges=[]}add(e,n,o){var r;if(e==null&&n==null)return;if(A(e)&&!A(n)){if(Array.isArray(e)){if(e.length){if(e.some(a=>Array.isArray(a))){e.forEach(a=>{Array.isArray(a)&&this.add(...a)});return}e.length&&w(+e[0])&&w(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(n,null,0)})`)}else if(!A(e)&&A(n))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(n,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let s=+e,i=+n;if(w(o)&&(o=String(o)),w(s)&&w(i)){if(A(o)&&!S(o)&&!w(o))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof o}, equal to: | ||
${JSON.stringify(o,null,4)}`);if(A(this.ranges)&&Array.isArray(this.last())&&s===this.last()[1]){if(this.last()[1]=i,this.last()[2],this.last()[2]!==null&&A(o)){let a=this.last()[2]&&this.last()[2].length&&(!((r=this.opts)!=null&&r.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${o}`:o;this.opts.limitToBeAddedWhitespace&&(a=N(a,this.opts.limitLinebreaksCount)),S(a)&&!a.length||(this.last()[2]=a)}}else{this.ranges||(this.ranges=[]);let a=o!==void 0&&!(S(o)&&!o.length)?[s,i,o&&this.opts.limitToBeAddedWhitespace?N(o,this.opts.limitLinebreaksCount):o]:[s,i];this.ranges.push(a)}}else throw w(s)&&s>=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 "${typeof i}" equal to: ${JSON.stringify(i,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 "${typeof s}" equal to: ${JSON.stringify(s,null,4)}`)}push(e,n,o){this.add(e,n,o)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=le(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>A(e[2])?[e[0],e[1],N(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])&&w(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, ${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 Q=re(k(),1);var Je=(0,Q.default)();var j="\xA0";function fe({str:e,idx:n=0,stopAtNewlines:o=!1,stopAtRawNbsp:s=!1}){if(typeof e!="string"||!e.length||((!n||typeof n!="number")&&(n=0),!e[n+1]))return null;if(e[n+1]&&(e[n+1].trim()||o&&` | ||
`.includes(r[p])||r[p]===o?(g=0,r[p]===o?m+=r[p]:r[p]===u?c<=a&&(m+=r[p],r[p+1]===t&&(m+=r[p+1],p++)):r[p]===t&&(r==null?void 0:r[p-1])!==u&&c<=a&&(m+=r[p])):(g++,!r[p+1]&&!c&&(m+=" "));return m}if(typeof e=="string"&&e.length){let r=1;typeof+n=="number"&&Number.isInteger(+n)&&+n>=0&&(r=+n);let a="",l="";if(!e.trim())a=e;else if(!e[0].trim()){for(let u=0,t=e.length;u<t;u++)if(e[u].trim()){a=e.slice(0,u);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===o)){for(let u=e.length;u--;)if(e[u].trim()){l=e.slice(u+1);break}}return`${i(a,r,!1)}${e.trim()}${s(i(s(l),r,!0))}`}return e}var k=F(_(),1);var Ne=(0,k.default)();function S(e){return typeof e=="string"}function w(e){return Number.isSafeInteger(e)&&e>=0}function A(e){return e!=null}var Q={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ue(e,n){function o(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}if(!Array.isArray(e)||!e.length)return null;let s;if(n)if(o(n)){if(s=h(h({},Q),n),s.progressFn&&o(s.progressFn)&&!Object.keys(s.progressFn).length)s.progressFn=null;else if(s.progressFn&&typeof s.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof s.progressFn}", equal to ${JSON.stringify(s.progressFn,null,4)}`);if(![1,2,"1","2"].includes(s.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof s.mergeType}", equal to ${JSON.stringify(s.mergeType,null,4)}`);if(typeof s.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof s.joinRangesThatTouchEdges}", equal to ${JSON.stringify(s.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as: | ||
${JSON.stringify(n,null,4)} (type ${typeof n})`);else s=h({},Q);let i=e.filter(t=>Array.isArray(t)).map(t=>[...t]).filter(t=>t[2]!==void 0||t[0]!==t[1]),r,a,l;s.progressFn?r=E(i,{progressFn:t=>{l=Math.floor(t/5),l!==a&&(a=l,s.progressFn(l))}}):r=E(i);let u=r.length-1;for(let t=u;t>0;t--)s.progressFn&&(l=Math.floor((1-t/u)*78)+21,l!==a&&l>a&&(a=l,s.progressFn(l))),(r[t][0]<=r[t-1][0]||!s.joinRangesThatTouchEdges&&r[t][0]<r[t-1][1]||s.joinRangesThatTouchEdges&&r[t][0]<=r[t-1][1])&&(r[t-1][0]=Math.min(r[t][0],r[t-1][0]),r[t-1][1]=Math.max(r[t][1],r[t-1][1]),r[t][2]!==void 0&&(r[t-1][0]>=r[t][0]||r[t-1][1]<=r[t][1])&&r[t-1][2]!==null&&(r[t][2]===null&&r[t-1][2]!==null?r[t-1][2]=null:r[t-1][2]!=null?+s.mergeType==2&&r[t-1][0]===r[t][0]?r[t-1][2]=r[t][2]:r[t-1][2]+=r[t][2]:r[t-1][2]=r[t][2]),r.splice(t,1),t=r.length);return r.length?r:null}var fe={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},U=class{constructor(e){I(this,"ranges");I(this,"opts");let n=h(h({},fe),e);if(n.mergeType&&n.mergeType!==1&&n.mergeType!==2)if(S(n.mergeType)&&n.mergeType.trim()==="1")n.mergeType=1;else if(S(n.mergeType)&&n.mergeType.trim()==="2")n.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: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);this.opts=n,this.ranges=[]}add(e,n,o){var r;if(e==null&&n==null)return;if(A(e)&&!A(n)){if(Array.isArray(e)){if(e.length){if(e.some(a=>Array.isArray(a))){e.forEach(a=>{Array.isArray(a)&&this.add(...a)});return}e.length&&w(+e[0])&&w(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(n,null,0)})`)}else if(!A(e)&&A(n))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(n,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let s=+e,i=+n;if(w(o)&&(o=String(o)),w(s)&&w(i)){if(A(o)&&!S(o)&&!w(o))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof o}, equal to: | ||
${JSON.stringify(o,null,4)}`);if(A(this.ranges)&&Array.isArray(this.last())&&s===this.last()[1]){if(this.last()[1]=i,this.last()[2],this.last()[2]!==null&&A(o)){let a=this.last()[2]&&this.last()[2].length&&(!((r=this.opts)!=null&&r.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${o}`:o;this.opts.limitToBeAddedWhitespace&&(a=N(a,this.opts.limitLinebreaksCount)),S(a)&&!a.length||(this.last()[2]=a)}}else{this.ranges||(this.ranges=[]);let a=o!==void 0&&!(S(o)&&!o.length)?[s,i,o&&this.opts.limitToBeAddedWhitespace?N(o,this.opts.limitLinebreaksCount):o]:[s,i];this.ranges.push(a)}}else throw w(s)&&s>=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 "${typeof i}" equal to: ${JSON.stringify(i,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 "${typeof s}" equal to: ${JSON.stringify(s,null,4)}`)}push(e,n,o){this.add(e,n,o)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=ue(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>A(e[2])?[e[0],e[1],N(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])&&w(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, ${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 z=F(_(),1);var Fe=(0,z.default)();var j="\xA0";function ge({str:e,idx:n=0,stopAtNewlines:o=!1,stopAtRawNbsp:s=!1}){if(typeof e!="string"||!e.length||((!n||typeof n!="number")&&(n=0),!e[n+1]))return null;if(e[n+1]&&(e[n+1].trim()||o&&` | ||
\r`.includes(e[n+1])||s&&e[n+1]===j))return n+1;if(e[n+2]&&(e[n+2].trim()||o&&` | ||
\r`.includes(e[n+2])||s&&e[n+2]===j))return n+2;for(let i=n+1,r=e.length;i<r;i++)if(e[i].trim()||o&&` | ||
\r`.includes(e[i])||s&&e[i]===j)return i;return null}function C(e,n=0){return fe({str:e,idx:n,stopAtNewlines:!1,stopAtRawNbsp:!1})}var U="11.0.12";var pe=U,z={trimStart:!0,trimEnd:!0,trimLines:!1,trimnbsp:!1,removeEmptyLines:!1,limitConsecutiveEmptyLinesTo:0,enforceSpacesOnly:!1,cb:({suggested:e})=>e},ce=["suggested","whiteSpaceStartsAt","whiteSpaceEndsAt","str"];function me(e,n){if(typeof e!="string")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_01] The input is not string but ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(n&&typeof n!="object")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_02] The resolvedOpts is not a plain object but ${typeof n}, equal to: | ||
${JSON.stringify(n,null,4)}`);if(!e.length)return{result:"",ranges:null};let o=new q,s="\xA0",i=h(h({},z),n);function r(f,T){if(typeof i.cb=="function"){let d=i.cb(h({suggested:f},T));Array.isArray(d)&&o.push(...d)}else f&&o.push(...f)}let a=null,l=null,u=null,t=null,g=null,c=!1,m=[],p=0;for(let f=0,T=e.length;f<=T;f++){if((e[f]==="\r"||e[f]===` | ||
\r`.includes(e[i])||s&&e[i]===j)return i;return null}function C(e,n=0){return ge({str:e,idx:n,stopAtNewlines:!1,stopAtRawNbsp:!1})}var K="11.0.13";var ce=K,Z={trimStart:!0,trimEnd:!0,trimLines:!1,trimnbsp:!1,removeEmptyLines:!1,limitConsecutiveEmptyLinesTo:0,enforceSpacesOnly:!1,cb:({suggested:e})=>e},me=["suggested","whiteSpaceStartsAt","whiteSpaceEndsAt","str"];function he(e,n){if(typeof e!="string")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_01] The input is not string but ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(n&&typeof n!="object")throw new Error(`string-collapse-white-space/collapse(): [THROW_ID_02] The resolvedOpts is not a plain object but ${typeof n}, equal to: | ||
${JSON.stringify(n,null,4)}`);if(!e.length)return{result:"",ranges:null};let o=new U,s="\xA0",i=h(h({},Z),n);function r(f,T){if(typeof i.cb=="function"){let d=i.cb(h({suggested:f},T));Array.isArray(d)&&o.push(...d)}else f&&o.push(...f)}let a=null,l=null,u=null,t=null,g=null,c=!1,m=[],p=0;for(let f=0,T=e.length;f<=T;f++){if((e[f]==="\r"||e[f]===` | ||
`&&e[f-1]!=="\r")&&(p+=1,t===null&&(t=f),g=e[f]==="\r"&&e[f+1]===` | ||
@@ -31,3 +31,3 @@ `?f+2:f+1),!i.trimnbsp&&e[f]===s&&!c&&(c=!0),a!==null&&e[f]!==" "){let d=a&&l||!l&&(!i.trimStart||!i.trimnbsp&&(e[f]===s||e[a-1]===s)),b=e[f]||!i.trimEnd||!i.trimnbsp&&(e[f]===s||e[a-1]===s),y=!i.enforceSpacesOnly||(!e[a-1]||e[a-1].trim())&&(!e[f]||e[f].trim());if(a<f-1&&d&&b&&y){let $=a,D=f,O=" ";i.trimLines&&(!a||!e[f]||e[a-1]&&`\r | ||
`?`\r | ||
`:e[t]}`.repeat((i.limitConsecutiveEmptyLinesTo||0)+1);e.endsWith($,g)?(y-=$.length||0,$=null):e.startsWith($,t)&&(b+=$.length,$=null),r($?[b,y,$]:[b,y],{whiteSpaceStartsAt:l,whiteSpaceEndsAt:f,str:e})}if(m.length){for(;m.length;)r(...m.shift());d=!0}d||r(null,{whiteSpaceStartsAt:l,whiteSpaceEndsAt:f,str:e})}l=null,u=null,c=!1,p&&(p=0,t=null,g=null)}a!==null&&e[f]!==" "&&(a=null)}return{result:B(e,o.current()),ranges:o.current()}}return ne(he);})(); | ||
`:e[t]}`.repeat((i.limitConsecutiveEmptyLinesTo||0)+1);e.endsWith($,g)?(y-=$.length||0,$=null):e.startsWith($,t)&&(b+=$.length,$=null),r($?[b,y,$]:[b,y],{whiteSpaceStartsAt:l,whiteSpaceEndsAt:f,str:e})}if(m.length){for(;m.length;)r(...m.shift());d=!0}d||r(null,{whiteSpaceStartsAt:l,whiteSpaceEndsAt:f,str:e})}l=null,u=null,c=!1,p&&(p=0,t=null,g=null)}a!==null&&e[f]!==" "&&(a=null)}return{result:q(e,o.current()),ranges:o.current()}}return se(de);})(); | ||
/** | ||
@@ -44,3 +44,3 @@ * @name ranges-sort | ||
* @fileoverview Merge and sort string index ranges | ||
* @version 9.0.9 | ||
* @version 9.0.10 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -53,3 +53,3 @@ * @license MIT | ||
* @fileoverview Take an array of string index ranges, delete/replace the string according to them | ||
* @version 7.0.9 | ||
* @version 7.0.10 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -70,3 +70,3 @@ * @license MIT | ||
* @fileoverview Various utility functions | ||
* @version 1.5.0 | ||
* @version 1.6.0 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -79,3 +79,3 @@ * @license MIT | ||
* @fileoverview Gather string index ranges | ||
* @version 7.0.9 | ||
* @version 7.0.10 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -88,3 +88,3 @@ * @license MIT | ||
* @fileoverview Looks up the first non-whitespace character to the left/right of a given index | ||
* @version 6.0.12 | ||
* @version 6.0.13 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -91,0 +91,0 @@ * @license MIT |
{ | ||
"name": "string-collapse-white-space", | ||
"version": "11.0.12", | ||
"version": "11.0.13", | ||
"description": "Replace chunks of whitespace with a single spaces", | ||
@@ -72,9 +72,9 @@ "keywords": [ | ||
"dependencies": { | ||
"ranges-apply": "^7.0.9", | ||
"ranges-push": "^7.0.9", | ||
"string-left-right": "^6.0.12" | ||
"ranges-apply": "^7.0.10", | ||
"ranges-push": "^7.0.10", | ||
"string-left-right": "^6.0.13" | ||
}, | ||
"devDependencies": { | ||
"test-mixer": "^4.1.9" | ||
"test-mixer": "^4.1.10" | ||
} | ||
} |
42640
0.11%Updated
Updated
Updated