Socket
Socket
Sign inDemoInstall

rc-util

Package Overview
Dependencies
Maintainers
1
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-util - npm Package Compare versions

Comparing version 3.1.3 to 3.2.0

lib/warn.js

5

lib/classSet.js
'use strict';
var deprecate = require('util-deprecate');
var classNames = require('classnames');
module.exports = deprecate(classNames, '`rcUtil.classSet()` is deprecated, use `classNames()` by `require(\'classnames\')` instead');
require('./warn')('`rcUtil classSet` is deprecated, use `classNames()` by `require(\'classnames\')` instead');
module.exports = classNames;

2

lib/index.js
'use strict';
require('./warn')('require(\'rc-util\') is deprecated, please require(\'rc-util/lib/xx\')');
module.exports = {

@@ -4,0 +6,0 @@ guid: require('./guid'),

'use strict';
var deprecate = require('util-deprecate');
var classNames = require('classnames');
module.exports = deprecate(classNames, '`rcUtil.joinClasses()` is deprecated, use `classNames()` by `require(\'classnames\')` instead');
require('./warn')('`rcUtil joinClasses()` is deprecated, use `classNames()` by `require(\'classnames\')` instead');
module.exports = classNames;
'use strict';
var shallowEqual = require('shallowequal');
require('./warn')('`rcUtil PureRenderMixin` is deprecated, use `react-addons-pure-render-mixin` by `require(\'react-addons-pure-render-mixin\')` instead');
/**
* If your React component's render function is "pure", e.g. it will render the
* same result given the same props and state, provide this Mixin for a
* considerable performance boost.
*
* Most React components have pure render functions.
*
* Example:
*
* const ReactComponentWithPureRenderMixin =
* require('ReactComponentWithPureRenderMixin');
* React.createClass({
* mixins: [ReactComponentWithPureRenderMixin],
*
* render: function() {
* return <div className={this.props.className}>foo</div>;
* }
* });
*
* Note: This only checks shallow equality for props and state. If these contain
* complex data structures this mixin may have false-negatives for deeper
* differences. Only mixin to components which have simple props and state, or
* use `forceUpdate()` when you know deep data structures have changed.
*/
var ReactComponentWithPureRenderMixin = {
shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) {
return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);
}
};
module.exports = ReactComponentWithPureRenderMixin;
module.exports = require('react-addons-pure-render-mixin');
{
"name": "rc-util",
"version": "3.1.3",
"version": "3.2.0",
"description": "Common Utils For React Component",

@@ -41,6 +41,6 @@ "keywords": [

"expect.js": "~0.3.1",
"react": "^0.14.0",
"react": "15.x",
"rc-server": "3.x",
"rc-tools": "4.x",
"react-dom": "^0.14.0"
"react-dom": "15.x"
},

@@ -52,6 +52,6 @@ "pre-commit": [

"add-dom-event-listener": "1.x",
"react-addons-pure-render-mixin": "15.x",
"classnames": "2.x",
"shallowequal": "0.2.x",
"util-deprecate": "1.x"
"shallowequal": "0.2.x"
}
}

@@ -28,9 +28,3 @@ # rc-util

## Usage
```js
import {shallowEqual} from 'rc-util';
console.log(shallowEqual({one: 1}, {one: 1}));
```
## API

@@ -63,6 +57,4 @@

## License
rc-util is released under the MIT license.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc