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

@dhis2/prop-types

Package Overview
Dependencies
Maintainers
7
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhis2/prop-types - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

13

build/cjs/__tests__/deprecated.test.js

@@ -80,2 +80,15 @@ "use strict";

});
it('does not produce a warning when the deprecated prop is not passed', () => {
const propType = {
deprecatedBool: (0, _deprecated.deprecated)(_propTypes.default.bool, 'Please do not use anymore')
};
const props = {
deprecatedBool: undefined
};
_propTypes.default.checkPropTypes(propType, props, 'deprecatedMandatoryBool', 'TestComponent');
expect(console.error).toBeCalledTimes(0);
expect(console.warn).toBeCalledTimes(0);
});
});

2

build/cjs/deprecated.js

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

if (!emmittedWarnings.has(message)) {
if (typeof props[propName] !== 'undefined' && !emmittedWarnings.has(message)) {
console.warn(message);

@@ -20,0 +20,0 @@ emmittedWarnings.add(message);

@@ -65,2 +65,13 @@ import propTypes from 'prop-types';

});
it('does not produce a warning when the deprecated prop is not passed', () => {
const propType = {
deprecatedBool: deprecated(propTypes.bool, 'Please do not use anymore')
};
const props = {
deprecatedBool: undefined
};
propTypes.checkPropTypes(propType, props, 'deprecatedMandatoryBool', 'TestComponent');
expect(console.error).toBeCalledTimes(0);
expect(console.warn).toBeCalledTimes(0);
});
});

@@ -7,3 +7,3 @@ import propTypes from 'prop-types';

if (!emmittedWarnings.has(message)) {
if (typeof props[propName] !== 'undefined' && !emmittedWarnings.has(message)) {
console.warn(message);

@@ -10,0 +10,0 @@ emmittedWarnings.add(message);

@@ -0,1 +1,8 @@

## [3.1.2](https://github.com/dhis2/prop-types/compare/v3.1.1...v3.1.2) (2022-05-24)
### Bug Fixes
* **deprecated:** show warning only if prop is populated ([#289](https://github.com/dhis2/prop-types/issues/289)) ([1417bda](https://github.com/dhis2/prop-types/commit/1417bdafb43e586e4c7422c1f3ca26fc9928e88f))
## [3.1.1](https://github.com/dhis2/prop-types/compare/v3.1.0...v3.1.1) (2022-05-24)

@@ -2,0 +9,0 @@

{
"name": "@dhis2/prop-types",
"version": "3.1.1",
"version": "3.1.2",
"main": "./build/cjs/index.js",

@@ -5,0 +5,0 @@ "module": "./build/es/index.js",

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