ranges-iterate 3.1.0 → 3.1.3

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.
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name ranges-iterate
3
3
  * @fileoverview Iterate a string and any changes within given string index ranges
4
- * @version 3.1.0
4
+ * @version 3.1.3
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-iterate/}
8
8
  */
9
9
 
10
- var c="3.1.0";var f=c;function b(r,o,n,a=0){if(typeof r!="string")throw new TypeError(`ranges-iterate: [THROW_ID_01] Input string must be a string! It was given as ${typeof r}, equal to: ${JSON.stringify(r,null,0)}`);if(!r.length)throw new TypeError("ranges-iterate: [THROW_ID_02] Input string must be non-empty!");if(o&&!Array.isArray(o))throw new TypeError(`ranges-iterate: [THROW_ID_03] Input ranges must be an array, consisting of zero or more arrays! Currently its type is: ${typeof o}, equal to: ${JSON.stringify(o,null,0)}`);if(n){if(typeof n!="function")throw new TypeError(`ranges-iterate: [THROW_ID_05] The calllback function (third input argument) must be a function. It was given as: ${typeof n}, equal to: ${JSON.stringify(n,null,0)}`)}else throw new TypeError("ranges-iterate: [THROW_ID_04] You should provide a callback function as third input argument!");if(o===null||!o.length)for(let e=0;e<r.length;e++)n({i:e,val:r[e]});else{let e=Array.from(o),i=a,t=a;if(t<e[0][0])for(;t<e[0][0]&&r[t];t++,i++)n({i:t,val:r[t]});e[0][0]<=i&&e.forEach((s,u)=>{if(s[2])for(let l=0,p=s[2].length;l<p;l++)n({i:t,val:s[2][l]}),t+=1;for(;i<s[1];)i+=1;let $=r.length;for(e[u+1]&&($=e[u+1][0]);i<$;t++,i++)n({i:t,val:r[i]})})}}export{b as rIterate,f as version};
10
+ var c="3.1.3";var f=c;function b(r,o,t,a=0){if(typeof r!="string")throw new TypeError(`ranges-iterate: [THROW_ID_01] Input string must be a string! It was given as ${typeof r}, equal to: ${JSON.stringify(r,null,0)}`);if(!r.length)throw new TypeError("ranges-iterate: [THROW_ID_02] Input string must be non-empty!");if(o&&!Array.isArray(o))throw new TypeError(`ranges-iterate: [THROW_ID_03] Input ranges must be an array, consisting of zero or more arrays! Currently its type is: ${typeof o}, equal to: ${JSON.stringify(o,null,0)}`);if(t){if(typeof t!="function")throw new TypeError(`ranges-iterate: [THROW_ID_05] The calllback function (third input argument) must be a function. It was given as: ${typeof t}, equal to: ${JSON.stringify(t,null,0)}`)}else throw new TypeError("ranges-iterate: [THROW_ID_04] You should provide a callback function as third input argument!");if(o===null||!o.length)for(let e=0;e<r.length;e++)t({i:e,val:r[e]});else{let e=Array.from(o),i=a,n=a;if(n<e[0][0])for(;n<e[0][0]&&r[n];n++,i++)t({i:n,val:r[n]});e[0][0]<=i&&e.forEach((s,u)=>{if(s[2])for(let l=0,d=s[2].length;l<d;l++)t({i:n,val:s[2][l]}),n+=1;for(;i<s[1];)i+=1;let $=r.length;for(e[u+1]&&($=e[u+1][0]);i<$;n++,i++)t({i:n,val:r[i]})})}}export{b as rIterate,f as version};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name ranges-iterate
3
3
  * @fileoverview Iterate a string and any changes within given string index ranges
4
- * @version 3.1.0
4
+ * @version 3.1.3
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-iterate/}
8
8
  */
9
9
 
