Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private transformProps() {
const {
title,
size,
message,
src,
primaryAction,
secondaryActions,
polaris,
} = this.props;
const {appBridge} = polaris;
if (!appBridge) return;
const safeTitle = typeof title === 'string' ? title : undefined;
const safeSize = size != null ? AppBridgeModal.Size[size] : undefined;
const srcPayload: {url?: string; path?: string} = {};
if (src != null) {
if (/^https?:\/\//.test(src)) {
srcPayload.url = src;
} else {
srcPayload.path = src;
}
}
return {
title: safeTitle,
message,
size: safeSize,
...srcPayload,
footer: {