math-labs 1.1.0 → 2.0.1

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/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ declare class MathUtils {
2
+ add(a: number, b: number): number;
3
+ subtract(a: number, b: number): number;
4
+ multiply(a: number, b: number): number;
5
+ divide(a: number, b: number): number;
6
+ modulus(a: number, b: number): number;
7
+ power(a: number, b: number): number;
8
+ }
9
+
10
+ declare const math: MathUtils;
11
+
12
+ export default math;
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
- const MathUtils = require("./src/math");
2
-
3
- module.exports = new MathUtils();
1
+ import { MathUtils } from "./src/math.js";
2
+ const math = new MathUtils();
3
+ export default math;
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "math-labs",
3
- "version": "1.1.0",
3
+ "version": "2.0.1",
4
4
  "description": "Simple math utility package",
5
5
  "main": "index.js",
6
+ "type": "module",
7
+ "types": "index.d.ts",
6
8
  "keywords": [
7
9
  "math",
8
10
  "utils",
@@ -11,6 +13,6 @@
11
13
  "author": "Your Name",
12
14
  "license": "MIT",
13
15
  "dependencies": {
14
- "math-labs": "^1.0.0"
16
+ "math-labs": "^1.1.0"
15
17
  }
16
18
  }
package/src/math.js CHANGED
@@ -1,4 +1,4 @@
1
- class MathUtils {
1
+ export class MathUtils {
2
2
  add(a, b) {
3
3
  return a + b;
4
4
  }
@@ -26,5 +26,3 @@ class MathUtils {
26
26
  return Math.pow(a, b);
27
27
  }
28
28
  }
29
-
30
- module.exports = MathUtils;
package/test.js CHANGED
@@ -1,4 +1,4 @@
1
- const math = require("math-labs");
1
+ import math from "math-labs";
2
2
  console.log(math.add(10, 20));
3
- console.log(math.divide(10,11));
4
- // console.log(math.);
3
+ console.log(math.divide(10, 11));
4
+ console.log(math.modulus(10, 3));