Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env"
]
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.14.0
14 changes: 7 additions & 7 deletions lib/highlighter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var React = require('react');
var RegExpPropType = require('./regExpPropType');
var escapeStringRegexp = require('escape-string-regexp');
var blacklist = require('blacklist');
var createReactClass = require('create-react-class');
var PropTypes = require('prop-types');
import React from 'react';
import PropTypes from 'prop-types';
import escapeStringRegexp from 'escape-string-regexp';
import blacklist from 'blacklist';
import createReactClass from 'create-react-class';
import { RegExpPropType } from './regExpPropType.js';

function removeDiacritics(str, blacklist) {
if (!String.prototype.normalize) {
Expand Down Expand Up @@ -243,4 +243,4 @@ Highlighter.defaultProps = {
matchStyle: {}
};

module.exports = Highlighter;
export default Highlighter;
8 changes: 3 additions & 5 deletions lib/regExpPropType.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
var regExpPropType = function (props, propName, componentName, location) {
export const RegExpPropType = (props, propName, componentName, location) => {
if (!(props[propName] instanceof RegExp)) {
var propType = typeof props[propName];
const propType = typeof props[propName];

return new Error(
("Invalid " + location + " `" + propName + "` of type `" + propType + "` ") +
("supplied to `" + componentName + "`, expected `RegExp`.")
);
}
};

module.exports = regExpPropType;
};
Loading