string-range-expander
Advanced tools
Comparing version 3.0.10 to 3.0.11
/** | ||
* @name string-range-expander | ||
* @fileoverview Expands string index ranges within whitespace boundaries until letters are met | ||
* @version 3.0.10 | ||
* @version 3.0.11 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,4 +10,4 @@ * @license MIT | ||
var u="3.0.10";var m=u,a={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function y(t){let f=/^[0-9a-zA-Z]+$/;function s(i){return!i||typeof i!="string"?!1:!i.trim()}function l(i){return typeof i=="string"}if(!t||typeof t!="object"||Array.isArray(t)){let i;throw t===void 0?i="but it is missing completely.":t===null?i="but it was given as null.":i=`but it was given as ${typeof t}, equal to: | ||
var u="3.0.11";var m=u,a={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function y(t){let f=/^[0-9a-zA-Z]+$/;function s(i){return!i||typeof i!="string"?!1:!i.trim()}function l(i){return typeof i=="string"}if(!t||typeof t!="object"||Array.isArray(t)){let i;throw t===void 0?i="but it is missing completely.":t===null?i="but it was given as null.":i=`but it was given as ${typeof t}, equal to: | ||
${JSON.stringify(t,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${i}`)}else if(typeof t=="object"&&t!==null&&!Array.isArray(t)&&!Object.keys(t).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.");if(typeof t.from!="number")throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value opts.from, is not a number! Currently it's given as ${typeof t.from}, equal to ${JSON.stringify(t.from,null,0)}`);if(typeof t.to!="number")throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value opts.to, is not a number! Currently it's given as ${typeof t.to}, equal to ${JSON.stringify(t.to,null,0)}`);if(t?.str&&!t.str[t.from]&&t.from!==t.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string opts.str ("${t.str}") must contain the character at index "from" ("${t.from}")`);if(t?.str&&!t.str[t.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, opts.str ("${t.str}") must contain the character at index before "to" ("${t.to-1}")`);if(t.from>t.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${t.from}" is greater than "to" index, "${t.to}". That's wrong!`);if(l(t.extendToOneSide)&&t.extendToOneSide!=="left"&&t.extendToOneSide!=="right"||!l(t.extendToOneSide)&&t.extendToOneSide!==void 0&&t.extendToOneSide!==!1)throw new Error(`string-range-expander: [THROW_ID_08] The opts.extendToOneSide value is not recogniseable! It's set to: "${t.extendToOneSide}" (${typeof t.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let e={...a,...t};if(Array.isArray(e.ifLeftSideIncludesThisThenCropTightly)){let i,d;if(e.ifLeftSideIncludesThisThenCropTightly.every((h,c)=>l(h)?!0:(i=c,d=h,!1)))e.ifLeftSideIncludesThisThenCropTightly=e.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The opts.ifLeftSideIncludesThisThenCropTightly was set to an array: | ||
${JSON.stringify(e.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${i} is of a type ${typeof d} (equal to ${JSON.stringify(d,null,0)}).`)}let n=e.str,r=e.from,o=e.to;if(e.extendToOneSide!=="right"&&(s(n[r-1])&&(s(n[r-2])||e.ifLeftSideIncludesThisCropItToo.includes(n[r-2]))||n[r-1]&&e.ifLeftSideIncludesThisCropItToo.includes(n[r-1])||e.wipeAllWhitespaceOnLeft&&s(n[r-1]))){for(let i=r;i--;)if(!e.ifLeftSideIncludesThisCropItToo.includes(n[i])){if(n[i].trim()){e.wipeAllWhitespaceOnLeft||e.ifLeftSideIncludesThisCropItToo.includes(n[i+1])?r=i+1:r=i+2;break}else if(i===0){e.wipeAllWhitespaceOnLeft?r=0:r=1;break}}}if(e.extendToOneSide!=="left"&&(s(n[o])&&(e.wipeAllWhitespaceOnRight||s(n[o+1]))||e.ifRightSideIncludesThisCropItToo.includes(n[o]))){for(let i=o,d=n.length;i<d;i++)if(!e.ifRightSideIncludesThisCropItToo.includes(n[i])&&n[i]?.trim()){e.wipeAllWhitespaceOnRight||e.ifRightSideIncludesThisCropItToo.includes(n[i-1])?o=i:o=i-1;break}}return(e.extendToOneSide!=="right"&&l(e.ifLeftSideIncludesThisThenCropTightly)&&e.ifLeftSideIncludesThisThenCropTightly&&(n[r-2]&&e.ifLeftSideIncludesThisThenCropTightly.includes(n[r-2])||n[r-1]&&e.ifLeftSideIncludesThisThenCropTightly.includes(n[r-1]))||e.extendToOneSide!=="left"&&l(e.ifRightSideIncludesThisThenCropTightly)&&e.ifRightSideIncludesThisThenCropTightly&&(n[o+1]&&e.ifRightSideIncludesThisThenCropTightly.includes(n[o+1])||n[o]&&e.ifRightSideIncludesThisThenCropTightly.includes(n[o])))&&(e.extendToOneSide!=="right"&&s(n[r-1])&&!e.wipeAllWhitespaceOnLeft&&(r-=1),e.extendToOneSide!=="left"&&s(n[o])&&!e.wipeAllWhitespaceOnRight&&(o+=1)),e.addSingleSpaceToPreventAccidentalConcatenation&&n[r-1]&&n[r-1].trim()&&n[o]&&n[o].trim()&&(!e.ifLeftSideIncludesThisThenCropTightly&&!e.ifRightSideIncludesThisThenCropTightly||!((!e.ifLeftSideIncludesThisThenCropTightly||e.ifLeftSideIncludesThisThenCropTightly.includes(n[r-1]))&&(!e.ifRightSideIncludesThisThenCropTightly||n[o]&&e.ifRightSideIncludesThisThenCropTightly.includes(n[o]))))&&(f.test(n[r-1])||f.test(n[o]))?[r,o," "]:[r,o]}export{a as defaults,y as expander,m as version}; |
/** | ||
* @name string-range-expander | ||
* @fileoverview Expands string index ranges within whitespace boundaries until letters are met | ||
* @version 3.0.10 | ||
* @version 3.0.11 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,4 +10,4 @@ * @license MIT | ||
var stringRangeExpander=(()=>{var h=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var m=(e,r,o)=>r in e?h(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,u=(e,r)=>{for(var o in r||(r={}))p.call(r,o)&&m(e,o,r[o]);if(a)for(var o of a(r))b.call(r,o)&&m(e,o,r[o]);return e};var x=e=>h(e,"__esModule",{value:!0});var R=(e,r)=>{for(var o in r)h(e,o,{get:r[o],enumerable:!0})},w=(e,r,o,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of I(r))!p.call(e,t)&&(o||t!=="default")&&h(e,t,{get:()=>r[t],enumerable:!(d=S(r,t))||d.enumerable});return e};var C=(e=>(r,o)=>e&&e.get(r)||(o=w(x({}),r,1),e&&e.set(r,o),o))(typeof WeakMap!="undefined"?new WeakMap:0);var D={};R(D,{defaults:()=>y,expander:()=>A,version:()=>L});var g="3.0.10";var L=g,y={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function A(e){var c;let r=/^[0-9a-zA-Z]+$/;function o(i){return!i||typeof i!="string"?!1:!i.trim()}function d(i){return typeof i=="string"}if(!e||typeof e!="object"||Array.isArray(e)){let i;throw e===void 0?i="but it is missing completely.":e===null?i="but it was given as null.":i=`but it was given as ${typeof e}, equal to: | ||
${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${i}`)}else if(typeof e=="object"&&e!==null&&!Array.isArray(e)&&!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.");if(typeof e.from!="number")throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value opts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if(typeof e.to!="number")throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value opts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if((e==null?void 0:e.str)&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string opts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if((e==null?void 0:e.str)&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, opts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(d(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!d(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide!==!1)throw new Error(`string-range-expander: [THROW_ID_08] The opts.extendToOneSide value is not recogniseable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let t=u(u({},y),e);if(Array.isArray(t.ifLeftSideIncludesThisThenCropTightly)){let i,f;if(t.ifLeftSideIncludesThisThenCropTightly.every((T,$)=>d(T)?!0:(i=$,f=T,!1)))t.ifLeftSideIncludesThisThenCropTightly=t.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The opts.ifLeftSideIncludesThisThenCropTightly was set to an array: | ||
${JSON.stringify(t.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${i} is of a type ${typeof f} (equal to ${JSON.stringify(f,null,0)}).`)}let n=t.str,s=t.from,l=t.to;if(t.extendToOneSide!=="right"&&(o(n[s-1])&&(o(n[s-2])||t.ifLeftSideIncludesThisCropItToo.includes(n[s-2]))||n[s-1]&&t.ifLeftSideIncludesThisCropItToo.includes(n[s-1])||t.wipeAllWhitespaceOnLeft&&o(n[s-1]))){for(let i=s;i--;)if(!t.ifLeftSideIncludesThisCropItToo.includes(n[i])){if(n[i].trim()){t.wipeAllWhitespaceOnLeft||t.ifLeftSideIncludesThisCropItToo.includes(n[i+1])?s=i+1:s=i+2;break}else if(i===0){t.wipeAllWhitespaceOnLeft?s=0:s=1;break}}}if(t.extendToOneSide!=="left"&&(o(n[l])&&(t.wipeAllWhitespaceOnRight||o(n[l+1]))||t.ifRightSideIncludesThisCropItToo.includes(n[l]))){for(let i=l,f=n.length;i<f;i++)if(!t.ifRightSideIncludesThisCropItToo.includes(n[i])&&((c=n[i])==null?void 0:c.trim())){t.wipeAllWhitespaceOnRight||t.ifRightSideIncludesThisCropItToo.includes(n[i-1])?l=i:l=i-1;break}}return(t.extendToOneSide!=="right"&&d(t.ifLeftSideIncludesThisThenCropTightly)&&t.ifLeftSideIncludesThisThenCropTightly&&(n[s-2]&&t.ifLeftSideIncludesThisThenCropTightly.includes(n[s-2])||n[s-1]&&t.ifLeftSideIncludesThisThenCropTightly.includes(n[s-1]))||t.extendToOneSide!=="left"&&d(t.ifRightSideIncludesThisThenCropTightly)&&t.ifRightSideIncludesThisThenCropTightly&&(n[l+1]&&t.ifRightSideIncludesThisThenCropTightly.includes(n[l+1])||n[l]&&t.ifRightSideIncludesThisThenCropTightly.includes(n[l])))&&(t.extendToOneSide!=="right"&&o(n[s-1])&&!t.wipeAllWhitespaceOnLeft&&(s-=1),t.extendToOneSide!=="left"&&o(n[l])&&!t.wipeAllWhitespaceOnRight&&(l+=1)),t.addSingleSpaceToPreventAccidentalConcatenation&&n[s-1]&&n[s-1].trim()&&n[l]&&n[l].trim()&&(!t.ifLeftSideIncludesThisThenCropTightly&&!t.ifRightSideIncludesThisThenCropTightly||!((!t.ifLeftSideIncludesThisThenCropTightly||t.ifLeftSideIncludesThisThenCropTightly.includes(n[s-1]))&&(!t.ifRightSideIncludesThisThenCropTightly||n[l]&&t.ifRightSideIncludesThisThenCropTightly.includes(n[l]))))&&(r.test(n[s-1])||r.test(n[l]))?[s,l," "]:[s,l]}return C(D);})(); | ||
var stringRangeExpander=(()=>{var h=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var m=(e,r,o)=>r in e?h(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,u=(e,r)=>{for(var o in r||(r={}))p.call(r,o)&&m(e,o,r[o]);if(a)for(var o of a(r))b.call(r,o)&&m(e,o,r[o]);return e};var x=e=>h(e,"__esModule",{value:!0});var w=(e,r)=>{for(var o in r)h(e,o,{get:r[o],enumerable:!0})},R=(e,r,o,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of I(r))!p.call(e,t)&&(o||t!=="default")&&h(e,t,{get:()=>r[t],enumerable:!(l=S(r,t))||l.enumerable});return e};var C=(e=>(r,o)=>e&&e.get(r)||(o=R(x({}),r,1),e&&e.set(r,o),o))(typeof WeakMap!="undefined"?new WeakMap:0);var D={};w(D,{defaults:()=>y,expander:()=>A,version:()=>L});var g="3.0.11";var L=g,y={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function A(e){var c;let r=/^[0-9a-zA-Z]+$/;function o(i){return!i||typeof i!="string"?!1:!i.trim()}function l(i){return typeof i=="string"}if(!e||typeof e!="object"||Array.isArray(e)){let i;throw e===void 0?i="but it is missing completely.":e===null?i="but it was given as null.":i=`but it was given as ${typeof e}, equal to: | ||
${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${i}`)}else if(typeof e=="object"&&e!==null&&!Array.isArray(e)&&!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.");if(typeof e.from!="number")throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value opts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if(typeof e.to!="number")throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value opts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if((e==null?void 0:e.str)&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string opts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if((e==null?void 0:e.str)&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, opts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(l(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!l(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide!==!1)throw new Error(`string-range-expander: [THROW_ID_08] The opts.extendToOneSide value is not recogniseable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let t=u(u({},y),e);if(Array.isArray(t.ifLeftSideIncludesThisThenCropTightly)){let i,f;if(t.ifLeftSideIncludesThisThenCropTightly.every((T,$)=>l(T)?!0:(i=$,f=T,!1)))t.ifLeftSideIncludesThisThenCropTightly=t.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The opts.ifLeftSideIncludesThisThenCropTightly was set to an array: | ||
${JSON.stringify(t.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${i} is of a type ${typeof f} (equal to ${JSON.stringify(f,null,0)}).`)}let n=t.str,s=t.from,d=t.to;if(t.extendToOneSide!=="right"&&(o(n[s-1])&&(o(n[s-2])||t.ifLeftSideIncludesThisCropItToo.includes(n[s-2]))||n[s-1]&&t.ifLeftSideIncludesThisCropItToo.includes(n[s-1])||t.wipeAllWhitespaceOnLeft&&o(n[s-1]))){for(let i=s;i--;)if(!t.ifLeftSideIncludesThisCropItToo.includes(n[i])){if(n[i].trim()){t.wipeAllWhitespaceOnLeft||t.ifLeftSideIncludesThisCropItToo.includes(n[i+1])?s=i+1:s=i+2;break}else if(i===0){t.wipeAllWhitespaceOnLeft?s=0:s=1;break}}}if(t.extendToOneSide!=="left"&&(o(n[d])&&(t.wipeAllWhitespaceOnRight||o(n[d+1]))||t.ifRightSideIncludesThisCropItToo.includes(n[d]))){for(let i=d,f=n.length;i<f;i++)if(!t.ifRightSideIncludesThisCropItToo.includes(n[i])&&((c=n[i])==null?void 0:c.trim())){t.wipeAllWhitespaceOnRight||t.ifRightSideIncludesThisCropItToo.includes(n[i-1])?d=i:d=i-1;break}}return(t.extendToOneSide!=="right"&&l(t.ifLeftSideIncludesThisThenCropTightly)&&t.ifLeftSideIncludesThisThenCropTightly&&(n[s-2]&&t.ifLeftSideIncludesThisThenCropTightly.includes(n[s-2])||n[s-1]&&t.ifLeftSideIncludesThisThenCropTightly.includes(n[s-1]))||t.extendToOneSide!=="left"&&l(t.ifRightSideIncludesThisThenCropTightly)&&t.ifRightSideIncludesThisThenCropTightly&&(n[d+1]&&t.ifRightSideIncludesThisThenCropTightly.includes(n[d+1])||n[d]&&t.ifRightSideIncludesThisThenCropTightly.includes(n[d])))&&(t.extendToOneSide!=="right"&&o(n[s-1])&&!t.wipeAllWhitespaceOnLeft&&(s-=1),t.extendToOneSide!=="left"&&o(n[d])&&!t.wipeAllWhitespaceOnRight&&(d+=1)),t.addSingleSpaceToPreventAccidentalConcatenation&&n[s-1]&&n[s-1].trim()&&n[d]&&n[d].trim()&&(!t.ifLeftSideIncludesThisThenCropTightly&&!t.ifRightSideIncludesThisThenCropTightly||!((!t.ifLeftSideIncludesThisThenCropTightly||t.ifLeftSideIncludesThisThenCropTightly.includes(n[s-1]))&&(!t.ifRightSideIncludesThisThenCropTightly||n[d]&&t.ifRightSideIncludesThisThenCropTightly.includes(n[d]))))&&(r.test(n[s-1])||r.test(n[d]))?[s,d," "]:[s,d]}return C(D);})(); |
{ | ||
"name": "string-range-expander", | ||
"version": "3.0.10", | ||
"version": "3.0.11", | ||
"description": "Expands string index ranges within whitespace boundaries until letters are met", | ||
@@ -37,3 +37,3 @@ "keywords": [ | ||
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts", | ||
"dts": "rollup -c", | ||
"dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write", | ||
"examples": "node '../../ops/scripts/run-examples.js'", | ||
@@ -45,2 +45,4 @@ "lect": "node '../../ops/lect/lect.js'", | ||
"prepare": "echo 'ready'", | ||
"prettier": "prettier", | ||
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern", | ||
"pretest": "yarn run lect && yarn run build", | ||
@@ -47,0 +49,0 @@ "test": "c8 yarn run unit && yarn run examples && yarn run lint", |
@@ -29,3 +29,3 @@ # string-range-expander | ||
This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required: | ||
The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `2.1.0`. | ||
@@ -36,4 +36,2 @@ ```bash | ||
If you need a legacy version which works with `require`, use version 2.1.0 | ||
## Quick Take | ||
@@ -76,6 +74,4 @@ | ||
Copyright (c) 2010-2021 Roy Revelt and other contributors | ||
Copyright (c) 2010-2022 Roy Revelt and other contributors | ||
<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"> | ||
@@ -1,16 +0,18 @@ | ||
declare type Range = [from: number, to: number] | [from: number, to: number, whatToInsert: string | null | undefined]; | ||
declare type Range = | ||
| [from: number, to: number] | ||
| [from: number, to: number, whatToInsert: string | null | undefined]; | ||
declare const version: string; | ||
interface Opts { | ||
str: string; | ||
from: number; | ||
to: number; | ||
ifLeftSideIncludesThisThenCropTightly: string; | ||
ifLeftSideIncludesThisCropItToo: string; | ||
ifRightSideIncludesThisThenCropTightly: string; | ||
ifRightSideIncludesThisCropItToo: string; | ||
extendToOneSide: false | "left" | "right"; | ||
wipeAllWhitespaceOnLeft: boolean; | ||
wipeAllWhitespaceOnRight: boolean; | ||
addSingleSpaceToPreventAccidentalConcatenation: boolean; | ||
str: string; | ||
from: number; | ||
to: number; | ||
ifLeftSideIncludesThisThenCropTightly: string; | ||
ifLeftSideIncludesThisCropItToo: string; | ||
ifRightSideIncludesThisThenCropTightly: string; | ||
ifRightSideIncludesThisCropItToo: string; | ||
extendToOneSide: false | "left" | "right"; | ||
wipeAllWhitespaceOnLeft: boolean; | ||
wipeAllWhitespaceOnRight: boolean; | ||
addSingleSpaceToPreventAccidentalConcatenation: boolean; | ||
} | ||
@@ -17,0 +19,0 @@ declare const defaults: Opts; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22012
97
0
75