sentryPropTypeValidators.tsx 835 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @deprecated
  3. */
  4. function isObject(
  5. props: unknown,
  6. propName: string,
  7. _componentName: unknown
  8. ): null | Error {
  9. if (typeof props !== 'object' || props === null) {
  10. return new Error('props does not contain organization property');
  11. }
  12. if (!(propName in props)) {
  13. return null;
  14. }
  15. // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
  16. if (!props[propName]) {
  17. return null;
  18. }
  19. // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
  20. if (typeof props[propName] !== 'object') {
  21. throw new Error(`props.${propName} is not of type object`);
  22. }
  23. return null;
  24. }
  25. /**
  26. * @deprecated
  27. */
  28. export const SentryPropTypeValidators = {
  29. isObject,
  30. };