How to use the is-lite.string function in is-lite

To help you get started, we’ve selected a few is-lite 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 gilbarbara / react-joyride / src / modules / propTypes.js View on Github external
location: string,
    propFullName: string,
  ): any => {
    const propValue = props[propName];
    let Component = propValue;

    if (!React.isValidElement(propValue) && isValidElementType(propValue)) {
      const ownProps = {
        ref: () => {},
        step: {},
      };
      Component = ;
    }

    if (
      is.string(propValue) ||
      is.number(propValue) ||
      !isValidElementType(propValue) ||
      ![Element, ForwardRef].includes(typeOf(Component))
    ) {
      return new Error(
        `Invalid ${location} \`${propFullName}\` supplied to \`${componentName}\`. Expected a React class or forwardRef.`,
      );
    }

    return undefined;
  },
);

is-lite

A tiny javascript type testing tool

MIT
Latest version published 10 months ago

Package Health Score

60 / 100
Full package analysis