UNPKG

@alaudoni/expo-firebase-extension-plugin

Version:

The Firebase Expo plugin allows you to use Firebase without leaving the managed workflow. Developed in collaboration with SweetGreen.

36 lines (35 loc) 1.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validatePluginProps = validatePluginProps; const types_1 = require("../types/types"); function validatePluginProps(props) { // check the type of each property if (typeof props.mode !== "string") { throw new Error("FirebaseLog Expo Plugin: 'mode' must be a string."); } if (props.devTeam && typeof props.devTeam !== "string") { throw new Error("FirebaseLog Expo Plugin: 'devTeam' must be a string."); } if (props.iPhoneDeploymentTarget && typeof props.iPhoneDeploymentTarget !== "string") { throw new Error("FirebaseLog Expo Plugin: 'iPhoneDeploymentTarget' must be a string."); } if (props.smallIcons && !Array.isArray(props.smallIcons)) { throw new Error("FirebaseLog Expo Plugin: 'smallIcons' must be an array."); } if (props.smallIconAccentColor && typeof props.smallIconAccentColor !== "string") { throw new Error("FirebaseLog Expo Plugin: 'smallIconAccentColor' must be a string."); } if (props.largeIcons && !Array.isArray(props.largeIcons)) { throw new Error("FirebaseLog Expo Plugin: 'largeIcons' must be an array."); } if (props.iosNSEFilePath && typeof props.iosNSEFilePath !== "string") { throw new Error("FirebaseLog Expo Plugin: 'iosNSEFilePath' must be a string."); } // check for extra properties const inputProps = Object.keys(props); for (const prop of inputProps) { if (!types_1.Firebase_PLUGIN_PROPS.includes(prop)) { throw new Error(`FirebaseLog Expo Plugin: You have provided an invalid property "${prop}" to the FirebaseLog plugin.`); } } }