@mui/utils 5.0.1 → 5.2.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Call-Em-All
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Call-Em-All
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,2 +1,2 @@
1
- import PropTypes from 'prop-types';
2
- export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
1
+ import PropTypes from 'prop-types';
2
+ export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
@@ -1,7 +1,7 @@
1
- /**
2
- * Safe chained function.
3
- *
4
- * Will only create a new function if needed,
5
- * otherwise will pass back existing functions or null.
6
- */
7
- export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
1
+ /**
2
+ * Safe chained function.
3
+ *
4
+ * Will only create a new function if needed,
5
+ * otherwise will pass back existing functions or null.
6
+ */
7
+ export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
package/deepmerge.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
2
- export interface DeepmergeOptions {
3
- clone?: boolean;
4
- }
5
- export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
1
+ export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
2
+ export interface DeepmergeOptions {
3
+ clone?: boolean;
4
+ }
5
+ export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
package/deepmerge.js CHANGED
@@ -5,15 +5,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.isPlainObject = isPlainObject;
9
8
  exports.default = deepmerge;
9
+ exports.isPlainObject = isPlainObject;
10
10
 
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
12
 
13
13
  function isPlainObject(item) {
14
- return item !== null && typeof item === 'object' && // TS thinks `item is possibly null` even though this was our first guard.
15
- // @ts-expect-error
16
- item.constructor === Object;
14
+ return item !== null && typeof item === 'object' && item.constructor === Object;
17
15
  }
18
16
 
