@instructure/ui-utils
Advanced tools
Comparing version 4.1.0-dev.0 to 4.1.0-dev.1
@@ -101,3 +101,2 @@ 'use strict'; | ||
ComponentIdentifier.displayName = 'ComponentIdentifier' | ||
return ComponentIdentifier; | ||
@@ -104,0 +103,0 @@ }(_react.Component), _class.propTypes = { |
@@ -7,9 +7,2 @@ 'use strict'; | ||
exports.default = getDisplayName; | ||
var _warning = require('../warning'); | ||
var _warning2 = _interopRequireDefault(_warning); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -21,11 +14,7 @@ * --- | ||
* | ||
* 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 displayName | ||
* @returns {String} the component display name | ||
*/ | ||
function getDisplayName(Component) { | ||
(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; | ||
return typeof Component === 'string' ? Component : Component.name; | ||
} |
{ | ||
"name": "@instructure/ui-utils", | ||
"version": "4.1.0-dev.0", | ||
"version": "4.1.0-dev.1", | ||
"description": "A collection of utilities for UI components", | ||
"author": "Instructure, Inc. Engineering and Product Design", | ||
"main": "./lib/index.js", | ||
"module": "./es/index.js", | ||
"repository": { | ||
@@ -21,3 +22,5 @@ "type": "git", | ||
"clean": "rimraf lib .babel-cache", | ||
"build": "cross-env NODE_ENV=production babel src --out-dir lib --ignore *.test.js", | ||
"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:dev": "cross-env NODE_ENV=development babel src --out-dir lib --ignore *.test.js" | ||
@@ -27,3 +30,3 @@ }, | ||
"devDependencies": { | ||
"@instructure/ui-presets": "^4.1.0-dev.0", | ||
"@instructure/ui-presets": "^4.1.0-dev.1", | ||
"babel-cli": "6.26.0", | ||
@@ -30,0 +33,0 @@ "react": "15.6.1", |
@@ -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,1 +18,14 @@ ### 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 |
@@ -1,3 +0,1 @@ | ||
import warning from '../warning' | ||
/** | ||
@@ -9,15 +7,7 @@ * --- | ||
* | ||
* 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 displayName | ||
* @returns {String} the component display name | ||
*/ | ||
export default function getDisplayName (Component) { | ||
warning( | ||
typeof Component === 'string' || typeof Component.displayName !== 'undefined', | ||
'%s is missing the property "displayName".', | ||
Component.name | ||
) | ||
return typeof Component === 'string' ? Component : Component.displayName | ||
return typeof Component === 'string' ? Component : Component.name | ||
} |
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
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
308950
146
8185
30