How to use the inferno-shared.isStringOrNumber function in inferno-shared

To help you get started, we’ve selected a few inferno-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github infernojs / inferno / packages / inferno-hyperscript / src / index.ts View on Github external
function isChildren(x: any): boolean {
  return isStringOrNumber(x) || (x && isArray(x));
}
github infernojs / inferno / packages / inferno-server / src / prop-renderers.ts View on Github external
export function renderStylesToString(styles: string | object): string {
  if (isString(styles)) {
    return styles;
  } else {
    let renderedString = '';
    for (const styleName in styles) {
      const value = styles[styleName];

      if (isStringOrNumber(value)) {
        renderedString += `${styleName}:${value};`;
      }
    }
    return renderedString;
  }
}