@instructure/ui-utils
Advanced tools
Comparing version 4.1.0-dev.1 to 4.1.0
@@ -101,2 +101,3 @@ 'use strict'; | ||
ComponentIdentifier.displayName = 'ComponentIdentifier' | ||
return ComponentIdentifier; | ||
@@ -103,0 +104,0 @@ }(_react.Component), _class.propTypes = { |
@@ -7,2 +7,9 @@ 'use strict'; | ||
exports.default = getDisplayName; | ||
var _warning = require('../warning'); | ||
var _warning2 = _interopRequireDefault(_warning); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -14,7 +21,11 @@ * --- | ||
* | ||
* For [themeable](#themeable) components defined as ES6 classes, the displayName can | ||
* be added via [babel plugin](#babel-plugin-transform-class-display-name). | ||
* | ||
* @param {ReactComponent|String} Component | ||
* @returns {String} the component display name | ||
* @returns {String} the component displayName | ||
*/ | ||
function getDisplayName(Component) { | ||
return typeof Component === 'string' ? Component : Component.name; | ||
(0, _warning2.default)(typeof Component === 'string' || typeof Component.displayName !== 'undefined', '%s is missing the property "displayName".', Component.name); | ||
return typeof Component === 'string' ? Component : Component.displayName; | ||
} |
{ | ||
"name": "@instructure/ui-utils", | ||
"version": "4.1.0-dev.1", | ||
"version": "4.1.0", | ||
"description": "A collection of utilities for UI components", | ||
"author": "Instructure, Inc. Engineering and Product Design", | ||
"main": "./lib/index.js", | ||
"module": "./es/index.js", | ||
"repository": { | ||
@@ -22,5 +21,3 @@ "type": "git", | ||
"clean": "rimraf lib .babel-cache", | ||
"build": "npm-run-all build:cjs build:es", | ||
"build:cjs": "cross-env NODE_ENV=production babel src --out-dir lib --ignore *.test.js", | ||
"build:es": "cross-env NODE_ENV=production ES_MODULES=1 babel src --out-dir es --ignore *.test.js", | ||
"build": "cross-env NODE_ENV=production babel src --out-dir lib --ignore *.test.js", | ||
"build:dev": "cross-env NODE_ENV=development babel src --out-dir lib --ignore *.test.js" | ||
@@ -30,3 +27,3 @@ }, | ||
"devDependencies": { | ||
"@instructure/ui-presets": "^4.1.0-dev.1", | ||
"@instructure/ui-presets": "^4.1.0", | ||
"babel-cli": "6.26.0", | ||
@@ -45,3 +42,3 @@ "react": "15.6.1", | ||
"numeral": "^2.0.6", | ||
"object.omit": "^3.0.0", | ||
"object.omit": "^2.0.1", | ||
"object.pick": "^1.2.0", | ||
@@ -48,0 +45,0 @@ "prop-types": "^15.5.10", |
@@ -7,6 +7,6 @@ --- | ||
[npm]: https://img.shields.io/npm/v/@instructure/ui-utils.svg | ||
[npm-url]: https://npmjs.com/package/@instructure/ui-utils | ||
[![npm][npm]][npm-url] | ||
[![build-status][build-status]][build-status-url] | ||
[![MIT License][license-badge]][LICENSE] | ||
[![Code of Conduct][coc-badge]][coc] | ||
@@ -18,14 +18,1 @@ ### Installation | ||
``` | ||
[npm]: https://img.shields.io/npm/v/@instructure/ui-utils.svg | ||
[npm-url]: https://npmjs.com/package/@instructure/ui-utils | ||
[build-status]: https://travis-ci.org/instructure/instructure-ui.svg?branch=master | ||
[build-status-url]: https://travis-ci.org/instructure/instructure-ui "Travis CI" | ||
[license-badge]: https://img.shields.io/npm/l/instructure-ui.svg?style=flat-square | ||
[license]: https://github.com/instructure/instructure-ui/blob/master/LICENSE | ||
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square | ||
[coc]: https://github.com/instructure/instructure-ui/blob/master/CODE_OF_CONDUCT.md |
@@ -0,1 +1,3 @@ | ||
import warning from '../warning' | ||
/** | ||
@@ -7,7 +9,15 @@ * --- | ||
* | ||
* For [themeable](#themeable) components defined as ES6 classes, the displayName can | ||
* be added via [babel plugin](#babel-plugin-transform-class-display-name). | ||
* | ||
* @param {ReactComponent|String} Component | ||
* @returns {String} the component display name | ||
* @returns {String} the component displayName | ||
*/ | ||
export default function getDisplayName (Component) { | ||
return typeof Component === 'string' ? Component : Component.name | ||
warning( | ||
typeof Component === 'string' || typeof Component.displayName !== 'undefined', | ||
'%s is missing the property "displayName".', | ||
Component.name | ||
) | ||
return typeof Component === 'string' ? Component : Component.displayName | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
204849
96
5519
17
1
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
- Removedis-extendable@1.0.1(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedobject.omit@3.0.0(transitive)
Updatedobject.omit@^2.0.1