How to use the expo-errors.UnavailabilityError function in expo-errors

To help you get started, we’ve selected a few expo-errors 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 expo / expo / packages / expo-image-manipulator / src / ImageManipulator.ts View on Github external
export async function manipulateAsync(
  uri: string,
  actions: Action[] = [],
  { format = SaveFormat.JPEG, ...rest }: SaveOptions = {},
): Promise {
  if (!ExpoImageManipulator.manipulateAsync) {
    throw new UnavailabilityError('ImageManipulator', 'manipulateAsync');
  }
  if (!(typeof uri === 'string')) {
    throw new TypeError('The "uri" argument must be a string');
  }
  return await ExpoImageManipulator.manipulateAsync(uri, actions, { format, ...rest });
}
github expo / expo / packages / expo / src / Amplitude / Amplitude.ts View on Github external
setUserId(userId: string): void {
    if (!ExponentAmplitude.setUserId) {
      throw new UnavailabilityError('Amplitude', 'setUserId');
    }
    return ExponentAmplitude.setUserId(userId);
  },
github expo / expo / packages / expo / src / Amplitude / Amplitude.ts View on Github external
setGroup(groupType: string, groupNames: string[]): void {
    if (!ExponentAmplitude.setGroup) {
      throw new UnavailabilityError('Amplitude', 'setGroup');
    }
    return ExponentAmplitude.setGroup(groupType, groupNames);
  },
};
github expo / expo / packages / expo-web-browser / build / WebBrowser.js View on Github external
export async function openBrowserAsync(url) {
    if (!ExponentWebBrowser.openBrowserAsync) {
        throw new UnavailabilityError('WebBrowser', 'openBrowserAsync');
    }
    return ExponentWebBrowser.openBrowserAsync(url);
}
export function dismissBrowser() {
github expo / expo / packages / expo / src / Amplitude / Amplitude.ts View on Github external
logEventWithProperties(eventName: string, properties: { [name: string]: any }): void {
    if (!ExponentAmplitude.logEventWithProperties) {
      throw new UnavailabilityError('Amplitude', 'logEventWithProperties');
    }
    return ExponentAmplitude.logEventWithProperties(eventName, properties);
  },
github expo / expo / packages / expo-web-browser / build / WebBrowser.js View on Github external
export function dismissBrowser() {
    if (!ExponentWebBrowser.dismissBrowser) {
        throw new UnavailabilityError('WebBrowser', 'dismissBrowser');
    }
    ExponentWebBrowser.dismissBrowser();
}
export async function openAuthSessionAsync(url, redirectUrl) {
github expo / expo / packages / expo-web-browser / build / WebBrowser.js View on Github external
export async function openAuthSessionAsync(url, redirectUrl) {
    if (_authSessionIsNativelySupported()) {
        if (!ExponentWebBrowser.openAuthSessionAsync) {
            throw new UnavailabilityError('WebBrowser', 'openAuthSessionAsync');
        }
        return ExponentWebBrowser.openAuthSessionAsync(url, redirectUrl);
    }
    else {
        return _openAuthSessionPolyfillAsync(url, redirectUrl);
    }
}
export function dismissAuthSession() {
github expo / expo / packages / expo-random / build / Random.js View on Github external
export async function getRandomBytesAsync(byteCount) {
    assertByteCount(byteCount);
    const validByteCount = Math.floor(byteCount);
    if (ExpoRandom.getRandomBytesAsync) {
        return await ExpoRandom.getRandomBytesAsync(validByteCount);
    }
    else if (ExpoRandom.getRandomBase64StringAsync) {
        const base64 = await ExpoRandom.getRandomBase64StringAsync(validByteCount);
        return toByteArray(base64);
    }
    else {
        throw new UnavailabilityError('expo-random', 'getRandomBytesAsync');
    }
}
//# sourceMappingURL=Random.js.map
github expo / expo / packages / expo-image-manipulator / build / ImageManipulator.js View on Github external
export async function manipulateAsync(uri, actions = [], { format = SaveFormat.JPEG, ...rest } = {}) {
    if (!ExpoImageManipulator.manipulateAsync) {
        throw new UnavailabilityError('ImageManipulator', 'manipulateAsync');
    }
    if (!(typeof uri === 'string')) {
        throw new TypeError('The "uri" argument must be a string');
    }
    return await ExpoImageManipulator.manipulateAsync(uri, actions, { format, ...rest });
}
export { FlipType, SaveFormat, };

expo-errors

An internal module in Expo that helps us standardize error handling across all of our modules and provide a place for all error-related code to live.

MIT
Latest version published 6 years ago

Package Health Score

70 / 100
Full package analysis

Popular expo-errors functions