INNER CODE UNIT · TypeScript

isError

invertase/notifee · packages/react-native/src/utils/index.ts:10

export function isError(value: object): boolean {
  if (Object.prototype.toString.call(value) === '[object Error]') {
    return true;
  }

  return value instanceof Error;
}

export function objectHasProperty<T>(
  target: T,
  property: string | number | symbol,
): property is keyof T {
  return Object.hasOwnProperty.call(target, property);
}

export const isIOS = Platform.OS === 'ios';

export const isAndroid = Platform.OS === 'android';

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…