Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Adapter from "enzyme-adapter-react-16";
import { flow, camelCase, omit } from "lodash";
import sinon from "sinon";
import voidElements from "void-elements";
import { all as cssProps } from "known-css-properties";
import htmlProps from "react-known-props";
import ariaProps from "aria-attributes/index.json";
// $FlowFixMe
import safeHtmlProps from "react-html-attributes";
import { findHTMLTags, getHTMLTag, findHTMLTag } from "./utils";
type TestFn = (Element: ComponentType) => ComponentType;
configure({ adapter: new Adapter() });
const styleProps = cssProps
.filter(prop => !/^-/.test(prop))
.map(camelCase)
.reduce(
(acc, prop) => ({
...acc,
[prop]: prop
}),
{}
);
const reactProps = [...safeHtmlProps["*"], ...ariaProps]
.filter(
prop =>
!/^style|className|allowTransparency|srcLang|suppressContentEditableWarning|capture|marginWidth|marginHeight|classID|is|keyType|keyParams|charSet|dangerouslySetInnerHTML|on[A-Z].+$/.test(
prop
)
export const getStyleProps = (): Object =>
cssProps
.filter(prop => !/^-/.test(prop))
.map(camelCase)
.reduce(reducer, {});