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

react-twemoji

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-twemoji - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

16

lib/Twemoji/__tests__/index-test.js

@@ -13,13 +13,13 @@ "use strict";

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/* eslint-env mocha */
function renderTwemoji() {
return _testUtils.default.renderIntoDocument(_react.default.createElement(_.default, null, _react.default.createElement("div", null, "\uD83D\uDE09", _react.default.createElement("a", null, "\uD83D\uDE0A"))));
return _testUtils["default"].renderIntoDocument(_react["default"].createElement(_["default"], null, _react["default"].createElement("div", null, "\uD83D\uDE09", _react["default"].createElement("a", null, "\uD83D\uDE0A"))));
}
function renderTwemojiWithNoWrapper() {
return _testUtils.default.renderIntoDocument(_react.default.createElement("div", null, _react.default.createElement(_.default, {
return _testUtils["default"].renderIntoDocument(_react["default"].createElement("div", null, _react["default"].createElement(_["default"], {
noWrapper: true
}, _react.default.createElement("p", null, "\uD83D\uDE09", _react.default.createElement("a", null, "\uD83D\uDE0A")))));
}, _react["default"].createElement("p", null, "\uD83D\uDE09", _react["default"].createElement("a", null, "\uD83D\uDE0A")))));
}

@@ -31,3 +31,3 @@

var node = _reactDom.default.findDOMNode(rendered); // eslint-disable-line react/no-find-dom-node
var node = _reactDom["default"].findDOMNode(rendered); // eslint-disable-line react/no-find-dom-node

@@ -40,7 +40,7 @@

_reactDom.default.render(_react.default.createElement(_.default, null, "\uD83D\uDE10\uD83D\uDE11"), node);
_reactDom["default"].render(_react["default"].createElement(_["default"], null, "\uD83D\uDE10\uD83D\uDE11"), node);
var oldSrc = node.querySelector('img').src; // triggers componentDidUpdate
_reactDom.default.render(_react.default.createElement(_.default, null, "\uD83D\uDE04"), node);
_reactDom["default"].render(_react["default"].createElement(_["default"], null, "\uD83D\uDE04"), node);

@@ -56,3 +56,3 @@ var newSrc = node.querySelector('img').src;

var node = _reactDom.default.findDOMNode(rendered); // eslint-disable-line react/no-find-dom-node
var node = _reactDom["default"].findDOMNode(rendered); // eslint-disable-line react/no-find-dom-node

@@ -59,0 +59,0 @@

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

});
exports.default = void 0;
exports["default"] = void 0;

@@ -17,3 +17,3 @@ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

@@ -61,3 +61,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

} else {
_this.rootRef = _react.default.createRef();
_this.rootRef = _react["default"].createRef();
}

@@ -77,3 +77,3 @@

_twemoji.default.parse(node, this.props.options);
_twemoji["default"].parse(node, this.props.options);
}

@@ -83,3 +83,3 @@ } else {

_twemoji.default.parse(_node, this.props.options);
_twemoji["default"].parse(_node, this.props.options);
}

@@ -90,3 +90,3 @@ }

value: function componentDidUpdate(prevProps) {
if (!(0, _isEqual.default)(this.props, prevProps)) {
if (!(0, _isEqual["default"])(this.props, prevProps)) {
this._parseTwemoji();

@@ -111,5 +111,5 @@ }

if (noWrapper) {
return _react.default.createElement(_react.default.Fragment, null, _react.default.Children.map(children, function (c, i) {
_this2.childrenRefs[i] = _this2.childrenRefs[i] || _react.default.createRef();
return _react.default.cloneElement(c, {
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].Children.map(children, function (c, i) {
_this2.childrenRefs[i] = _this2.childrenRefs[i] || _react["default"].createRef();
return _react["default"].cloneElement(c, {
ref: _this2.childrenRefs[i]

@@ -120,3 +120,3 @@ });

delete other.options;
return _react.default.createElement("div", _extends({
return _react["default"].createElement("div", _extends({
ref: this.rootRef

@@ -129,10 +129,10 @@ }, other), children);

return Twemoji;
}(_react.default.Component);
}(_react["default"].Component);
exports.default = Twemoji;
exports["default"] = Twemoji;
_defineProperty(Twemoji, "propTypes", {
children: _propTypes.default.node,
noWrapper: _propTypes.default.bool,
options: _propTypes.default.object
children: _propTypes["default"].node,
noWrapper: _propTypes["default"].bool,
options: _propTypes["default"].object
});
{
"name": "react-twemoji",
"version": "0.1.0",
"version": "0.2.0",
"description": "A React wrapper for Twemoji",

@@ -35,33 +35,33 @@ "keyword": [

"devDependencies": {
"@babel/cli": "^7.0.0-beta.56",
"@babel/core": "^7.0.0-beta.56",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.56",
"@babel/preset-env": "^7.0.0-beta.56",
"@babel/preset-react": "^7.0.0-beta.56",
"babel-eslint": "^9.0.0-beta.3",
"babel-loader": "^8.0.0-beta",
"chai": "^3.5.0",
"eslint": "^5.3.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.10.0",
"express": "^4.13.4",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-mocha": "^0.2.2",
"karma-webpack": "^3.0.0",
"mocha": "^2.4.5",
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
"chai": "^4.2.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0",
"express": "^4.17.1",
"karma": "^4.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma-webpack": "^4.0.2",
"mocha": "^6.1.4",
"pretty-error": "^2.0.0",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"webpack": "^4.16.4",
"webpack-cli": "^3.1.0",
"webpack-dev-middleware": "^3.1.3"
"react": "^16.8.6",
"react-dom": "^16.8.6",
"webpack": "^4.34.0",
"webpack-cli": "^3.3.4",
"webpack-dev-middleware": "^3.7.0"
},
"dependencies": {
"lodash": "^4.16.2",
"prop-types": "^15.6.2",
"twemoji": "^11.0.1"
"lodash": "^4.17.11",
"prop-types": "^15.7.2",
"twemoji": "^12.0.4"
},

@@ -68,0 +68,0 @@ "peerDependencies": {

@@ -8,5 +8,11 @@ # react-twemoji

```shell
yarn install react-twemoji
yarn add react-twemoji
```
or, if you use npm,
```shell
npm install react-twemoji
```
## Usage

@@ -37,3 +43,3 @@

## Props
### Props

@@ -43,3 +49,3 @@ | Name | Type | Default | Description|

| `options` | `Object` | `{}` | `twemoji.parse` options |
| `noWrapper` | `Boolean` | `false` | When set to `true`, Twemoji will not render a wrapping `div` to contain children |
| `noWrapper` | `Boolean` | `false` | When it is `true`, Twemoji will not render a wrapping `div` to contain children |

@@ -46,0 +52,0 @@ ### Run example

Sorry, the diff of this file is not supported yet

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