@tutao/tutanota-utils 3.89.17 → 3.89.22

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.
Files changed (2) hide show
  1. package/lib/MathUtils.js +12 -0
  2. package/package.json +2 -2
@@ -0,0 +1,12 @@
1
+ // @flow
2
+
3
+ export function mod(n: number, m: number): number {
4
+ return ((n % m) + m) % m;
5
+ }
6
+
7
+ /**
8
+ * Clamp value to between min and max (inclusive)
9
+ */
10
+ export function clamp(value: number, min: number, max: number): number {
11
+ return Math.max(min, Math.min(value, max))
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tutao/tutanota-utils",
3
- "version": "3.89.17",
3
+ "version": "3.89.22",
4
4
  "license": "GPL-3.0",
5
5
  "main": "./lib/index.js",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "@rollup/plugin-node-resolve": "11.0.1",
30
30
  "flow-bin": "0.152.0",
31
31
  "rollup": "2.55.1",
32
- "@tutao/tutanota-test-utils": "3.89.17",
32
+ "@tutao/tutanota-test-utils": "3.89.22",
33
33
  "ospec": "https://github.com/tutao/ospec.git#0472107629ede33be4c4d19e89f237a6d7b0cb11"
34
34
  }
35
35
  }