@cloudflare/style-container
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.0.12"></a> | ||
## [1.0.12](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/style-container@1.0.11...@cloudflare/style-container@1.0.12) (2018-06-08) | ||
### Bug Fixes | ||
* **style-container:** UI-848 don't fail on missing displayName ([fe39d2b](http://stash.cfops.it:7999/fe/stratus/commits/fe39d2b)) | ||
<a name="1.0.11"></a> | ||
@@ -15,3 +26,3 @@ ## [1.0.11](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/style-container@1.0.8...@cloudflare/style-container@1.0.11) (2018-06-07) | ||
<a name="1.0.10"></a> | ||
<a name="1.0.10"></a> | ||
## [1.0.10](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/style-container@1.0.8...@cloudflare/style-container@1.0.10) (2018-06-07) | ||
@@ -24,3 +35,3 @@ | ||
<a name="1.0.8"></a> | ||
<a name="1.0.8"></a> | ||
## [1.0.8](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/style-container@1.0.6...@cloudflare/style-container@1.0.8) (2018-06-07) | ||
@@ -36,3 +47,3 @@ | ||
<a name="1.0.6"></a> | ||
<a name="1.0.6"></a> | ||
## [1.0.6](http://stash.cfops.it:7999/www/cf-ux/compare/@cloudflare/style-container@1.0.5...@cloudflare/style-container@1.0.6) (2018-05-25) | ||
@@ -48,3 +59,3 @@ | ||
<a name="1.0.5"></a> | ||
<a name="1.0.5"></a> | ||
## [1.0.5](http://stash.cfops.it:7999/www/cf-ux/compare/@cloudflare/style-container@1.0.4...@cloudflare/style-container@1.0.5) (2018-05-24) | ||
@@ -57,3 +68,3 @@ | ||
<a name="1.0.4"></a> | ||
<a name="1.0.4"></a> | ||
## [1.0.4](http://stash.cfops.it:7999/www/cf-ux/compare/@cloudflare/style-container@1.0.3...@cloudflare/style-container@1.0.4) (2018-05-24) | ||
@@ -70,3 +81,3 @@ | ||
<a name="1.0.3"></a> | ||
<a name="1.0.3"></a> | ||
## [1.0.3](http://stash.cfops.it:7999/www/cf-ux/compare/@cloudflare/style-container@1.0.2...@cloudflare/style-container@1.0.3) (2018-05-14) | ||
@@ -82,3 +93,3 @@ | ||
<a name="1.0.2"></a> | ||
<a name="1.0.2"></a> | ||
## [1.0.2](http://stash.cfops.it:7999/www/cf-ux/compare/@cloudflare/style-container@1.0.1...@cloudflare/style-container@1.0.2) (2018-05-10) | ||
@@ -85,0 +96,0 @@ |
@@ -8,3 +8,11 @@ import getReactDisplayName from 'react-display-name'; | ||
return function (WrappedComponent) { | ||
return hocType + '(' + getReactDisplayName(WrappedComponent) + ')'; | ||
var displayName = ''; | ||
try { | ||
displayName = getReactDisplayName(WrappedComponent); | ||
} catch (ex) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.error('can\'t get displayName, exception: ' + ex); | ||
} | ||
} | ||
return hocType + '(' + displayName + ')'; | ||
}; | ||
@@ -11,0 +19,0 @@ }; |
@@ -17,3 +17,13 @@ 'use strict'; | ||
// hocType can be either a string (such as 'div') or a React Component | ||
const hocDisplayName = exports.hocDisplayName = hocType => WrappedComponent => `${hocType}(${(0, _reactDisplayName2.default)(WrappedComponent)})`; | ||
const hocDisplayName = exports.hocDisplayName = hocType => WrappedComponent => { | ||
let displayName = ''; | ||
try { | ||
displayName = (0, _reactDisplayName2.default)(WrappedComponent); | ||
} catch (ex) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.error(`can't get displayName, exception: ${ex}`); | ||
} | ||
} | ||
return `${hocType}(${displayName})`; | ||
}; | ||
@@ -20,0 +30,0 @@ // Add displayName to a Component |
{ | ||
"name": "@cloudflare/style-container", | ||
"description": "Cloudflare Style Container", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"main": "lib/index.js", | ||
@@ -15,3 +15,3 @@ "module": "es/index.js", | ||
"dependencies": { | ||
"@cloudflare/style-const": "^1.0.10", | ||
"@cloudflare/style-const": "^1.0.11", | ||
"fela": "^6.0.5", | ||
@@ -18,0 +18,0 @@ "fela-utils": "^7.0.5", |
@@ -6,4 +6,13 @@ import getReactDisplayName from 'react-display-name'; | ||
// hocType can be either a string (such as 'div') or a React Component | ||
export const hocDisplayName = hocType => WrappedComponent => | ||
`${hocType}(${getReactDisplayName(WrappedComponent)})`; | ||
export const hocDisplayName = hocType => WrappedComponent => { | ||
let displayName = ''; | ||
try { | ||
displayName = getReactDisplayName(WrappedComponent); | ||
} catch (ex) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.error(`can't get displayName, exception: ${ex}`); | ||
} | ||
} | ||
return `${hocType}(${displayName})`; | ||
}; | ||
@@ -10,0 +19,0 @@ // Add displayName to a Component |
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
82797
1259
4