@thi.ng/math 5.5.4 → 5.6.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-08-12T13:14:08Z
3
+ - **Last updated**: 2023-08-24T05:28:47Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ## [5.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/math@5.6.0) (2023-08-24)
13
+
14
+ #### 🚀 Features
15
+
16
+ - add minMax() ([76ca59d](https://github.com/thi-ng/umbrella/commit/76ca59d))
17
+
12
18
  ## [5.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/math@5.5.0) (2023-07-14)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
9
9
 
10
10
  This project is part of the
11
- [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
11
+ [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo and anti-framework.
12
12
 
13
13
  For the Clojure version, please visit: [thi.ng/math-clj](https://thi.ng/math-clj)
14
14
 
package/interval.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { FnN, FnN2, FnN3, FnN4, FnU3 } from "@thi.ng/api";
1
+ import type { FnN, FnN2, FnN3, FnN4, FnU2, FnU3 } from "@thi.ng/api";
2
2
  /**
3
3
  * Clamps value `x` to given closed interval.
4
4
  *
@@ -31,6 +31,13 @@ export declare const clamp11: FnN;
31
31
  * @param x -
32
32
  */
33
33
  export declare const clamp05: FnN;
34
+ /**
35
+ * Returns 2-tuple of [min(x,y), max(x,y)].
36
+ *
37
+ * @param x
38
+ * @param y
39
+ */
40
+ export declare const minMax: FnU2<number, [number, number]>;
34
41
  /**
35
42
  * Folds `x` back inside closed [min..max] interval. Also see
36
43
  * {@link wrapOnce}.
package/interval.js CHANGED
@@ -30,6 +30,13 @@ export const clamp11 = (x) => (x < -1 ? -1 : x > 1 ? 1 : x);
30
30
  * @param x -
31
31
  */
32
32
  export const clamp05 = (x) => (x < 0 ? 0 : x > 0.5 ? 0.5 : x);
33
+ /**
34
+ * Returns 2-tuple of [min(x,y), max(x,y)].
35
+ *
36
+ * @param x
37
+ * @param y
38
+ */
39
+ export const minMax = (x, y) => x < y ? [x, y] : [y, x];
33
40
  /**
34
41
  * Folds `x` back inside closed [min..max] interval. Also see
35
42
  * {@link wrapOnce}.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/math",
3
- "version": "5.5.4",
3
+ "version": "5.6.0",
4
4
  "description": "Assorted common math functions & utilities",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -37,11 +37,11 @@
37
37
  "test": "testament test"
38
38
  },
39
39
  "dependencies": {
40
- "@thi.ng/api": "^8.9.3"
40
+ "@thi.ng/api": "^8.9.4"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@microsoft/api-extractor": "^7.36.4",
44
- "@thi.ng/testament": "^0.3.21",
44
+ "@thi.ng/testament": "^0.3.22",
45
45
  "rimraf": "^5.0.1",
46
46
  "tools": "^0.0.1",
47
47
  "typedoc": "^0.24.8",
@@ -138,5 +138,5 @@
138
138
  "thi.ng": {
139
139
  "year": 2013
140
140
  },
141
- "gitHead": "399f8c53d66b9b763d16c21bb59f145df5f59514\n"
141
+ "gitHead": "04f545c7be1811ed24be1a6824d867b1ea9bded1\n"
142
142
  }