Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return WILDCARD;
}
if (!isActuallySameDomain(win)) {
throw new Error(`Attempting to send messsage to mock domain ${ dom }, but window is actually cross-domain`);
}
// $FlowFixMe
const windowDomain = getDomain(win);
if (windowDomain !== dom) {
throw new Error(`Mock domain target ${ dom } does not match window domain ${ windowDomain }`);
}
// $FlowFixMe
return getActualDomain(win);
}
}
if (dom.indexOf(PROTOCOL.FILE) === 0) {
return WILDCARD;
}
return dom;
});
export function buildUrl(domain : string, uri? : string) : string {
if (domain.indexOf('mock://') === 0 && typeof window !== 'undefined') {
domain = getActualDomain();
}
return `${ domain }${ uri || '' }`;
}
export function buildPayPalUrl() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return __TEST__ && __WEB__ ? '' + getActualDomain() + path : '' + getPayPalDomain() + path;
}
export function buildPayPalAPIUrl(path : string = '') : string {
const paypalAPIDomain = isCurrentDomain(getPayPalDomain())
? getPayPalDomain()
: getPayPalAPIDomain();
return (__TEST__ && __WEB__)
? `${ getActualDomain() }${ path }`
: `${ paypalAPIDomain }${ path }`;
}
export function buildPayPalUrl(path : string = '') : string {
return (__TEST__ && __WEB__)
? `${ getActualDomain() }${ path }`
: `${ getPayPalDomain() }${ path }`;
}
export function buildPayPalAPIUrl() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var paypalAPIDomain = isCurrentDomain(getPayPalDomain()) ? getPayPalDomain() : getPayPalAPIDomain();
return __TEST__ && __WEB__ ? '' + getActualDomain() + path : '' + paypalAPIDomain + path;
}