Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function normalizeGenericProps(props) {
for (const prop in props) {
const mappedProp = InfernoCompatPropertyMap[prop];
if (mappedProp && props[prop] && mappedProp !== prop) {
props[mappedProp] = props[prop];
props[prop] = void 0;
}
if (options.reactStyles && prop === 'style') {
const styles = props.style;
if (styles && !isString(styles)) {
const newStyles = {};
for (const s in styles) {
const value = styles[s];
const hyphenStr = hyphenCase(s);
newStyles[hyphenStr] = isNumber(value) ? getNumberStyleValue(hyphenStr, value) : value;
}
props.style = newStyles;
}
}
}
}
import {createElement} from 'inferno-create-element';
import {isArray, isFunction, isInvalid, isNull, isNullOrUndef, isNumber, isString, warning} from 'inferno-shared';
import {VNodeFlags} from 'inferno-vnode-flags';
import {isValidElement} from './isValidElement';
import PropTypes from './PropTypes';
import {InfernoCompatPropertyMap} from './InfernoCompatPropertyMap';
import {findDOMNode} from 'inferno-extras';
import {getNumberStyleValue, hyphenCase} from './reactstyles';
declare global {
interface Event {
persist: Function;
}
}
options.reactStyles = true;
function unmountComponentAtNode(container: Element | SVGAElement | DocumentFragment): boolean {
__render(null, container, null, null);
return true;
}
export type IterateChildrenFn = (value: InfernoNode | any, index: number, array: Array) => any;
function flatten(arr, result) {
for (let i = 0, len = arr.length; i < len; ++i) {
const value = arr[i];
if (isArray(value)) {
flatten(value, result);
} else {
result.push(value);
}