ranges-sort 5.1.1 → 5.1.2
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/CHANGELOG.md +21 -21
- package/dist/ranges-sort.esm.js +2 -2
- package/dist/ranges-sort.umd.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -78,58 +78,58 @@ Accidental version bump during migration to sourcehut. Sorry about that.
|
|
|
78
78
|
|
|
79
79
|
## 3.10.0 (2019-01-20)
|
|
80
80
|
|
|
81
|
-
-
|
|
82
|
-
-
|
|
81
|
+
- Various documentation and setup tweaks after we migrated to monorepo
|
|
82
|
+
- Setup refresh: updated dependencies and all config files using automated tools
|
|
83
83
|
|
|
84
84
|
## 3.6.0 (2018-12-26)
|
|
85
85
|
|
|
86
|
-
-
|
|
86
|
+
- Add `opts.progressFn` ([09de99c](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-sort/commits/09de99c))
|
|
87
87
|
|
|
88
88
|
## 3.5.0 (2018-11-29)
|
|
89
89
|
|
|
90
|
-
-
|
|
90
|
+
- Add `opts.progressFn` - if you pass a function, it will report the progress, calling that function with a number between `0` and `100`. It's not precise and meant to be used as an approximate progress indicator.
|
|
91
91
|
|
|
92
92
|
## 3.4.0 (2018-10-25)
|
|
93
93
|
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
94
|
+
- Updated all dependencies
|
|
95
|
+
- Restored coveralls.io reporting
|
|
96
|
+
- Restored unit test linting
|
|
97
97
|
|
|
98
98
|
## 3.3.0 (2018-06-11)
|
|
99
99
|
|
|
100
100
|
GitHub sold us out. In the meantime, we:
|
|
101
101
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
102
|
+
- Migrated to BitBucket (to host repo + perform CI) and Codacy (for code quality audit)
|
|
103
|
+
- Dropped BitHound (RIP) and Travis
|
|
104
|
+
- Removed `package-lock`
|
|
105
105
|
|
|
106
106
|
## 3.2.0 (2018-05-26)
|
|
107
107
|
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
108
|
+
- Set up [Prettier](https://prettier.io) on a custom ESLint rule set.
|
|
109
|
+
- Removed `package.lock` and `.editorconfig`
|
|
110
|
+
- Wired Rollup to remove comments from non-dev builds. This means we can now leave the `console.log`s in the source code — there's no need to comment-out `console.log` statements or care about them not spilling into production. Now it's done automatically.
|
|
111
|
+
- Unit tests are pointing at ES modules build, which means that code coverage is correct now, without Babel functions being missed. This is important because now code coverage is real again and now there are no excuses not to perfect it.
|
|
112
112
|
|
|
113
113
|
## 3.1.0 (2018-01-10)
|
|
114
114
|
|
|
115
|
-
-
|
|
115
|
+
- Updated all dependencies and setup in general
|
|
116
116
|
|
|
117
117
|
## 3.0.0 (2017-12-03)
|
|
118
118
|
|
|
119
|
-
-
|
|
120
|
-
-
|
|
119
|
+
- Set up Rollup, generating three builds: CommonJS, UMD and ES Modules
|
|
120
|
+
- Rebase the code to be natively in ES Modules
|
|
121
121
|
|
|
122
122
|
**PS. Bumping major just in case this breaks API endpoints.**
|
|
123
123
|
|
|
124
124
|
## 2.1.0 (2017-09-13)
|
|
125
125
|
|
|
126
|
-
-
|
|
127
|
-
-
|
|
126
|
+
- Add more description in readme
|
|
127
|
+
- Add more unit tests, including tests for examples used in readme
|
|
128
128
|
|
|
129
129
|
## 2.0.0 (2017-09-12)
|
|
130
130
|
|
|
131
|
-
-
|
|
131
|
+
- Add `opts.strictlyTwoElementsInRangeArrays` (default is `false`, differently from v1 which is opposite)
|
|
132
132
|
|
|
133
133
|
## 1.0.0 (2017-09-11)
|
|
134
134
|
|
|
135
|
-
-
|
|
135
|
+
- Initial release
|
package/dist/ranges-sort.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ranges-sort
|
|
3
3
|
* @fileoverview Sort string index ranges
|
|
4
|
-
* @version 5.1.
|
|
4
|
+
* @version 5.1.2
|
|
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.
|
|
10
|
+
var u="5.1.2";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};
|
package/dist/ranges-sort.umd.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ranges-sort
|
|
3
3
|
* @fileoverview Sort string index ranges
|
|
4
|
-
* @version 5.1.
|
|
4
|
+
* @version 5.1.2
|
|
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.
|
|
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.2";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);})();
|