mazey 5.9.0 → 5.9.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/README.md CHANGED
@@ -10,7 +10,9 @@ English | [简体中文](https://github.com/chengchuu/mazey/blob/main/README.zh-
10
10
  [l-image]: https://img.shields.io/npm/l/mazey
11
11
  [l-url]: https://github.com/chengchuu/mazey
12
12
 
13
- Mazey is a functional library for daily frontend work. There are already many excellent libraries for frontend development, but creating a file named `utils.js` or `common.js` is generally used to supply common functions in projects. It's boring to copy similar functions across multiple projects. That's why I've created this library and will keep updating it to serve as a reliable resource for frontend needs.
13
+ Mazey is a utility library for everyday frontend development. It provides
14
+ reusable functions that would otherwise be duplicated across project-specific
15
+ `utils.js` or `common.js` files.
14
16
 
15
17
  - [Project website](https://chengchuu.github.io/mazey/)
16
18
  - [Live playground](https://chengchuu.github.io/mazey/playground/)
@@ -34,41 +36,28 @@ You can also download and serve the
34
36
  [latest browser bundle](https://cdn.jsdelivr.net/npm/mazey@latest/lib/mazey.min.js)
35
37
  yourself.
36
38
 
37
- ## Browser support
38
-
39
- Mazey supports Chrome 109+, Edge 109+, Firefox 115+, Safari 16.4+, iOS Safari
40
- 16.4+, Android Chrome 109+, and Samsung Internet 21+. Package output can
41
- contain ES2022 syntax and does not include JavaScript polyfills. Internet
42
- Explorer, Opera Mini, KaiOS, the legacy Android Browser, and older browser
43
- versions are outside this support policy.
44
-
45
- Node.js 22 is used for development and continuous integration. Mazey does not
46
- declare a Node.js runtime compatibility range.
47
-
48
39
  ## Usage
49
40
 
50
- Example: Use a function to verify if a value is a number suitable for standard calculations and comparisons.
41
+ Example: Format a duration in milliseconds as readable text.
51
42
 
52
- Import from [npm](https://www.npmjs.com/package/mazey).
43
+ Import Mazey from [npm](https://www.npmjs.com/package/mazey).
53
44
 
54
45
  ```javascript
55
- import { isNumber } from "mazey";
46
+ import { formatDurationFromMs } from "mazey";
47
+
48
+ const duration = formatDurationFromMs(90000);
56
49
 
57
- const x = 123;
58
- const y = "abc";
59
- const z = Infinity;
60
- isNumber(x); // Output: true
61
- isNumber(y); // Output: false
62
- isNumber(z, { isInfinityAsNumber: true }); // Output: true
50
+ console.log(duration); // Output: "1.5 minutes"
63
51
  ```
64
52
 
65
- Import from CDN.
53
+ Use Mazey from CDN.
66
54
 
67
55
  ```html
68
56
  <script src="https://cdn.jsdelivr.net/npm/mazey@latest/lib/mazey.min.js"></script>
69
57
  <script>
70
- const x = 123;
71
- mazey.isNumber(x); // Output: true
58
+ const duration = mazey.formatDurationFromMs(90000);
59
+
60
+ console.log(duration); // Output: "1.5 minutes"
72
61
  </script>
73
62
  ```
74
63
 
@@ -2023,6 +2012,14 @@ MazeyLog: I am number. 123 456
2023
2012
  MazeyLog: I am object. {a: 123, b: 456}
2024
2013
  ```
2025
2014
 
2015
+ ## Browser support
2016
+
2017
+ Mazey supports Chrome 109+, Edge 109+, Firefox 115+, Safari 16.4+, iOS Safari
2018
+ 16.4+, Android Chrome 109+, and Samsung Internet 21+. Package output can
2019
+ contain ES2022 syntax and does not include JavaScript polyfills. Internet
2020
+ Explorer, Opera Mini, KaiOS, the legacy Android Browser, and older browser
2021
+ versions are outside this support policy.
2022
+
2026
2023
  ## Contributing
2027
2024
 
2028
2025
  ### Development Environment
@@ -2036,7 +2033,7 @@ MazeyLog: I am object. {a: 123, b: 456}
2036
2033
 
2037
2034
  | Command | Purpose |
2038
2035
  | --------------------- | --------------------------------------------------------------- |
2039
- | `npm install` | Install development dependencies. |
2036
+ | `pnpm install` | Install development dependencies. |
2040
2037
  | `npm run dev` | Start the website and playground development server. |
2041
2038
  | `npm run build` | Build the publishable package files. |
2042
2039
  | `npm test` | Run the Jest test suite. |
package/lib/index.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Mazey v5.9.0 https://github.com/chengchuu/mazey
2
+ * Mazey v5.9.1 https://github.com/chengchuu/mazey
3
3
  * (c) 2018-2026 Cheng
4
4
  * Released under the MIT License.
5
5
  */
package/lib/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Mazey v5.9.0 https://github.com/chengchuu/mazey
2
+ * Mazey v5.9.1 https://github.com/chengchuu/mazey
3
3
  * (c) 2018-2026 Cheng
4
4
  * Released under the MIT License.
5
5
  */
package/lib/mazey.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Mazey v5.9.0 https://github.com/chengchuu/mazey
2
+ * Mazey v5.9.1 https://github.com/chengchuu/mazey
3
3
  * (c) 2018-2026 Cheng
4
4
  * Released under the MIT License.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mazey",
3
- "version": "5.9.0",
3
+ "version": "5.9.1",
4
4
  "description": "A functional library for daily frontend work.",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",
@@ -106,6 +106,7 @@
106
106
  "@testing-library/react": "^16.3.2",
107
107
  "@testing-library/user-event": "^14.6.1",
108
108
  "@types/jest": "^29.5.14",
109
+ "@types/node": "^22.20.1",
109
110
  "@types/react": "^19.2.17",
110
111
  "@types/react-dom": "^19.2.3",
111
112
  "@typescript-eslint/eslint-plugin": "^6.12.0",