Socket
Socket
Sign inDemoInstall

react-highlight-words

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-highlight-words - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

13

dist/main.js

@@ -90,2 +90,4 @@ module.exports =

Highlighter.propTypes = {
activeClassName: _react.PropTypes.string,
activeIndex: _react.PropTypes.string,
autoEscape: _react.PropTypes.bool,

@@ -106,2 +108,6 @@ highlightClassName: _react.PropTypes.string,

function Highlighter(_ref) {
var _ref$activeClassName = _ref.activeClassName;
var activeClassName = _ref$activeClassName === undefined ? '' : _ref$activeClassName;
var _ref$activeIndex = _ref.activeIndex;
var activeIndex = _ref$activeIndex === undefined ? -1 : _ref$activeIndex;
var autoEscape = _ref.autoEscape;

@@ -125,2 +131,4 @@ var _ref$highlightClassName = _ref.highlightClassName;

var HighlightTag = highlightTag;
var highlightCount = -1;
var highlightClassNames = '';

@@ -134,6 +142,9 @@ return _react2['default'].createElement(

if (chunk.highlight) {
highlightCount++;
highlightClassNames = highlightClassName + ' ' + (highlightCount === +activeIndex ? activeClassName : '');
return _react2['default'].createElement(
HighlightTag,
{
className: highlightClassName,
className: highlightClassNames,
key: index,

@@ -140,0 +151,0 @@ style: highlightStyle

4

package.json
{
"name": "react-highlight-words",
"version": "0.5.0",
"version": "0.6.0",
"description": "React component to highlight words within a larger body of text",

@@ -88,3 +88,3 @@ "main": "dist/main.js",

"react-transform-hmr": "^1.0.1",
"redbox-react": "^1.2.6",
"redbox-react": "1.2.6",
"rimraf": "^2.4.4",

@@ -91,0 +91,0 @@ "standard": "^5.4.1",

@@ -28,2 +28,4 @@ <img src="https://cloud.githubusercontent.com/assets/29597/11913937/0d2dcd78-a629-11e5-83e7-6a17b6d765a5.png" width="260" height="260">

| autoEscape | Boolean | | Escape characters which are meaningful in regular expressions |
| activeClassName | String | | The class name to be applied to an active match. Use along with `activeIndex` |
| activeIndex | String | | Specify the match index that should be actively highlighted. Use along with `activeClassName` |
| highlightClassName | String | | CSS class name applied to highlighted text |

@@ -30,0 +32,0 @@ | highlightStyle | Object | | Inline styles applied to highlighted text |

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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