expo-pod-pinner
Version:
The Pod Pinner plugin allows you to modify your Podfile in a managed workflow.
29 lines (28 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateRegexFromString = exports.validatePluginProps = void 0;
const types_1 = require("../types/types");
function validatePluginProps(props) {
// check the type of each property
if (typeof props.targetName !== "string") {
throw new Error("Expo Pod Pinner: 'targetName' must be a string.");
}
if (props.pods && (0, types_1.isPodEntry)(props.pods)) {
throw new Error("Expo Pod Pinner: 'pods' must be an object with string keys and string values.");
}
if (props.specs && (0, types_1.isSpecEntry)(props.specs)) {
throw new Error("Expo Pod Pinner: 'specs' must be an object with string keys and string values.");
}
// check for extra properties
const inputProps = Object.keys(props);
for (const prop of inputProps) {
if (!types_1.PLUGIN_PROPS.includes(prop)) {
throw new Error(`Expo Pod Pinner: '${prop}' is not a valid property.`);
}
}
}
exports.validatePluginProps = validatePluginProps;
function generateRegexFromString(input) {
return new RegExp(input, "g");
}
exports.generateRegexFromString = generateRegexFromString;