react-google-maps
Advanced tools
Comparing version 4.3.1 to 4.3.2
@@ -0,1 +1,11 @@ | ||
<a name="4.3.2"></a> | ||
## [4.3.2](https://github.com/tomchentw/react-google-maps/compare/v4.3.1...v4.3.2) (2015-11-17) | ||
### Bug Fixes | ||
* **async/ScriptjsGoogleMap:** switch to _.isEqual for key comparasion ([0a1df35](https://github.com/tomchentw/react-google-maps/commit/0a1df35)), closes [#143](https://github.com/tomchentw/react-google-maps/issues/143) | ||
<a name="4.3.1"></a> | ||
@@ -2,0 +12,0 @@ ## [4.3.1](https://github.com/tomchentw/react-google-maps/compare/v4.3.0...v4.3.1) (2015-11-16) |
@@ -7,2 +7,4 @@ "use strict"; | ||
var _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; }; | ||
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; }; })(); | ||
@@ -78,9 +80,7 @@ | ||
value: function componentWillReceiveProps(nextProps) { | ||
var _this2 = this; | ||
if ("production" !== process.env.NODE_ENV) { | ||
var changedKeys = (0, _utilsMakeUrl.getUrlObjChangedKeys)(this.props, nextProps); | ||
var changedKeys = Object.keys(ScriptjsGoogleMap.propTypes).filter(function (key) { | ||
return _this2.props[key] !== nextProps[key]; | ||
}); | ||
(0, _warning2["default"])(0 === changedKeys.length, "ScriptjsGoogleMap doesn't support mutating props after initial render. Changed props: %s", "[" + changedKeys.join(", ") + "]"); | ||
(0, _warning2["default"])(0 === changedKeys.length, "ScriptjsGoogleMap doesn't support mutating url related props after initial render. Changed props: %s", "[" + changedKeys.join(", ") + "]"); | ||
} | ||
} | ||
@@ -107,13 +107,6 @@ }, { | ||
key: "propTypes", | ||
value: { | ||
// PropTypes for URL generation | ||
// https://nodejs.org/api/url.html#url_url_format_urlobj | ||
protocol: _react.PropTypes.string, | ||
hostname: _react.PropTypes.string.isRequired, | ||
port: _react.PropTypes.number, | ||
pathname: _react.PropTypes.string.isRequired, | ||
query: _react.PropTypes.object.isRequired, | ||
value: _extends({}, _utilsMakeUrl.urlObjDefinition, { | ||
// PropTypes for ScriptjsGoogleMap | ||
loadingElement: _react.PropTypes.node | ||
}, | ||
}), | ||
enumerable: true | ||
@@ -120,0 +113,0 @@ }]); |
@@ -7,5 +7,14 @@ "use strict"; | ||
exports["default"] = makeUrl; | ||
exports.getUrlObjChangedKeys = getUrlObjChangedKeys; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _url = require("url"); | ||
var _react = require("react"); | ||
var _lodashIsequal = require("lodash.isequal"); | ||
var _lodashIsequal2 = _interopRequireDefault(_lodashIsequal); | ||
function makeUrl(urlObj) { | ||
@@ -21,2 +30,18 @@ return (0, _url.format)({ | ||
module.exports = exports["default"]; | ||
var urlObjDefinition = { | ||
// PropTypes for URL generation | ||
// https://nodejs.org/api/url.html#url_url_format_urlobj | ||
protocol: _react.PropTypes.string, | ||
hostname: _react.PropTypes.string.isRequired, | ||
port: _react.PropTypes.number, | ||
pathname: _react.PropTypes.string.isRequired, | ||
query: _react.PropTypes.object.isRequired | ||
}; | ||
exports.urlObjDefinition = urlObjDefinition; | ||
function getUrlObjChangedKeys(urlObj, nextUrlObj) { | ||
return Object.keys(urlObjDefinition).filter(function (key) { | ||
return !(0, _lodashIsequal2["default"])(urlObj[key], nextUrlObj[key]); | ||
}); | ||
} |
{ | ||
"__template__gist__": "https://gist.github.com/tomchentw/368a93bb748ad9d576f1#file-package-json", | ||
"name": "react-google-maps", | ||
"version": "4.3.1", | ||
"version": "4.3.2", | ||
"description": "React.js Google Maps integration component", | ||
@@ -85,2 +85,3 @@ "main": "lib/index.js", | ||
"invariant": "^2.1.1", | ||
"lodash.isequal": "^3.0.4", | ||
"scriptjs": "^2.5.8", | ||
@@ -87,0 +88,0 @@ "warning": "^2.1.0" |
@@ -21,2 +21,4 @@ import { | ||
default as makeUrl, | ||
urlObjDefinition, | ||
getUrlObjChangedKeys, | ||
} from "../utils/makeUrl"; | ||
@@ -26,9 +28,3 @@ | ||
static propTypes = { | ||
// PropTypes for URL generation | ||
// https://nodejs.org/api/url.html#url_url_format_urlobj | ||
protocol: PropTypes.string, | ||
hostname: PropTypes.string.isRequired, | ||
port: PropTypes.number, | ||
pathname: PropTypes.string.isRequired, | ||
query: PropTypes.object.isRequired, | ||
...urlObjDefinition, | ||
// PropTypes for ScriptjsGoogleMap | ||
@@ -54,6 +50,7 @@ loadingElement: PropTypes.node, | ||
componentWillReceiveProps (nextProps) { | ||
const changedKeys = Object.keys(ScriptjsGoogleMap.propTypes) | ||
.filter(key => this.props[key] !== nextProps[key]); | ||
if ("production" !== process.env.NODE_ENV) { | ||
const changedKeys = getUrlObjChangedKeys(this.props, nextProps); | ||
warning(0 === changedKeys.length, `ScriptjsGoogleMap doesn't support mutating props after initial render. Changed props: %s`, `[${ changedKeys.join(", ") }]`); | ||
warning(0 === changedKeys.length, `ScriptjsGoogleMap doesn't support mutating url related props after initial render. Changed props: %s`, `[${ changedKeys.join(", ") }]`); | ||
} | ||
} | ||
@@ -60,0 +57,0 @@ |
@@ -5,2 +5,10 @@ import { | ||
import { | ||
PropTypes, | ||
} from "react"; | ||
import { | ||
default as isEqual, | ||
} from "lodash.isequal"; | ||
export default function makeUrl (urlObj) { | ||
@@ -15,1 +23,16 @@ return formatUrlObj({ | ||
} | ||
export const urlObjDefinition = { | ||
// PropTypes for URL generation | ||
// https://nodejs.org/api/url.html#url_url_format_urlobj | ||
protocol: PropTypes.string, | ||
hostname: PropTypes.string.isRequired, | ||
port: PropTypes.number, | ||
pathname: PropTypes.string.isRequired, | ||
query: PropTypes.object.isRequired, | ||
}; | ||
export function getUrlObjChangedKeys (urlObj, nextUrlObj) { | ||
return Object.keys(urlObjDefinition) | ||
.filter(key => !isEqual(urlObj[key], nextUrlObj[key])); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
286696
5447
8
2
+ Addedlodash.isequal@^3.0.4
+ Addedlodash._baseisequal@3.0.7(transitive)
+ Addedlodash._bindcallback@3.0.1(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@3.0.4(transitive)
+ Addedlodash.isequal@3.0.4(transitive)
+ Addedlodash.istypedarray@3.0.6(transitive)
+ Addedlodash.keys@3.1.2(transitive)