New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-perf-component

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-perf-component - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

jasmine.json

42

lib/index.js
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
exports.default = perf;
exports['default'] = perf;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
var _react = require('react');

@@ -27,2 +19,10 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**

@@ -36,10 +36,9 @@ * Wraps the passed in `Component` in a higher-order component. It can then

*/
function perf(Component) {
if (process.env.NODE_ENV !== 'production') {
if (!(Component.prototype instanceof _react2['default'].Component)) {
if (!(Component.prototype instanceof _react2.default.Component)) {
throw new Error('Component must be a React component');
}
return (function (_React$Component) {
return function (_React$Component) {
_inherits(Perf, _React$Component);

@@ -50,3 +49,3 @@

_get(Object.getPrototypeOf(Perf.prototype), 'constructor', this).apply(this, arguments);
return _possibleConstructorReturn(this, Object.getPrototypeOf(Perf).apply(this, arguments));
}

@@ -57,3 +56,3 @@

value: function componentDidMount() {
_reactAddonsPerf2['default'].start();
_reactAddonsPerf2.default.start();
}

@@ -63,3 +62,3 @@ }, {

value: function componentDidUpdate() {
var measurements = _reactAddonsPerf2['default'].getLastMeasurements();
var measurements = _reactAddonsPerf2.default.getLastMeasurements();

@@ -72,4 +71,4 @@ if (measurements.length > 0) {

_reactAddonsPerf2['default'].printWasted(measurements);
_reactAddonsPerf2['default'].start();
_reactAddonsPerf2.default.printWasted(measurements);
_reactAddonsPerf2.default.start();
}

@@ -80,3 +79,3 @@ }

value: function render() {
return _react2['default'].createElement(Component, this.props);
return _react2.default.createElement(Component, this.props);
}

@@ -86,3 +85,3 @@ }]);

return Perf;
})(_react2['default'].Component);
}(_react2.default.Component);
} else {

@@ -92,3 +91,2 @@ return Component;

}
module.exports = exports['default'];
{
"name": "react-perf-component",
"version": "1.0.0",
"version": "1.0.1",
"description": "Higher-order component that can measure component performance",
"main": "lib/index.js",
"scripts": {
"clean": "rimraf lib/",
"compile": "babel -d lib/ src/",
"prepublish": "npm test && npm run compile",
"test": "node specs/support/jasmine"
"prepublish": "npm run clean && npm test && npm run compile",
"test": "JASMINE_CONFIG_PATH=jasmine.json jasmine"
},

@@ -27,4 +28,8 @@ "repository": {

"devDependencies": {
"babel": "^5.6.23",
"babel-cli": "^6.7.5",
"babel-core": "^6.7.6",
"babel-eslint": "^3.1.23",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"eslint": "^0.24.1",

@@ -34,11 +39,12 @@ "eslint-plugin-react": "^2.7.0",

"jasmine": "^2.3.1",
"react": "0.14.3",
"react-addons-perf": "0.14.0",
"react-addons-test-utils": "^0.14.0",
"react-shallow-testutils": "^0.7.1"
"react": "^15.0.0",
"react-addons-perf": "^15.0.0",
"react-addons-test-utils": "^15.0.0",
"react-shallow-testutils": "^2.0.0-beta1",
"rimraf": "2.5.2"
},
"peerDependencies": {
"react": "^0.14.0",
"react-addons-perf": "^0.14.0"
"react": "^15.0.0",
"react-addons-perf": "^15.0.0"
}
}

Sorry, the diff of this file is not supported yet

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