@react-hive/honey-utils 4.0.0 → 4.2.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/README.md +80 -6
- package/dist/README.md +80 -6
- package/dist/array/index.d.ts +1 -0
- package/dist/array/toggle-array-item.d.ts +26 -0
- package/dist/dom/history.d.ts +24 -0
- package/dist/dom/index.d.ts +1 -0
- package/dist/encoding/encode-base64-json.d.ts +1 -0
- package/dist/encoding/encode-base64.d.ts +1 -0
- package/dist/encoding/index.d.ts +2 -0
- package/dist/guards.d.ts +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +256 -45
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/math/clamp.d.ts +18 -0
- package/dist/math/index.d.ts +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Restricts a number to the inclusive range between `min` and `max`.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The number to restrict.
|
|
5
|
+
* @param min - The lower bound.
|
|
6
|
+
* @param max - The upper bound. Wins over `min` when the two cross.
|
|
7
|
+
*
|
|
8
|
+
* @returns `min` when the value is below it, `max` when the value is above it, and the value
|
|
9
|
+
* itself otherwise.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* clamp(5, 0, 10); // 5
|
|
14
|
+
* clamp(-3, 0, 10); // 0
|
|
15
|
+
* clamp(42, 0, 10); // 10
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
package/dist/math/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-hive/honey-utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "A lightweight TypeScript utility library providing a collection of helper functions for common programming tasks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"utils",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@eslint/js": "10.0.1",
|
|
44
44
|
"@mdx-js/loader": "3.1.1",
|
|
45
|
-
"@types/node": "24.
|
|
45
|
+
"@types/node": "24.19.0",
|
|
46
46
|
"copy-webpack-plugin": "14.0.0",
|
|
47
|
-
"eslint": "10.
|
|
48
|
-
"prettier": "3.
|
|
49
|
-
"ts-loader": "9.
|
|
47
|
+
"eslint": "10.11.0",
|
|
48
|
+
"prettier": "3.9.9",
|
|
49
|
+
"ts-loader": "9.6.2",
|
|
50
50
|
"typescript": "6.0.3",
|
|
51
|
-
"typescript-eslint": "8.
|
|
52
|
-
"vitest": "
|
|
53
|
-
"webpack": "5.
|
|
54
|
-
"webpack-cli": "7.
|
|
51
|
+
"typescript-eslint": "8.71.0",
|
|
52
|
+
"vitest": "5.0.3",
|
|
53
|
+
"webpack": "5.111.1",
|
|
54
|
+
"webpack-cli": "7.2.3"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"clean": "rm -rf dist coverage",
|