sentryPropTypeValidators.tsx 563 B

1234567891011121314151617181920212223242526272829303132
  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. if (!props[propName]) {
  16. return null;
  17. }
  18. if (typeof props[propName] !== 'object') {
  19. throw new Error(`props.${propName} is not of type object`);
  20. }
  21. return null;
  22. }
  23. /**
  24. * @deprecated
  25. */
  26. export const SentryPropTypeValidators = {
  27. isObject,
  28. };