Security upgrades
This commit is contained in:
35
node_modules/@material-ui/system/es/css.js
generated
vendored
Normal file
35
node_modules/@material-ui/system/es/css.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import PropTypes from 'prop-types';
|
||||
import merge from './merge';
|
||||
|
||||
function omit(input, fields) {
|
||||
const output = {};
|
||||
Object.keys(input).forEach(prop => {
|
||||
if (fields.indexOf(prop) === -1) {
|
||||
output[prop] = input[prop];
|
||||
}
|
||||
});
|
||||
return output;
|
||||
}
|
||||
|
||||
function css(styleFunction) {
|
||||
const newStyleFunction = props => {
|
||||
const output = styleFunction(props);
|
||||
|
||||
if (props.css) {
|
||||
return _extends(_extends({}, merge(output, styleFunction(_extends({
|
||||
theme: props.theme
|
||||
}, props.css)))), omit(props.css, [styleFunction.filterProps]));
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends(_extends({}, styleFunction.propTypes), {}, {
|
||||
css: PropTypes.object
|
||||
}) : {};
|
||||
newStyleFunction.filterProps = ['css', ...styleFunction.filterProps];
|
||||
return newStyleFunction;
|
||||
}
|
||||
|
||||
export default css;
|
||||
Reference in New Issue
Block a user