10
- var rangesIterate=(()=>{var u=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(e,r)=>{for(var n in r)u(e,n,{get:r[n],enumerable:!0})},y=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of g(r))!f.call(e,t)&&t!==n&&u(e,t,{get:()=>r[t],enumerable:!(s=m(r,t))||s.enumerable});return e};var x=e=>y(u({},"__esModule",{value:!0}),e);var v={};b(v,{rIterate:()=>E,version:()=>h});var p="3.1.0";var h=p;function E(e,r,n,s=0){if(typeof e!="string")throw new TypeError(`ranges-iterate: [THROW_ID_01] Input string must be a string! It was given as ${typeof e}, equal to: ${JSON.stringify(e,null,0)}`);if(!e.length)throw new TypeError("ranges-iterate: [THROW_ID_02] Input string must be non-empty!");if(r&&!Array.isArray(r))throw new TypeError(`ranges-iterate: [THROW_ID_03] Input ranges must be an array, consisting of zero or more arrays! Currently its type is: ${typeof r}, equal to: ${JSON.stringify(r,null,0)}`);if(n){if(typeof n!="function")throw new TypeError(`ranges-iterate: [THROW_ID_05] The calllback function (third input argument) must be a function. It was given as: ${typeof n}, equal to: ${JSON.stringify(n,null,0)}`)}else throw new TypeError("ranges-iterate: [THROW_ID_04] You should provide a callback function as third input argument!");if(r===null||!r.length)for(let t=0;t<e.length;t++)n({i:t,val:e[t]});else{let t=Array.from(r),i=s,o=s;if(o<t[0][0])for(;o<t[0][0]&&e[o];o++,i++)n({i:o,val:e[o]});t[0][0]<=i&&t.forEach((l,$)=>{if(l[2])for(let a=0,d=l[2].length;a<d;a++)n({i:o,val:l[2][a]}),o+=1;for(;i<l[1];)i+=1;let c=e.length;for(t[$+1]&&(c=t[$+1][0]);i<c;o++,i++)n({i:o,val:e[i]})})}}return x(v);})();
10
+ var rangesIterate=(()=>{var u=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(e,r)=>{for(var t in r)u(e,t,{get:r[t],enumerable:!0})},y=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of p(r))!f.call(e,n)&&n!==t&&u(e,n,{get:()=>r[n],enumerable:!(s=g(r,n))||s.enumerable});return e};var x=e=>y(u({},"__esModule",{value:!0}),e);var E={};b(E,{rIterate:()=>v,version:()=>h});var d="3.1.3";var h=d;function v(e,r,t,s=0){if(typeof e!="string")throw new TypeError(`ranges-iterate: [THROW_ID_01] Input string must be a string! It was given as ${typeof e}, equal to: ${JSON.stringify(e,null,0)}`);if(!e.length)throw new TypeError("ranges-iterate: [THROW_ID_02] Input string must be non-empty!");if(r&&!Array.isArray(r))throw new TypeError(`ranges-iterate: [THROW_ID_03] Input ranges must be an array, consisting of zero or more arrays! Currently its type is: ${typeof r}, equal to: ${JSON.stringify(r,null,0)}`);if(t){if(typeof t!="function")throw new TypeError(`ranges-iterate: [THROW_ID_05] The calllback function (third input argument) must be a function. It was given as: ${typeof t}, equal to: ${JSON.stringify(t,null,0)}`)}else throw new TypeError("ranges-iterate: [THROW_ID_04] You should provide a callback function as third input argument!");if(r===null||!r.length)for(let n=0;n<e.length;n++)t({i:n,val:e[n]});else{let n=Array.from(r),i=s,o=s;if(o<n[0][0])for(;o<n[0][0]&&e[o];o++,i++)t({i:o,val:e[o]});n[0][0]<=i&&n.forEach((l,$)=>{if(l[2])for(let a=0,m=l[2].length;a<m;a++)t({i:o,val:l[2][a]}),o+=1;for(;i<l[1];)i+=1;let c=e.length;for(n[$+1]&&(c=n[$+1][0]);i<c;o++,i++)t({i:o,val:e[i]})})}}return x(E);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ranges-iterate",
3
- "version": "3.1.0",
3
+ "version": "3.1.3",
4
4
  "description": "Iterate a string and any changes within given string index ranges",
5
5
  "keywords": [
6
6
  "array",
@@ -67,7 +67,7 @@
67
67
  }
68
68
  },
69
69
  "devDependencies": {
70
- "ranges-apply": "^6.1.0",
71
- "ranges-merge": "^8.1.0"
70
+ "ranges-apply": "^6.1.2",
71
+ "ranges-merge": "^8.1.2"
72
72
  }
73
73
  }
package/types/index.d.ts CHANGED
@@ -11,7 +11,7 @@ interface Obj {
11
11
  declare type Callback = (obj: Obj) => void;
12
12
  declare function rIterate(
13
13
  str: string,
14
- originalRanges: Ranges,
14
+ input: Ranges,
15
15
  cb: Callback,
16
16
  offset?: number
17
17
  ): void;