| Current Path : /home/emeraadmin/public_html/4d695/ |
| Current File : /home/emeraadmin/public_html/4d695/react-display-name.tar |
package.json 0000644 00000004707 15170147401 0007042 0 ustar 00 {
"_from": "react-display-name@^0.2.0",
"_id": "react-display-name@0.2.5",
"_inBundle": false,
"_integrity": "sha512-I+vcaK9t4+kypiSgaiVWAipqHRXYmZIuAiS8vzFvXHHXVigg/sMKwlRgLy6LH2i3rmP+0Vzfl5lFsFRwF1r3pg==",
"_location": "/react-display-name",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "react-display-name@^0.2.0",
"name": "react-display-name",
"escapedName": "react-display-name",
"rawSpec": "^0.2.0",
"saveSpec": null,
"fetchSpec": "^0.2.0"
},
"_requiredBy": [
"/react-dnd-scrollzone-patch-react-17"
],
"_resolved": "https://registry.npmjs.org/react-display-name/-/react-display-name-0.2.5.tgz",
"_shasum": "304c7cbfb59ee40389d436e1a822c17fe27936c6",
"_spec": "react-display-name@^0.2.0",
"_where": "C:\\xampp\\htdocs\\emeraltd\\node_modules\\react-dnd-scrollzone-patch-react-17",
"author": {
"name": "jurassix",
"url": "clinton.ayres@gmail.com"
},
"bugs": {
"url": "https://github.com/jurassix/react-display-name/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "utility to return a react components display name",
"devDependencies": {
"@types/react": "*",
"ajv": "^6.10.2",
"babel-cli": "^6.26.0",
"babel-eslint": "^10.0.3",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"chai": "^4.2.0",
"cpy-cli": "^2.0.0",
"eslint": "6.7.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-react": "7.17.0",
"mkdirp": "^0.5.1",
"mocha": "^6.2.2",
"react": "^16.12.0",
"rimraf": "^3.0.0"
},
"files": [
"lib",
"!lib/spec"
],
"homepage": "https://github.com/jurassix/react-display-name#readme",
"keywords": [
"react",
"redux",
"getDisplayName"
],
"license": "MIT",
"main": "./lib/getDisplayName.js",
"name": "react-display-name",
"repository": {
"type": "git",
"url": "git+https://github.com/jurassix/react-display-name.git"
},
"scripts": {
"build": "npm run clean && npm run lint && npm run build:lib && npm run build:spec",
"build:lib": "mkdirp lib && babel src -d lib && cpy src/*.d.ts lib",
"build:spec": "mkdirp lib/spec && babel spec -d lib/spec",
"clean": "rimraf lib",
"lint": "eslint src",
"prepublish": "npm run build",
"test": "npm run build:spec && mocha 'lib/spec/*Spec.js'"
},
"typings": "./lib/getDisplayName.d.ts",
"version": "0.2.5"
}
lib/getDisplayName.d.ts 0000644 00000000261 15170147401 0011011 0 ustar 00 declare module 'react-display-name' {
import * as React from 'react';
export default function getDisplayName(
Component: React.ComponentType<any> | string
): string;
} lib/getDisplayName.js 0000644 00000000435 15170147401 0010560 0 ustar 00 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getDisplayName;
function getDisplayName(Component) {
return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
} LICENSE 0000644 00000002100 15170147401 0005542 0 ustar 00 MIT License
Copyright (c) 2015-2019 react-display-name authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
README.md 0000644 00000001635 15170147401 0006030 0 ustar 00 ```javascript
npm install --save react-display-name
```
Get the displayName from a Component. This is a common pattern with React Higher Order Components (HoCs). This is a simple reusable utility to get the name of a component.
Usage:
```javascript
import {expect} from 'chai';
import React, {Component} from 'react';
import getDisplayName from 'react-display-name';
const container = (WrappedComponent) => {
class Container extends Component {
static displayName = `Container(${getDisplayName(WrappedComponent)})`;
render() {
return (
<WrappedComponent />
);
}
}
return Container;
}
class HelloWorld extends Component {
render() {
return (
<div>Hello</div>
);
}
}
const HelloWorldPrime = container(HelloWorld);
expect(getDisplayName(HelloWorldPrime)).to.equal('Container(HelloWorld)');
expect(HelloWorldPrime.displayName).to.equal('Container(HelloWorld)');
```