summaryrefslogtreecommitdiff
path: root/alarm/node_modules/ranges-sort/dist
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
committerMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
commit99c1d9af689e5325f3cf535c4007b3aeb8325229 (patch)
treee663b3c2ebdbd67c818ac0c5147f0ce1d2463cda /alarm/node_modules/ranges-sort/dist
parent9871b03912fc28ad38b4037ebf26a78aa937baba (diff)
downloadpluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.gz
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.bz2
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.zip
Update - This is an automated commit
Diffstat (limited to 'alarm/node_modules/ranges-sort/dist')
-rw-r--r--alarm/node_modules/ranges-sort/dist/ranges-sort.cjs.js86
-rw-r--r--alarm/node_modules/ranges-sort/dist/ranges-sort.dev.umd.js94
-rw-r--r--alarm/node_modules/ranges-sort/dist/ranges-sort.esm.js68
-rw-r--r--alarm/node_modules/ranges-sort/dist/ranges-sort.umd.js10
4 files changed, 0 insertions, 258 deletions
diff --git a/alarm/node_modules/ranges-sort/dist/ranges-sort.cjs.js b/alarm/node_modules/ranges-sort/dist/ranges-sort.cjs.js
deleted file mode 100644
index 03dde06..0000000
--- a/alarm/node_modules/ranges-sort/dist/ranges-sort.cjs.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @name ranges-sort
- * @fileoverview Sort string index ranges
- * @version 4.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-sort/}
- */
-
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
-
-function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
-
-var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
-
-var version$1 = "4.1.0";
-
-var version = version$1;
-var defaults = {
- strictlyTwoElementsInRangeArrays: false,
- progressFn: null
-};
-function rSort(arrOfRanges, originalOptions) {
- if (!Array.isArray(arrOfRanges) || !arrOfRanges.length) {
- return arrOfRanges;
- }
- var opts = _objectSpread__default['default'](_objectSpread__default['default']({}, defaults), originalOptions);
- var culpritsIndex;
- var culpritsLen;
- if (opts.strictlyTwoElementsInRangeArrays && !arrOfRanges.filter(function (range) {
- return range;
- }).every(function (rangeArr, indx) {
- if (rangeArr.length !== 2) {
- culpritsIndex = indx;
- culpritsLen = rangeArr.length;
- return false;
- }
- return true;
- })) {
- 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, ".concat(culpritsIndex, "th range (").concat(JSON.stringify(arrOfRanges[culpritsIndex], null, 4), ") has not two but ").concat(culpritsLen, " elements!"));
- }
- if (!arrOfRanges.filter(function (range) {
- return range;
- }).every(function (rangeArr, indx) {
- if (!Number.isInteger(rangeArr[0]) || rangeArr[0] < 0 || !Number.isInteger(rangeArr[1]) || rangeArr[1] < 0) {
- culpritsIndex = indx;
- return false;
- }
- return true;
- })) {
- 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, ".concat(culpritsIndex, "th range (").concat(JSON.stringify(arrOfRanges[culpritsIndex], null, 4), ") does not consist of only natural numbers!"));
- }
- var maxPossibleIterations = Math.pow(arrOfRanges.filter(function (range) {
- return range;
- }).length, 2);
- var counter = 0;
- return Array.from(arrOfRanges).filter(function (range) {
- return range;
- }).sort(function (range1, range2) {
- if (opts.progressFn) {
- counter += 1;
- opts.progressFn(Math.floor(counter * 100 / maxPossibleIterations));
- }
- if (range1[0] === range2[0]) {
- if (range1[1] < range2[1]) {
- return -1;
- }
- if (range1[1] > range2[1]) {
- return 1;
- }
- return 0;
- }
- if (range1[0] < range2[0]) {
- return -1;
- }
- return 1;
- });
-}
-
-exports.defaults = defaults;
-exports.rSort = rSort;
-exports.version = version;
diff --git a/alarm/node_modules/ranges-sort/dist/ranges-sort.dev.umd.js b/alarm/node_modules/ranges-sort/dist/ranges-sort.dev.umd.js
deleted file mode 100644
index ea07705..0000000
--- a/alarm/node_modules/ranges-sort/dist/ranges-sort.dev.umd.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @name ranges-sort
- * @fileoverview Sort string index ranges
- * @version 4.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-sort/}
- */
-
-(function (global, factory) {
-typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
-typeof define === 'function' && define.amd ? define(['exports'], factory) :
-(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.rangesSort = {}));
-}(this, (function (exports) { 'use strict';
-
-var version$1 = "4.1.0";
-
-const version = version$1;
-const defaults = {
- strictlyTwoElementsInRangeArrays: false,
- progressFn: null,
-};
-function rSort(arrOfRanges, originalOptions) {
- // quick ending
- if (!Array.isArray(arrOfRanges) || !arrOfRanges.length) {
- return arrOfRanges;
- }
- // fill any settings with defaults if missing:
- const opts = { ...defaults, ...originalOptions };
- // arrOfRanges validation
- let culpritsIndex;
- let culpritsLen;
- // validate does every range consist of exactly two indexes:
- if (opts.strictlyTwoElementsInRangeArrays &&
- !arrOfRanges
- .filter((range) => range)
- .every((rangeArr, indx) => {
- if (rangeArr.length !== 2) {
- culpritsIndex = indx;
- culpritsLen = rangeArr.length;
- return false;
- }
- return true;
- })) {
- 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, ${culpritsIndex}th range (${JSON.stringify(arrOfRanges[culpritsIndex], null, 4)}) has not two but ${culpritsLen} elements!`);
- }
- // validate are range indexes natural numbers:
- if (!arrOfRanges
- .filter((range) => range)
- .every((rangeArr, indx) => {
- if (!Number.isInteger(rangeArr[0]) ||
- rangeArr[0] < 0 ||
- !Number.isInteger(rangeArr[1]) ||
- rangeArr[1] < 0) {
- culpritsIndex = indx;
- return false;
- }
- return true;
- })) {
- 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, ${culpritsIndex}th range (${JSON.stringify(arrOfRanges[culpritsIndex], null, 4)}) does not consist of only natural numbers!`);
- }
- // let's assume worst case scenario is N x N.
- const maxPossibleIterations = arrOfRanges.filter((range) => range).length ** 2;
- let counter = 0;
- return Array.from(arrOfRanges)
- .filter((range) => range)
- .sort((range1, range2) => {
- if (opts.progressFn) {
- counter += 1;
- opts.progressFn(Math.floor((counter * 100) / maxPossibleIterations));
- }
- if (range1[0] === range2[0]) {
- if (range1[1] < range2[1]) {
- return -1;
- }
- if (range1[1] > range2[1]) {
- return 1;
- }
- return 0;
- }
- if (range1[0] < range2[0]) {
- return -1;
- }
- return 1;
- });
-}
-
-exports.defaults = defaults;
-exports.rSort = rSort;
-exports.version = version;
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
diff --git a/alarm/node_modules/ranges-sort/dist/ranges-sort.esm.js b/alarm/node_modules/ranges-sort/dist/ranges-sort.esm.js
deleted file mode 100644
index 31f0662..0000000
--- a/alarm/node_modules/ranges-sort/dist/ranges-sort.esm.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @name ranges-sort
- * @fileoverview Sort string index ranges
- * @version 4.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-sort/}
- */
-
-var version$1 = "4.1.0";
-
-const version = version$1;
-const defaults = {
- strictlyTwoElementsInRangeArrays: false,
- progressFn: null
-};
-function rSort(arrOfRanges, originalOptions) {
- if (!Array.isArray(arrOfRanges) || !arrOfRanges.length) {
- return arrOfRanges;
- }
- const opts = { ...defaults,
- ...originalOptions
- };
- let culpritsIndex;
- let culpritsLen;
- if (opts.strictlyTwoElementsInRangeArrays && !arrOfRanges.filter(range => range).every((rangeArr, indx) => {
- if (rangeArr.length !== 2) {
- culpritsIndex = indx;
- culpritsLen = rangeArr.length;
- return false;
- }
- return true;
- })) {
- 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, ${culpritsIndex}th range (${JSON.stringify(arrOfRanges[culpritsIndex], null, 4)}) has not two but ${culpritsLen} elements!`);
- }
- if (!arrOfRanges.filter(range => range).every((rangeArr, indx) => {
- if (!Number.isInteger(rangeArr[0]) || rangeArr[0] < 0 || !Number.isInteger(rangeArr[1]) || rangeArr[1] < 0) {
- culpritsIndex = indx;
- return false;
- }
- return true;
- })) {
- 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, ${culpritsIndex}th range (${JSON.stringify(arrOfRanges[culpritsIndex], null, 4)}) does not consist of only natural numbers!`);
- }
- const maxPossibleIterations = arrOfRanges.filter(range => range).length ** 2;
- let counter = 0;
- return Array.from(arrOfRanges).filter(range => range).sort((range1, range2) => {
- if (opts.progressFn) {
- counter += 1;
- opts.progressFn(Math.floor(counter * 100 / maxPossibleIterations));
- }
- if (range1[0] === range2[0]) {
- if (range1[1] < range2[1]) {
- return -1;
- }
- if (range1[1] > range2[1]) {
- return 1;
- }
- return 0;
- }
- if (range1[0] < range2[0]) {
- return -1;
- }
- return 1;
- });
-}
-
-export { defaults, rSort, version };
diff --git a/alarm/node_modules/ranges-sort/dist/ranges-sort.umd.js b/alarm/node_modules/ranges-sort/dist/ranges-sort.umd.js
deleted file mode 100644
index 2be317f..0000000
--- a/alarm/node_modules/ranges-sort/dist/ranges-sort.umd.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * @name ranges-sort
- * @fileoverview Sort string index ranges
- * @version 4.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-sort/}
- */
-
-!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).rangesSort={})}(this,(function(e){"use strict";const r={strictlyTwoElementsInRangeArrays:!1,progressFn:null};e.defaults=r,e.rSort=function(e,n){if(!Array.isArray(e)||!e.length)return e;const t={...r,...n};let s,o;if(t.strictlyTwoElementsInRangeArrays&&!e.filter((e=>e)).every(((e,r)=>2===e.length||(s=r,o=e.length,!1))))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 ${o} elements!`);if(!e.filter((e=>e)).every(((e,r)=>!(!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0)||(s=r,!1))))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!`);const i=e.filter((e=>e)).length**2;let a=0;return Array.from(e).filter((e=>e)).sort(((e,r)=>(t.progressFn&&(a+=1,t.progressFn(Math.floor(100*a/i))),e[0]===r[0]?e[1]<r[1]?-1:e[1]>r[1]?1:0:e[0]<r[0]?-1:1)))},e.version="4.1.0",Object.defineProperty(e,"__esModule",{value:!0})}));