ranges-sort 5.1.4 → 5.1.6

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/README.md CHANGED
@@ -1,28 +1,25 @@
1
- # ranges-sort
1
+ <h1 align="center">ranges-sort</h1>
2
2
 
3
- > Sort string index ranges
3
+ <p align="center">Sort string index ranges</p>
4
4
 
5
- <div class="package-badges">
6
- <a href="https://www.npmjs.com/package/ranges-sort" rel="nofollow noreferrer noopener">
7
- <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
8
- </a>
5
+ <p align="center">
9
6
  <a href="https://codsen.com/os/ranges-sort" rel="nofollow noreferrer noopener">
10
7
  <img src="https://img.shields.io/badge/-codsen-blue?style=flat-square" alt="page on codsen.com">
11
8
  </a>
9
+ <a href="https://www.npmjs.com/package/ranges-sort" rel="nofollow noreferrer noopener">
10
+ <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
11
+ </a>
12
12
  <a href="https://github.com/codsen/codsen/tree/main/packages/ranges-sort" rel="nofollow noreferrer noopener">
13
13
  <img src="https://img.shields.io/badge/-github-blue?style=flat-square" alt="page on github">
14
14
  </a>
15
15
  <a href="https://npmcharts.com/compare/ranges-sort?interval=30" rel="nofollow noreferrer noopener" target="_blank">
16
16
  <img src="https://img.shields.io/npm/dm/ranges-sort.svg?style=flat-square" alt="Downloads per month">
17
17
  </a>
18
- <a href="https://prettier.io" rel="nofollow noreferrer noopener" target="_blank">
19
- <img src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg?style=flat-square" alt="Code style: prettier">
20
- </a>
21
- <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT License">
22
- <a href="https://liberamanifesto.com" rel="nofollow noreferrer noopener" target="_blank">
23
- <img src="https://img.shields.io/badge/libera-manifesto-lightgrey.svg?style=flat-square" alt="libera manifesto">
18
+ <a href="https://codsen.com/os/ranges-sort/changelog" rel="nofollow noreferrer noopener">
19
+ <img src="https://img.shields.io/badge/changelog-here-brightgreen?style=flat-square" alt="changelog">
24
20
  </a>
25
- </div>
21
+ <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
22
+ </p>
26
23
 
27
24
  ## Install
28
25
 
