@rh-support/utils 0.2.17 → 0.2.19
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/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +0 -1
- package/lib/esm/index.d.ts +0 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +0 -1
- package/package.json +2 -2
- package/lib/cjs/outlier.d.ts +0 -16
- package/lib/cjs/outlier.d.ts.map +0 -1
- package/lib/cjs/outlier.js +0 -48
- package/lib/esm/outlier.d.ts +0 -16
- package/lib/esm/outlier.d.ts.map +0 -1
- package/lib/esm/outlier.js +0 -44
package/lib/cjs/index.d.ts
CHANGED
package/lib/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
|
package/lib/cjs/index.js
CHANGED
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
|
package/lib/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/utils",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"@types/react-dom": "^17.0.9",
|
|
88
88
|
"moment-timezone": "^0.5.32"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "230218b05ecdb08d048db04a7f8fcb6646b4fa35"
|
|
91
91
|
}
|
package/lib/cjs/outlier.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Outlier Function
|
|
3
|
-
* Refer: https://www.cuemath.com/outlier-formula/
|
|
4
|
-
*
|
|
5
|
-
* An outlier function which takers array of number and find high outlier and low outlier
|
|
6
|
-
* 1. Taker array of number and sort then in ascending order.
|
|
7
|
-
* 2. Calculate first(q1) and third(q3) quartile.
|
|
8
|
-
* 3. Calculate inter-quartile(iqr) range (q3-q1).
|
|
9
|
-
* 4. Find the upper boundary value by formula q3 + iqr*1.5.
|
|
10
|
-
* 5. Find the lower boundary value by formula q1 - iqr*1.5
|
|
11
|
-
*
|
|
12
|
-
* @param {number[]} numbers
|
|
13
|
-
* @returns {number[]} upper and lower boundary value
|
|
14
|
-
*/
|
|
15
|
-
export declare const outlier: (array: Array<number>) => Array<number>;
|
|
16
|
-
//# sourceMappingURL=outlier.d.ts.map
|
package/lib/cjs/outlier.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outlier.d.ts","sourceRoot":"","sources":["../../src/outlier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,OAAO,UAAW,MAAM,MAAM,CAAC,KAAG,MAAM,MAAM,CAkC1D,CAAC"}
|
package/lib/cjs/outlier.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Outlier Function
|
|
4
|
-
* Refer: https://www.cuemath.com/outlier-formula/
|
|
5
|
-
*
|
|
6
|
-
* An outlier function which takers array of number and find high outlier and low outlier
|
|
7
|
-
* 1. Taker array of number and sort then in ascending order.
|
|
8
|
-
* 2. Calculate first(q1) and third(q3) quartile.
|
|
9
|
-
* 3. Calculate inter-quartile(iqr) range (q3-q1).
|
|
10
|
-
* 4. Find the upper boundary value by formula q3 + iqr*1.5.
|
|
11
|
-
* 5. Find the lower boundary value by formula q1 - iqr*1.5
|
|
12
|
-
*
|
|
13
|
-
* @param {number[]} numbers
|
|
14
|
-
* @returns {number[]} upper and lower boundary value
|
|
15
|
-
*/
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.outlier = void 0;
|
|
18
|
-
var outlier = function (array) {
|
|
19
|
-
// Take array length
|
|
20
|
-
var arrayLength = array.length;
|
|
21
|
-
// Check if length is smaller than four then return array result as it is
|
|
22
|
-
if (arrayLength < 4) {
|
|
23
|
-
return array;
|
|
24
|
-
}
|
|
25
|
-
var q1, q3, iqr, upperBoundary, lowerBoundary;
|
|
26
|
-
// Make a copy of array plus sort it in ascending order
|
|
27
|
-
var sortedArray = array.slice().sort(function (a, b) { return a - b; });
|
|
28
|
-
// Find the quartiles range
|
|
29
|
-
// If median is odd adjust the index by minus one
|
|
30
|
-
if (((arrayLength - 1) / 4) % 1 === 0 || (arrayLength / 4) % 1 === 0) {
|
|
31
|
-
q1 = (1 / 2) * (sortedArray[Math.floor(arrayLength / 4) - 1] + sortedArray[Math.floor(arrayLength / 4)]);
|
|
32
|
-
q3 =
|
|
33
|
-
(1 / 2) *
|
|
34
|
-
(sortedArray[Math.ceil(arrayLength * (3 / 4)) - 1] + sortedArray[Math.ceil(arrayLength * (3 / 4))]);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
q1 = sortedArray[Math.floor(arrayLength / 4)];
|
|
38
|
-
q3 = sortedArray[Math.floor(arrayLength * (3 / 4))];
|
|
39
|
-
}
|
|
40
|
-
// Calculate inter-quartile range
|
|
41
|
-
iqr = q3 - q1;
|
|
42
|
-
// upper boundary
|
|
43
|
-
upperBoundary = q3 + iqr * 1.5;
|
|
44
|
-
// lower boundary
|
|
45
|
-
lowerBoundary = q1 - iqr * 1.5;
|
|
46
|
-
return [upperBoundary, lowerBoundary];
|
|
47
|
-
};
|
|
48
|
-
exports.outlier = outlier;
|
package/lib/esm/outlier.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Outlier Function
|
|
3
|
-
* Refer: https://www.cuemath.com/outlier-formula/
|
|
4
|
-
*
|
|
5
|
-
* An outlier function which takers array of number and find high outlier and low outlier
|
|
6
|
-
* 1. Taker array of number and sort then in ascending order.
|
|
7
|
-
* 2. Calculate first(q1) and third(q3) quartile.
|
|
8
|
-
* 3. Calculate inter-quartile(iqr) range (q3-q1).
|
|
9
|
-
* 4. Find the upper boundary value by formula q3 + iqr*1.5.
|
|
10
|
-
* 5. Find the lower boundary value by formula q1 - iqr*1.5
|
|
11
|
-
*
|
|
12
|
-
* @param {number[]} numbers
|
|
13
|
-
* @returns {number[]} upper and lower boundary value
|
|
14
|
-
*/
|
|
15
|
-
export declare const outlier: (array: Array<number>) => Array<number>;
|
|
16
|
-
//# sourceMappingURL=outlier.d.ts.map
|
package/lib/esm/outlier.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outlier.d.ts","sourceRoot":"","sources":["../../src/outlier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,OAAO,UAAW,MAAM,MAAM,CAAC,KAAG,MAAM,MAAM,CAkC1D,CAAC"}
|
package/lib/esm/outlier.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Outlier Function
|
|
3
|
-
* Refer: https://www.cuemath.com/outlier-formula/
|
|
4
|
-
*
|
|
5
|
-
* An outlier function which takers array of number and find high outlier and low outlier
|
|
6
|
-
* 1. Taker array of number and sort then in ascending order.
|
|
7
|
-
* 2. Calculate first(q1) and third(q3) quartile.
|
|
8
|
-
* 3. Calculate inter-quartile(iqr) range (q3-q1).
|
|
9
|
-
* 4. Find the upper boundary value by formula q3 + iqr*1.5.
|
|
10
|
-
* 5. Find the lower boundary value by formula q1 - iqr*1.5
|
|
11
|
-
*
|
|
12
|
-
* @param {number[]} numbers
|
|
13
|
-
* @returns {number[]} upper and lower boundary value
|
|
14
|
-
*/
|
|
15
|
-
export const outlier = (array) => {
|
|
16
|
-
// Take array length
|
|
17
|
-
const arrayLength = array.length;
|
|
18
|
-
// Check if length is smaller than four then return array result as it is
|
|
19
|
-
if (arrayLength < 4) {
|
|
20
|
-
return array;
|
|
21
|
-
}
|
|
22
|
-
let q1, q3, iqr, upperBoundary, lowerBoundary;
|
|
23
|
-
// Make a copy of array plus sort it in ascending order
|
|
24
|
-
const sortedArray = array.slice().sort((a, b) => a - b);
|
|
25
|
-
// Find the quartiles range
|
|
26
|
-
// If median is odd adjust the index by minus one
|
|
27
|
-
if (((arrayLength - 1) / 4) % 1 === 0 || (arrayLength / 4) % 1 === 0) {
|
|
28
|
-
q1 = (1 / 2) * (sortedArray[Math.floor(arrayLength / 4) - 1] + sortedArray[Math.floor(arrayLength / 4)]);
|
|
29
|
-
q3 =
|
|
30
|
-
(1 / 2) *
|
|
31
|
-
(sortedArray[Math.ceil(arrayLength * (3 / 4)) - 1] + sortedArray[Math.ceil(arrayLength * (3 / 4))]);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
q1 = sortedArray[Math.floor(arrayLength / 4)];
|
|
35
|
-
q3 = sortedArray[Math.floor(arrayLength * (3 / 4))];
|
|
36
|
-
}
|
|
37
|
-
// Calculate inter-quartile range
|
|
38
|
-
iqr = q3 - q1;
|
|
39
|
-
// upper boundary
|
|
40
|
-
upperBoundary = q3 + iqr * 1.5;
|
|
41
|
-
// lower boundary
|
|
42
|
-
lowerBoundary = q1 - iqr * 1.5;
|
|
43
|
-
return [upperBoundary, lowerBoundary];
|
|
44
|
-
};
|