19
17
  function deepmerge(target, source, options = {
@@ -1,3 +1,3 @@
1
- import PropTypes from 'prop-types';
2
- declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
3
- export default elementAcceptingRef;
1
+ import PropTypes from 'prop-types';
2
+ declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
3
+ export default elementAcceptingRef;
@@ -1,3 +1,3 @@
1
- import PropTypes from 'prop-types';
2
- declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
3
- export default _default;
1
+ import PropTypes from 'prop-types';
2
+ declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
3
+ export default _default;
package/esm/deepmerge.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  export function isPlainObject(item) {
3
- return item !== null && typeof item === 'object' && // TS thinks `item is possibly null` even though this was our first guard.
4
- // @ts-expect-error
5
- item.constructor === Object;
3
+ return item !== null && typeof item === 'object' && item.constructor === Object;
6
4
  }
7
5
  export default function deepmerge(target, source, options = {
8
6
  clone: true
package/esm/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as chainPropTypes } from './chainPropTypes';
2
2
  export { default as deepmerge } from './deepmerge';
3
+ export { isPlainObject } from './deepmerge';
3
4
  export { default as elementAcceptingRef } from './elementAcceptingRef';
4
5
  export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
5
6
  export { default as exactProp } from './exactProp';
package/exactProp.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { ValidationMap } from 'prop-types';
2
- export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
1
+ import { ValidationMap } from 'prop-types';
2
+ export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
@@ -1,6 +1,6 @@
1
- /**
2
- * WARNING: Don't import this directly.
3
- * Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
4
- * @param {number} code
5
- */
6
- export default function formatMuiErrorMessage(code: number): string;
1
+ /**
2
+ * WARNING: Don't import this directly.
3
+ * Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
4
+ * @param {number} code
5
+ */
6
+ export default function formatMuiErrorMessage(code: number): string;
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
- export declare function getFunctionName(fn: Function): string;
3
- /**
4
- * cherry-pick from
5
- * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
6
- * originally forked from recompose/getDisplayName with added IE11 support
7
- */
8
- export default function getDisplayName(Component: React.ElementType): string | undefined;
1
+ import * as React from 'react';
2
+ export declare function getFunctionName(fn: Function): string;
3
+ /**
4
+ * cherry-pick from
5
+ * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
6
+ * originally forked from recompose/getDisplayName with added IE11 support
7
+ */
8
+ export default function getDisplayName(Component: React.ElementType): string | undefined;
package/getDisplayName.js CHANGED
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getFunctionName = getFunctionName;
7
6
  exports.default = getDisplayName;
7
+ exports.getFunctionName = getFunctionName;
8
8
 
9
9
  var _reactIs = require("react-is");
10
10
 
@@ -1 +1 @@
1
- export default function getScrollbarSize(doc: Document): number;
1
+ export default function getScrollbarSize(doc: Document): number;
package/index.d.ts CHANGED
@@ -1,31 +1,32 @@
1
- export { default as chainPropTypes } from './chainPropTypes';
2
- export { default as deepmerge } from './deepmerge';
3
- export { default as elementAcceptingRef } from './elementAcceptingRef';
4
- export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
5
- export { default as exactProp } from './exactProp';
6
- export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
7
- export { default as getDisplayName } from './getDisplayName';
8
- export { default as HTMLElementType } from './HTMLElementType';
9
- export { default as ponyfillGlobal } from './ponyfillGlobal';
10
- export { default as refType } from './refType';
11
- export { default as unstable_capitalize } from './capitalize';
12
- export { default as unstable_createChainedFunction } from './createChainedFunction';
13
- export { default as unstable_debounce } from './debounce';
14
- export { default as unstable_deprecatedPropType } from './deprecatedPropType';
15
- export { default as unstable_isMuiElement } from './isMuiElement';
16
- export { default as unstable_ownerDocument } from './ownerDocument';
17
- export { default as unstable_ownerWindow } from './ownerWindow';
18
- export { default as unstable_requirePropFactory } from './requirePropFactory';
19
- export { default as unstable_setRef } from './setRef';
20
- export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
21
- export { default as unstable_useId } from './useId';
22
- export { default as unstable_unsupportedProp } from './unsupportedProp';
23
- export { default as unstable_useControlled } from './useControlled';
24
- export { default as unstable_useEventCallback } from './useEventCallback';
25
- export { default as unstable_useForkRef } from './useForkRef';
26
- export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
27
- export { default as unstable_getScrollbarSize } from './getScrollbarSize';
28
- export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
29
- export { default as usePreviousProps } from './usePreviousProps';
30
- export { default as visuallyHidden } from './visuallyHidden';
31
- export { default as integerPropType } from './integerPropType';
1
+ export { default as chainPropTypes } from './chainPropTypes';
2
+ export { default as deepmerge } from './deepmerge';
3
+ export { isPlainObject } from './deepmerge';
4
+ export { default as elementAcceptingRef } from './elementAcceptingRef';
5
+ export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
6
+ export { default as exactProp } from './exactProp';
7
+ export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
8
+ export { default as getDisplayName } from './getDisplayName';
9
+ export { default as HTMLElementType } from './HTMLElementType';
10
+ export { default as ponyfillGlobal } from './ponyfillGlobal';
11
+ export { default as refType } from './refType';
12
+ export { default as unstable_capitalize } from './capitalize';
13
+ export { default as unstable_createChainedFunction } from './createChainedFunction';
14
+ export { default as unstable_debounce } from './debounce';
15
+ export { default as unstable_deprecatedPropType } from './deprecatedPropType';
16
+ export { default as unstable_isMuiElement } from './isMuiElement';
17
+ export { default as unstable_ownerDocument } from './ownerDocument';
18
+ export { default as unstable_ownerWindow } from './ownerWindow';
19
+ export { default as unstable_requirePropFactory } from './requirePropFactory';
20
+ export { default as unstable_setRef } from './setRef';
21
+ export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
22
+ export { default as unstable_useId } from './useId';
23
+ export { default as unstable_unsupportedProp } from './unsupportedProp';
24
+ export { default as unstable_useControlled } from './useControlled';
25
+ export { default as unstable_useEventCallback } from './useEventCallback';
26
+ export { default as unstable_useForkRef } from './useForkRef';
27
+ export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
28
+ export { default as unstable_getScrollbarSize } from './getScrollbarSize';
29
+ export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
30
+ export { default as usePreviousProps } from './usePreviousProps';
31
+ export { default as visuallyHidden } from './visuallyHidden';
32
+ export { default as integerPropType } from './integerPropType';
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.1
1
+ /** @license MUI v5.2.1
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -10,6 +10,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
10
10
  Object.defineProperty(exports, "__esModule", {
11
11
  value: true
12
12
  });
13
+ Object.defineProperty(exports, "HTMLElementType", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _HTMLElementType.default;
17
+ }
18
+ });
13
19
  Object.defineProperty(exports, "chainPropTypes", {
14
20
  enumerable: true,
15
21
  get: function () {
@@ -52,10 +58,16 @@ Object.defineProperty(exports, "getDisplayName", {
52
58
  return _getDisplayName.default;
53
59
  }
54
60
  });
55
- Object.defineProperty(exports, "HTMLElementType", {
61
+ Object.defineProperty(exports, "integerPropType", {
56
62
  enumerable: true,
57
63
  get: function () {
58
- return _HTMLElementType.default;
64
+ return _integerPropType.default;
65
+ }
66
+ });
67
+ Object.defineProperty(exports, "isPlainObject", {
68
+ enumerable: true,
69
+ get: function () {
70
+ return _deepmerge.isPlainObject;
59
71
  }
60
72
  });
61
73
  Object.defineProperty(exports, "ponyfillGlobal", {
@@ -94,6 +106,24 @@ Object.defineProperty(exports, "unstable_deprecatedPropType", {
94
106
  return _deprecatedPropType.default;
95
107
  }
96
108
  });
109
+ Object.defineProperty(exports, "unstable_detectScrollType", {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _scrollLeft.detectScrollType;
113
+ }
114
+ });
115
+ Object.defineProperty(exports, "unstable_getNormalizedScrollLeft", {
116
+ enumerable: true,
117
+ get: function () {
118
+ return _scrollLeft.getNormalizedScrollLeft;
119
+ }
120
+ });
121
+ Object.defineProperty(exports, "unstable_getScrollbarSize", {
122
+ enumerable: true,
123
+ get: function () {
124
+ return _getScrollbarSize.default;
125
+ }
126
+ });
97
127
  Object.defineProperty(exports, "unstable_isMuiElement", {
98
128
  enumerable: true,
99
129
  get: function () {
@@ -124,18 +154,6 @@ Object.defineProperty(exports, "unstable_setRef", {
124
154
  return _setRef.default;
125
155
  }
126
156
  });
127
- Object.defineProperty(exports, "unstable_useEnhancedEffect", {
128
- enumerable: true,
129
- get: function () {
130
- return _useEnhancedEffect.default;
131
- }
132
- });
133
- Object.defineProperty(exports, "unstable_useId", {
134
- enumerable: true,
135
- get: function () {
136
- return _useId.default;
137
- }
138
- });
139
157
  Object.defineProperty(exports, "unstable_unsupportedProp", {
140
158
  enumerable: true,
141
159
  get: function () {
@@ -148,40 +166,34 @@ Object.defineProperty(exports, "unstable_useControlled", {
148
166
  return _useControlled.default;
149
167
  }
150
168
  });
151
- Object.defineProperty(exports, "unstable_useEventCallback", {
152
- enumerable: true,
153
- get: function () {
154
- return _useEventCallback.default;
155
- }
156
- });
157
- Object.defineProperty(exports, "unstable_useForkRef", {
169
+ Object.defineProperty(exports, "unstable_useEnhancedEffect", {
158
170
  enumerable: true,
159
171
  get: function () {
160
- return _useForkRef.default;
172
+ return _useEnhancedEffect.default;
161
173
  }
162
174
  });
163
- Object.defineProperty(exports, "unstable_useIsFocusVisible", {
175
+ Object.defineProperty(exports, "unstable_useEventCallback", {
164
176
  enumerable: true,
165
177
  get: function () {
166
- return _useIsFocusVisible.default;
178
+ return _useEventCallback.default;
167
179
  }
168
180
  });
169
- Object.defineProperty(exports, "unstable_getScrollbarSize", {
181
+ Object.defineProperty(exports, "unstable_useForkRef", {
170
182
  enumerable: true,
171
183
  get: function () {
172
- return _getScrollbarSize.default;
184
+ return _useForkRef.default;
173
185
  }
174
186
  });
175
- Object.defineProperty(exports, "unstable_detectScrollType", {
187
+ Object.defineProperty(exports, "unstable_useId", {
176
188
  enumerable: true,
177
189
  get: function () {
178
- return _scrollLeft.detectScrollType;
190
+ return _useId.default;
179
191
  }
180
192
  });
181
- Object.defineProperty(exports, "unstable_getNormalizedScrollLeft", {
193
+ Object.defineProperty(exports, "unstable_useIsFocusVisible", {
182
194
  enumerable: true,
183
195
  get: function () {
184
- return _scrollLeft.getNormalizedScrollLeft;
196
+ return _useIsFocusVisible.default;
185
197
  }
186
198
  });
187
199
  Object.defineProperty(exports, "usePreviousProps", {
@@ -196,16 +208,10 @@ Object.defineProperty(exports, "visuallyHidden", {
196
208
  return _visuallyHidden.default;
197
209
  }
198
210
  });
199
- Object.defineProperty(exports, "integerPropType", {
200
- enumerable: true,
201
- get: function () {
202
- return _integerPropType.default;
203
- }
204
- });
205
211
 
206
212
  var _chainPropTypes = _interopRequireDefault(require("./chainPropTypes"));
207
213
 
208
- var _deepmerge = _interopRequireDefault(require("./deepmerge"));
214
+ var _deepmerge = _interopRequireWildcard(require("./deepmerge"));
209
215
 
210
216
  var _elementAcceptingRef = _interopRequireDefault(require("./elementAcceptingRef"));
211
217
 
@@ -263,4 +269,8 @@ var _usePreviousProps = _interopRequireDefault(require("./usePreviousProps"));
263
269
 
264
270
  var _visuallyHidden = _interopRequireDefault(require("./visuallyHidden"));
265
271
 
266
- var _integerPropType = _interopRequireDefault(require("./integerPropType"));
272
+ var _integerPropType = _interopRequireDefault(require("./integerPropType"));
273
+
274
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
275
+
276
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -1,7 +1,7 @@
1
- export function getTypeByValue(value: any): any;
2
- declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
3
- declare namespace _default {
4
- export { requiredInteger as isRequired };
5
- }
6
- export default _default;
7
- declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
1
+ export function getTypeByValue(value: any): any;
2
+ declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
3
+ declare namespace _default {
4
+ export { requiredInteger as isRequired };
5
+ }
6
+ export default _default;
7
+ declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getTypeByValue = getTypeByValue;
7
6
  exports.default = void 0;
7
+ exports.getTypeByValue = getTypeByValue;
8
8
 
9
9
  function getTypeByValue(value) {
10
10
  const valueType = typeof value;
package/isMuiElement.d.ts CHANGED
@@ -1 +1 @@
1
- export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
1
+ export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
@@ -1,9 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _typeof from "@babel/runtime/helpers/esm/typeof";
3
3
  export function isPlainObject(item) {
4
- return item !== null && _typeof(item) === 'object' && // TS thinks `item is possibly null` even though this was our first guard.
5
- // @ts-expect-error
6
- item.constructor === Object;
4
+ return item !== null && _typeof(item) === 'object' && item.constructor === Object;
7
5
  }
8
6
  export default function deepmerge(target, source) {
9
7
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
package/legacy/index.js CHANGED
@@ -1,10 +1,11 @@
1
- /** @license MUI v5.0.1
1
+ /** @license MUI v5.2.1
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
5
5
  */
6
6
  export { default as chainPropTypes } from './chainPropTypes';
7
7
  export { default as deepmerge } from './deepmerge';
8
+ export { isPlainObject } from './deepmerge';
8
9
  export { default as elementAcceptingRef } from './elementAcceptingRef';
9
10
  export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
10
11
  export { default as exactProp } from './exactProp';
@@ -1,8 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  export function isPlainObject(item) {
3
- return item !== null && typeof item === 'object' && // TS thinks `item is possibly null` even though this was our first guard.
4
- // @ts-expect-error
5
- item.constructor === Object;
3
+ return item !== null && typeof item === 'object' && item.constructor === Object;
6
4
  }
7
5
  export default function deepmerge(target, source, options = {
8
6
  clone: true
package/modern/index.js CHANGED
@@ -1,10 +1,11 @@
1
- /** @license MUI v5.0.1
1
+ /** @license MUI v5.2.1
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
5
5
  */
6
6
  export { default as chainPropTypes } from './chainPropTypes';
7
7
  export { default as deepmerge } from './deepmerge';
8
+ export { isPlainObject } from './deepmerge';
8
9
  export { default as elementAcceptingRef } from './elementAcceptingRef';
9
10
  export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
10
11
  export { default as exactProp } from './exactProp';
@@ -1 +1 @@
1
- export default function ownerDocument(node: Node | null | undefined): Document;
1
+ export default function ownerDocument(node: Node | null | undefined): Document;
package/ownerWindow.d.ts CHANGED
@@ -1 +1 @@
1
- export default function ownerWindow(node: Node | undefined): Window;
1
+ export default function ownerWindow(node: Node | undefined): Window;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/utils",
3
- "version": "5.0.1",
3
+ "version": "5.2.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -8,7 +8,7 @@
8
8
  "keywords": [
9
9
  "react",
10
10
  "react-component",
11
- "material-ui",
11
+ "mui",
12
12
  "utils"
13
13
  ],
14
14
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "react": "^17.0.2"
26
26
  },
27
27
  "dependencies": {
28
- "@babel/runtime": "^7.15.4",
28
+ "@babel/runtime": "^7.16.3",
29
29
  "@types/prop-types": "^15.7.4",
30
30
  "@types/react-is": "^16.7.1 || ^17.0.0",
31
31
  "prop-types": "^15.7.2",
@@ -1,2 +1,2 @@
1
- declare const _default: any;
2
- export default _default;
1
+ declare const _default: any;
2
+ export default _default;
package/refType.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import PropTypes from 'prop-types';
2
- declare const refType: PropTypes.Requireable<object>;
3
- export default refType;
1
+ import PropTypes from 'prop-types';
2
+ declare const refType: PropTypes.Requireable<object>;
3
+ export default refType;
package/setRef.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import * as React from 'react';
2
- /**
3
- * TODO v5: consider making it private
4
- *
5
- * passes {value} to {ref}
6
- *
7
- * WARNING: Be sure to only call this inside a callback that is passed as a ref.
8
- * Otherwise, make sure to cleanup the previous {ref} if it changes. See
9
- * https://github.com/mui-org/material-ui/issues/13539
10
- *
11
- * Useful if you want to expose the ref of an inner component to the public API
12
- * while still using it inside the component.
13
- * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
14
- */
15
- export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
1
+ import * as React from 'react';
2
+ /**
3
+ * TODO v5: consider making it private
4
+ *
5
+ * passes {value} to {ref}
6
+ *
7
+ * WARNING: Be sure to only call this inside a callback that is passed as a ref.
8
+ * Otherwise, make sure to cleanup the previous {ref} if it changes. See
9
+ * https://github.com/mui-org/material-ui/issues/13539
10
+ *
11
+ * Useful if you want to expose the ref of an inner component to the public API
12
+ * while still using it inside the component.
13
+ * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
14
+ */
15
+ export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
@@ -1,4 +1,4 @@
1
- /**
2
- * https://github.com/facebook/react/issues/14099#issuecomment-440013892
3
- */
4
- export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
1
+ /**
2
+ * https://github.com/facebook/react/issues/14099#issuecomment-440013892
3
+ */
4
+ export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/useForkRef.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import * as React from 'react';
2
- export default function useForkRef<Instance>(refA: React.Ref<Instance> | null | undefined, refB: React.Ref<Instance> | null | undefined): React.Ref<Instance> | null;
1
+ import * as React from 'react';
2
+ export default function useForkRef<Instance>(refA: React.Ref<Instance> | null | undefined, refB: React.Ref<Instance> | null | undefined): React.Ref<Instance> | null;
package/useId.d.ts CHANGED
@@ -1 +1 @@
1
- export default function useId(idOverride?: string): string | undefined;
1
+ export default function useId(idOverride?: string): string | undefined;
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.teardown = teardown;
7
6
  exports.default = useIsFocusVisible;
7
+ exports.teardown = teardown;
8
8
 
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
 
@@ -1,2 +1,2 @@
1
- declare const usePreviousProps: (value: object) => object;
2
- export default usePreviousProps;
1
+ declare const usePreviousProps: (value: object) => object;
2
+ export default usePreviousProps;
@@ -1,2 +1,2 @@
1
- declare const visuallyHidden: import('react').CSSProperties;
2
- export default visuallyHidden;
1
+ declare const visuallyHidden: import('react').CSSProperties;
2
+ export default visuallyHidden;