How to use the universal-serialize/src.TYPE function in universal-serialize

To help you get started, we’ve selected a few universal-serialize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github krakenjs / post-robot / dist / module / serialize / serialize.js View on Github external
function serializeMessage(destination, domain, obj, {
  on,
  send
}) {
  return (0, _src2.serialize)(obj, {
    [_src2.TYPE.PROMISE]: (val, key) => (0, _promise.serializePromise)(destination, domain, val, key, {
      on,
      send
    }),
    [_src2.TYPE.FUNCTION]: (val, key) => (0, _function.serializeFunction)(destination, domain, val, key, {
      on,
      send
    }),
    [_src2.TYPE.OBJECT]: val => {
      return (0, _src.isWindow)(val) || _window.ProxyWindow.isProxyWindow(val) ? (0, _window.serializeWindow)(destination, domain, val, {
        on,
        send
      }) : val;
    }
  });
}
github krakenjs / post-robot / dist / module / serialize / serialize.js View on Github external
function serializeMessage(destination, domain, obj, {
  on,
  send
}) {
  return (0, _src2.serialize)(obj, {
    [_src2.TYPE.PROMISE]: (val, key) => (0, _promise.serializePromise)(destination, domain, val, key, {
      on,
      send
    }),
    [_src2.TYPE.FUNCTION]: (val, key) => (0, _function.serializeFunction)(destination, domain, val, key, {
      on,
      send
    }),
    [_src2.TYPE.OBJECT]: val => {
      return (0, _src.isWindow)(val) || _window.ProxyWindow.isProxyWindow(val) ? (0, _window.serializeWindow)(destination, domain, val, {
        on,
        send
      }) : val;
    }
  });
}