safe-math-ops 0.0.7 → 0.0.8
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/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/libs/subtract.d.ts +1 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import divide from "./libs/divide";
|
|
|
4
4
|
import getPow from "./libs/getPow";
|
|
5
5
|
import multiply from "./libs/multiply";
|
|
6
6
|
import replaceByInt from "./libs/replaceByInt";
|
|
7
|
-
import
|
|
8
|
-
export { add,
|
|
7
|
+
import subtract from "./libs/subtract";
|
|
8
|
+
export { add, subtract, multiply, divide, calcHighestDecimalPoint, calcDecimals, getPow, replaceByInt, };
|
|
9
9
|
declare const _default: {
|
|
10
10
|
add: typeof add;
|
|
11
|
-
|
|
11
|
+
subtract: typeof subtract;
|
|
12
12
|
multiply: typeof multiply;
|
|
13
13
|
divide: typeof divide;
|
|
14
14
|
calcHighestDecimalPoint: typeof calcHighestDecimalPoint;
|
package/dist/index.js
CHANGED
|
@@ -56,8 +56,8 @@ function replaceByInt(numbers, multiplier) {
|
|
|
56
56
|
return numbers;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// src/libs/
|
|
60
|
-
function
|
|
59
|
+
// src/libs/subtract.ts
|
|
60
|
+
function subtract(numbers) {
|
|
61
61
|
const highDecimalPoint = calcHighestDecimalPoint(numbers);
|
|
62
62
|
const multiplier = getPow(highDecimalPoint);
|
|
63
63
|
return numbers.reduce((a, b) => {
|
|
@@ -68,7 +68,7 @@ function substract(numbers) {
|
|
|
68
68
|
// src/index.ts
|
|
69
69
|
var src_default = {
|
|
70
70
|
add,
|
|
71
|
-
|
|
71
|
+
subtract,
|
|
72
72
|
multiply,
|
|
73
73
|
divide,
|
|
74
74
|
calcHighestDecimalPoint,
|
|
@@ -77,7 +77,7 @@ var src_default = {
|
|
|
77
77
|
replaceByInt
|
|
78
78
|
};
|
|
79
79
|
export {
|
|
80
|
-
|
|
80
|
+
subtract,
|
|
81
81
|
replaceByInt,
|
|
82
82
|
multiply,
|
|
83
83
|
getPow,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function subtract(numbers: number[]): number;
|
package/package.json
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
"name": "safe-math-ops",
|
|
3
3
|
"module": "src/index.ts",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.8",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@types/bun": "latest",
|
|
8
|
-
"rimraf": "^6.1.3"
|
|
8
|
+
"rimraf": "^6.1.3",
|
|
9
|
+
"tinybench": "^6.1.3"
|
|
9
10
|
},
|
|
10
11
|
"peerDependencies": {
|
|
11
12
|
"typescript": "^5"
|