@@ -64,8 +61,8 @@ To report bugs or request features or assistance, [raise an issue](https://githu
64
61
 
65
62
  ## Licence
66
63
 
67
- MIT License
64
+ MIT License.
68
65
 
69
- Copyright (c) 2010-2022 Roy Revelt and other contributors
66
+ Copyright © 2010-2022 Roy Revelt and other contributors.
70
67
 
71
- <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">
68
+ <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,10 +1,10 @@
1
1
  /**
2
2
  * @name ranges-sort
3
3
  * @fileoverview Sort string index ranges
4
- * @version 5.1.4
4
+ * @version 5.1.6
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-sort/}
8
8
  */
9
9
 
10
- var u="5.1.4";var m=u,d={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function g(r,l){if(!Array.isArray(r)||!r.length)return r;let n={...d,...l},s,o;if(n.strictlyTwoElementsInRangeArrays&&!r.every((e,t)=>!Array.isArray(e)||e.length!==2?(s=t,o=e.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(r[s],null,4)}) has not two but ${o} elements!`);if(!r.every((e,t)=>!Array.isArray(e)||!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0?(s=t,!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(r[s],null,4)}) does not consist of only natural numbers!`);let a=r.length**2,i=0;return Array.from(r).sort((e,t)=>(n.progressFn&&(i+=1,n.progressFn(Math.floor(i*100/a))),e[0]===t[0]?e[1]<t[1]?-1:e[1]>t[1]?1:0:e[0]<t[0]?-1:1))}export{d as defaults,g as rSort,m as version};
10
+ var u="5.1.6";var m=u,d={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function g(t,l){if(!Array.isArray(t)||!t.length)return t;let n={...d,...l},s,o;if(n.strictlyTwoElementsInRangeArrays&&!t.every((e,r)=>!Array.isArray(e)||e.length!==2?(s=r,o=e.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(t[s],null,4)}) has not two but ${o} elements!`);if(!t.every((e,r)=>!Array.isArray(e)||!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0?(s=r,!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(t[s],null,4)}) does not consist of only natural numbers!`);let a=t.length**2,i=0;return Array.from(t).sort((e,r)=>(n.progressFn&&(i+=1,n.progressFn(Math.floor(i*100/a))),e[0]===r[0]?e[1]<r[1]?-1:e[1]>r[1]?1:0:e[0]<r[0]?-1:1))}export{d as defaults,g as rSort,m as version};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name ranges-sort
3
3
  * @fileoverview Sort string index ranges
4
- * @version 5.1.4
4
+ * @version 5.1.6
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-sort/}
8
8
  */
9
9
 
10
- "use strict";var rangesSort=(()=>{var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var d=(e,r,t)=>r in e?u(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,l=(e,r)=>{for(var t in r||(r={}))c.call(r,t)&&d(e,t,r[t]);if(p)for(var t of p(r))x.call(r,t)&&d(e,t,r[t]);return e};var b=(e,r)=>{for(var t in r)u(e,t,{get:r[t],enumerable:!0})},w=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of f(r))!c.call(e,o)&&o!==t&&u(e,o,{get:()=>r[o],enumerable:!(n=h(r,o))||n.enumerable});return e};var v=e=>w(u({},"__esModule",{value:!0}),e);var E={};b(E,{defaults:()=>m,rSort:()=>j,version:()=>I});var y="5.1.4";var I=y,m={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function j(e,r){if(!Array.isArray(e)||!e.length)return e;let t=l(l({},m),r),n,o;if(t.strictlyTwoElementsInRangeArrays&&!e.every((s,i)=>!Array.isArray(s)||s.length!==2?(n=i,o=s.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, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${o} elements!`);if(!e.every((s,i)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(n=i,!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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let g=e.length**2,a=0;return Array.from(e).sort((s,i)=>(t.progressFn&&(a+=1,t.progressFn(Math.floor(a*100/g))),s[0]===i[0]?s[1]<i[1]?-1:s[1]>i[1]?1:0:s[0]<i[0]?-1:1))}return v(E);})();
10
+ "use strict";var rangesSort=(()=>{var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var d=(e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var r in t||(t={}))c.call(t,r)&&d(e,r,t[r]);if(p)for(var r of p(t))x.call(t,r)&&d(e,r,t[r]);return e};var b=(e,t)=>{for(var r in t)u(e,r,{get:t[r],enumerable:!0})},w=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of f(t))!c.call(e,o)&&o!==r&&u(e,o,{get:()=>t[o],enumerable:!(n=h(t,o))||n.enumerable});return e};var v=e=>w(u({},"__esModule",{value:!0}),e);var E={};b(E,{defaults:()=>m,rSort:()=>I,version:()=>j});var y="5.1.6";var j=y,m={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function I(e,t){if(!Array.isArray(e)||!e.length)return e;let r=l(l({},m),t),n,o;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,i)=>!Array.isArray(s)||s.length!==2?(n=i,o=s.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, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${o} elements!`);if(!e.every((s,i)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(n=i,!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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let g=e.length**2,a=0;return Array.from(e).sort((s,i)=>(r.progressFn&&(a+=1,r.progressFn(Math.floor(a*100/g))),s[0]===i[0]?s[1]<i[1]?-1:s[1]>i[1]?1:0:s[0]<i[0]?-1:1))}return v(E);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ranges-sort",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
4
4
  "description": "Sort string index ranges",
5
5
  "keywords": [
6
6
  "array",
@@ -30,6 +30,8 @@
30
30
  "types": "types/index.d.ts",
31
31
  "scripts": {
32
32
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
33
+ "cjs-off": "exit 0",
34
+ "cjs-on": "exit 0",
33
35
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
34
36
  "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
35
37
  "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",