@mui/utils 5.15.9 → 5.15.12

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * WARNING: Don't import this directly.
3
- * Use `MuiError` from `@mui-internal/babel-macros/MuiError.macro` instead.
3
+ * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
4
4
  * @param {number} code
5
5
  */
6
6
  export default function formatMuiErrorMessage(code: number): string;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * WARNING: Don't import this directly.
3
- * Use `MuiError` from `@mui-internal/babel-macros/MuiError.macro` instead.
3
+ * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
4
4
  * @param {number} code
5
5
  */
6
6
  export default function formatMuiErrorMessage(code) {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v5.15.9
2
+ * @mui/utils v5.15.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * WARNING: Don't import this directly.
3
- * Use `MuiError` from `@mui-internal/babel-macros/MuiError.macro` instead.
3
+ * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
4
4
  * @param {number} code
5
5
  */
6
6
  export default function formatMuiErrorMessage(code) {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v5.15.9
2
+ * @mui/utils v5.15.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -8,11 +8,11 @@ export var Timeout = /*#__PURE__*/function () {
8
8
  function Timeout() {
9
9
  var _this = this;
10
10
  _classCallCheck(this, Timeout);
11
- this.currentId = 0;
11
+ this.currentId = null;
12
12
  this.clear = function () {
13
- if (_this.currentId !== 0) {
13
+ if (_this.currentId !== null) {
14
14
  clearTimeout(_this.currentId);
15
- _this.currentId = 0;
15
+ _this.currentId = null;
16
16
  }
17
17
  };
18
18
  this.disposeEffect = function () {
@@ -29,7 +29,7 @@ export var Timeout = /*#__PURE__*/function () {
29
29
  var _this2 = this;
30
30
  this.clear();
31
31
  this.currentId = setTimeout(function () {
32
- _this2.currentId = 0;
32
+ _this2.currentId = null;
33
33
  fn();
34
34
  }, delay);
35
35
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * WARNING: Don't import this directly.
3
- * Use `MuiError` from `@mui-internal/babel-macros/MuiError.macro` instead.
3
+ * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
4
4
  * @param {number} code
5
5
  */
6
6
  export default function formatMuiErrorMessage(code) {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v5.15.9
2
+ * @mui/utils v5.15.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -4,11 +4,11 @@ import useLazyRef from '../useLazyRef/useLazyRef';
4
4
  import useOnMount from '../useOnMount/useOnMount';
5
5
  export class Timeout {
6
6
  constructor() {
7
- this.currentId = 0;
7
+ this.currentId = null;
8
8
  this.clear = () => {
9
- if (this.currentId !== 0) {
9
+ if (this.currentId !== null) {
10
10
  clearTimeout(this.currentId);
11
- this.currentId = 0;
11
+ this.currentId = null;
12
12
  }
13
13
  };
14
14
  this.disposeEffect = () => {
@@ -24,7 +24,7 @@ export class Timeout {
24
24
  start(delay, fn) {
25
25
  this.clear();
26
26
  this.currentId = setTimeout(() => {
27
- this.currentId = 0;
27
+ this.currentId = null;
28
28
  fn();
29
29
  }, delay);
30
30
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = formatMuiErrorMessage;
7
7
  /**
8
8
  * WARNING: Don't import this directly.
9
- * Use `MuiError` from `@mui-internal/babel-macros/MuiError.macro` instead.
9
+ * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
10
10
  * @param {number} code
11
11
  */
12
12
  function formatMuiErrorMessage(code) {
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v5.15.9
2
+ * @mui/utils v5.15.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -11,11 +11,11 @@ var _useLazyRef = _interopRequireDefault(require("../useLazyRef/useLazyRef"));
11
11
  var _useOnMount = _interopRequireDefault(require("../useOnMount/useOnMount"));
12
12
  class Timeout {
13
13
  constructor() {
14
- this.currentId = 0;
14
+ this.currentId = null;
15
15
  this.clear = () => {
16
- if (this.currentId !== 0) {
16
+ if (this.currentId !== null) {
17
17
  clearTimeout(this.currentId);
18
- this.currentId = 0;
18
+ this.currentId = null;
19
19
  }
20
20
  };
21
21
  this.disposeEffect = () => {
@@ -31,7 +31,7 @@ class Timeout {
31
31
  start(delay, fn) {
32
32
  this.clear();
33
33
  this.currentId = setTimeout(() => {
34
- this.currentId = 0;
34
+ this.currentId = null;
35
35
  fn();
36
36
  }, delay);
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/utils",
3
- "version": "5.15.9",
3
+ "version": "5.15.12",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -1,6 +1,6 @@
1
1
  export declare class Timeout {
2
2
  static create(): Timeout;
3
- currentId: number;
3
+ currentId: ReturnType<typeof setTimeout> | null;
4
4
  /**
5
5
  * Executes `fn` after `delay`, clearing any previously scheduled call.
6
6
  */
@@ -4,11 +4,11 @@ import useLazyRef from '../useLazyRef/useLazyRef';
4
4
  import useOnMount from '../useOnMount/useOnMount';
5
5
  export class Timeout {
6
6
  constructor() {
7
- this.currentId = 0;
7
+ this.currentId = null;
8
8
  this.clear = () => {
9
- if (this.currentId !== 0) {
9
+ if (this.currentId !== null) {
10
10
  clearTimeout(this.currentId);
11
- this.currentId = 0;
11
+ this.currentId = null;
12
12
  }
13
13
  };
14
14
  this.disposeEffect = () => {
@@ -24,7 +24,7 @@ export class Timeout {
24
24
  start(delay, fn) {
25
25
  this.clear();
26
26
  this.currentId = setTimeout(() => {
27
- this.currentId = 0;
27
+ this.currentId = null;
28
28
  fn();
29
29
  }, delay);
30
30
  }