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

with-immutable-props-to-js

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

with-immutable-props-to-js - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

36

lib/index.js

@@ -6,3 +6,3 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;

@@ -15,4 +15,6 @@ var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

@@ -26,2 +28,6 @@

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
var getDisplayName = function getDisplayName(Component) {

@@ -33,3 +39,6 @@ return Component.displayName || Component.name || 'Component';

var Wrapper = function Wrapper(props) {
var propsJS = Object.entries(props).reduce(function (newProps, _ref) {
var forwardedRef = props.forwardedRef,
rest = _objectWithoutProperties(props, ["forwardedRef"]);
var propsJS = Object.entries(rest).reduce(function (newProps, _ref) {
var _ref2 = _slicedToArray(_ref, 2),

@@ -43,10 +52,23 @@ propKey = _ref2[0],

}, {});
return _react.default.createElement(WrappedComponent, propsJS);
return _react["default"].createElement(WrappedComponent, _extends({}, propsJS, {
ref: forwardedRef
}));
};
Wrapper.displayName = "withImmutablePropsToJS(".concat(getDisplayName(WrappedComponent), ")");
return (0, _hoistNonReactStatics.default)(Wrapper, WrappedComponent);
Wrapper.defaultProps = {
forwardedRef: null
};
var WrapperWithForwardedRef = _react["default"].forwardRef(function (props, ref) {
return _react["default"].createElement(Wrapper, _extends({}, props, {
forwardedRef: ref
}));
});
WrapperWithForwardedRef.displayName = "withImmutablePropsToJS(".concat(getDisplayName(WrappedComponent), ")");
(0, _hoistNonReactStatics["default"])(WrapperWithForwardedRef, WrappedComponent);
return WrapperWithForwardedRef;
};
var _default = withImmutablePropsToJS;
exports.default = _default;
exports["default"] = _default;

51

package.json
{
"name": "with-immutable-props-to-js",
"version": "1.2.0",
"version": "2.0.0",
"description": "A higher-order component for keeping Immutable objects outside your presentational components",

@@ -23,3 +23,3 @@ "keywords": [

"fix": "eslint --fix .",
"build": "babel src -d lib --copy-files",
"build": "NODE_ENV=production babel src -d lib --copy-files",
"contrib:add": "all-contributors add",

@@ -32,32 +32,35 @@ "contrib:generate": "all-contributors generate",

"devDependencies": {
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@tophat/eslint-config": "^0.1.2",
"all-contributors-cli": "^6.1.1",
"all-contributors-cli": "^6.9.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^24.1.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-15": "^1.2.0",
"enzyme-adapter-react-16": "^1.7.0",
"eslint": "^5.9.0",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-jest": "^22.1.3",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-react": "^7.11.1",
"babel-jest": "^24.9.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^6.3.0",
"eslint-config-prettier": "^6.2.0",
"eslint-plugin-jest": "^22.17.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"immutable": "^4.0.0-rc.12",
"jest": "^24.1.0",
"prettier": "^1.15.2",
"react": "^16.6.3",
"react-dom": "^16.6.3"
"jest": "^24.9.0",
"prettier": "^1.18.2",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0"
},
"peerDependencies": {
"immutable": ">=3.0.0",
"react": ">=15.0.0",
"react-dom": ">=15.0.0"
"react": ">=16.3.0",
"react-dom": ">=16.3.0"
},
"jest": {
"setupTestFrameworkScriptFile": "<rootDir>/tests/setupTestFramework.js",
"setupFilesAfterEnv": [
"<rootDir>/tests/setupTestFramework.js"
],
"collectCoverageFrom": [

@@ -68,4 +71,4 @@ "src/**/*.js"

"dependencies": {
"hoist-non-react-statics": "^3.2.1"
"hoist-non-react-statics": "^3.3.0"
}
}

@@ -9,5 +9,5 @@ # with-immutable-props-to-js

[![codecov](https://codecov.io/gh/tophat/with-immutable-props-to-js/branch/master/graph/badge.svg)](https://codecov.io/gh/tophat/with-immutable-props-to-js)
[![Greenkeeper badge](https://badges.greenkeeper.io/tophat/with-immutable-props-to-js.svg)](https://greenkeeper.io/)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=tophat/with-immutable-props-to-js)](https://dependabot.com)
[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat)](#contributors)
[![Slack workspace](https://slackinvite.dev.tophat.com/badge.svg)](https://opensource.tophat.com/slack)

@@ -82,3 +82,19 @@ [![Maturity badge - level 3](https://img.shields.io/badge/Maturity-Level%203%20--%20Stable-green.svg)](https://github.com/tophat/getting-started/blob/master/scorecard.md)

<!-- prettier-ignore -->
<table><tr><td align="center"><a href="http://msrose.github.io"><img src="https://avatars3.githubusercontent.com/u/3495264?v=4" width="100px;" alt="Michael Rose"/><br /><sub><b>Michael Rose</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=msrose" title="Code">💻</a> <a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=msrose" title="Documentation">📖</a> <a href="#infra-msrose" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td><td align="center"><a href="https://www.linkedin.com/in/brandonbaksh/"><img src="https://avatars1.githubusercontent.com/u/39271619?v=4" width="100px;" alt="Brandon Baksh"/><br /><sub><b>Brandon Baksh</b></sub></a><br /><a href="#infra-brandonbaksh" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td><td align="center"><a href="https://github.com/apps/greenkeeper"><img src="https://avatars3.githubusercontent.com/in/505?v=4" width="100px;" alt="greenkeeper[bot]"/><br /><sub><b>greenkeeper[bot]</b></sub></a><br /><a href="#infra-greenkeeper[bot]" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td><td align="center"><a href="https://jakebolam.com"><img src="https://avatars2.githubusercontent.com/u/3534236?v=4" width="100px;" alt="Jake Bolam"/><br /><sub><b>Jake Bolam</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=jakebolam" title="Documentation">📖</a> <a href="#infra-jakebolam" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td><td align="center"><a href="http://www.sanchitgera.ca"><img src="https://avatars0.githubusercontent.com/u/8632167?v=4" width="100px;" alt="Sanchit Gera"/><br /><sub><b>Sanchit Gera</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=sanchitgera" title="Documentation">📖</a></td><td align="center"><a href="https://breezio.com"><img src="https://avatars1.githubusercontent.com/u/445636?v=4" width="100px;" alt="Siavash Mahmoudian"/><br /><sub><b>Siavash Mahmoudian</b></sub></a><br /><a href="#infra-syavash" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td><td align="center"><a href="http://www.monicamoore.ca"><img src="https://avatars1.githubusercontent.com/u/8105535?v=4" width="100px;" alt="monicamm95"/><br /><sub><b>monicamm95</b></sub></a><br /><a href="#design-monicamm95" title="Design">🎨</a></td></tr><tr><td align="center"><a href="https://github.com/danilomatamoros"><img src="https://avatars0.githubusercontent.com/u/6589617?v=4" width="100px;" alt="Danilo Matamoros"/><br /><sub><b>Danilo Matamoros</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=danilomatamoros" title="Code">💻</a></td><td align="center"><a href="https://github.com/enheit"><img src="https://avatars1.githubusercontent.com/u/8645216?v=4" width="100px;" alt="Roman Mahotskyi"/><br /><sub><b>Roman Mahotskyi</b></sub></a><br /><a href="#infra-enheit" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td></tr></table>
<table>
<tr>
<td align="center"><a href="http://msrose.github.io"><img src="https://avatars3.githubusercontent.com/u/3495264?v=4" width="100px;" alt="Michael Rose"/><br /><sub><b>Michael Rose</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=msrose" title="Code">💻</a> <a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=msrose" title="Documentation">📖</a> <a href="#infra-msrose" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center"><a href="https://www.linkedin.com/in/brandonbaksh/"><img src="https://avatars1.githubusercontent.com/u/39271619?v=4" width="100px;" alt="Brandon Baksh"/><br /><sub><b>Brandon Baksh</b></sub></a><br /><a href="#infra-brandonbaksh" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center"><a href="https://github.com/apps/greenkeeper"><img src="https://avatars3.githubusercontent.com/in/505?v=4" width="100px;" alt="greenkeeper[bot]"/><br /><sub><b>greenkeeper[bot]</b></sub></a><br /><a href="#infra-greenkeeper[bot]" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center"><a href="https://jakebolam.com"><img src="https://avatars2.githubusercontent.com/u/3534236?v=4" width="100px;" alt="Jake Bolam"/><br /><sub><b>Jake Bolam</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=jakebolam" title="Documentation">📖</a> <a href="#infra-jakebolam" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center"><a href="http://www.sanchitgera.ca"><img src="https://avatars0.githubusercontent.com/u/8632167?v=4" width="100px;" alt="Sanchit Gera"/><br /><sub><b>Sanchit Gera</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=sanchitgera" title="Documentation">📖</a></td>
<td align="center"><a href="https://breezio.com"><img src="https://avatars1.githubusercontent.com/u/445636?v=4" width="100px;" alt="Siavash Mahmoudian"/><br /><sub><b>Siavash Mahmoudian</b></sub></a><br /><a href="#infra-syavash" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center"><a href="http://www.monicamoore.ca"><img src="https://avatars1.githubusercontent.com/u/8105535?v=4" width="100px;" alt="monicamm95"/><br /><sub><b>monicamm95</b></sub></a><br /><a href="#design-monicamm95" title="Design">🎨</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/danilomatamoros"><img src="https://avatars0.githubusercontent.com/u/6589617?v=4" width="100px;" alt="Danilo Matamoros"/><br /><sub><b>Danilo Matamoros</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=danilomatamoros" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/enheit"><img src="https://avatars1.githubusercontent.com/u/8645216?v=4" width="100px;" alt="Roman Mahotskyi"/><br /><sub><b>Roman Mahotskyi</b></sub></a><br /><a href="#infra-enheit" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center"><a href="http://twitter.com/pfmmfp"><img src="https://avatars3.githubusercontent.com/u/2229060?v=4" width="100px;" alt="Pablo Morra"/><br /><sub><b>Pablo Morra</b></sub></a><br /><a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=pfmmfp" title="Code">💻</a> <a href="https://github.com/tophat/with-immutable-props-to-js/commits?author=pfmmfp" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/apps/dependabot"><img src="https://avatars0.githubusercontent.com/in/29110?v=4" width="100px;" alt="dependabot[bot]"/><br /><sub><b>dependabot[bot]</b></sub></a><br /><a href="#infra-dependabot[bot]" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</table>

@@ -85,0 +101,0 @@ <!-- ALL-CONTRIBUTORS-LIST:END -->

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