Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function deserializeMessage(source, origin, message) {
var _deserialize;
return deserialize(message, (_deserialize = {}, _deserialize[CUSTOM_TYPE.CROSS_DOMAIN_ZALGO_PROMISE] = function (_ref5) {
var then = _ref5.then;
return deserializePromise(source, origin, { then: then });
}, _deserialize[CUSTOM_TYPE.CROSS_DOMAIN_FUNCTION] = function (_ref6) {
var id = _ref6.id,
name = _ref6.name;
return deserializeFunction(source, origin, { id: id, name: name });
}, _deserialize));
}
export function deserializeMessage(source : CrossDomainWindowType | ProxyWindow, origin : string, message : string, { on, send } : { on : OnType, send : SendType }) : T {
return deserialize(message, {
[ SERIALIZATION_TYPE.CROSS_DOMAIN_ZALGO_PROMISE ]: (serializedPromise) => deserializePromise(source, origin, serializedPromise),
[ SERIALIZATION_TYPE.CROSS_DOMAIN_FUNCTION ]: (serializedFunction) => deserializeFunction(source, origin, serializedFunction, { on, send }),
[ SERIALIZATION_TYPE.CROSS_DOMAIN_WINDOW ]: (serializedWindow) => deserializeWindow(source, origin, serializedWindow, { send })
});
}