Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-class

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-class - npm Package Compare versions

Comparing version 3.2.0 to 3.2.2

44

lib/__tests__/autobind-only.test.js

@@ -44,2 +44,46 @@ 'use strict';

t.true(bound() === obj, 'bound');
});
(0, _ava2.default)('autoBind filter works', function (t) {
var MyClass = function () {
function MyClass() {
_classCallCheck(this, MyClass);
this.name = 'myclass';
}
_createClass(MyClass, [{
key: 'returnThis',
value: function returnThis() {
return this || 0;
}
}, {
key: 'notBound',
value: function notBound() {
return this || 1;
}
}, {
key: 'setState',
value: function setState() {}
}]);
return MyClass;
}();
var obj = new MyClass();
var unbound = (0, _autoBind2.default)(obj, { notBound: true }).notBound;
t.is(unbound(), 1, 'unbound');
var boundObj = (0, _autoBind2.default)(obj, function (name) {
return name !== 'notBound';
});
var returnThisBound = boundObj.returnThis;
var notBound = boundObj.notBound;
t.is(returnThisBound(), boundObj, 'returnThisBound');
t.is(notBound(), 1, 'notBound');
});

4

lib/index.js

@@ -33,4 +33,2 @@ "use strict";

exports.autoBind = autoBind;
exports.Component = ReactClass;
module.exports = ReactClass;
exports.Component = ReactClass;
{
"name": "react-class",
"version": "3.2.0",
"version": "3.2.2",
"description": "A carefully crafted base class for all your React components ",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -43,3 +43,3 @@ # react-class

```jsx
import 'react-class/autoBind'
import autoBind from 'react-class/autoBind'

@@ -46,0 +46,0 @@ // or

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