@tramvai/module-client-hints 7.11.1 → 7.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,8 @@ const SUPPOSED_MEDIA = {
29
29
  };
30
30
  const readMediaCommand = ({ context, cookieManager, }) => {
31
31
  return function readMedia() {
32
- const mediaInfo = safeParseJSON(cookieManager.get(COOKIE_NAME_MEDIA_INFO) ?? '');
32
+ const rawValue = cookieManager.get(COOKIE_NAME_MEDIA_INFO);
33
+ const mediaInfo = rawValue ? safeParseJSON(rawValue) : null;
33
34
  if (mediaInfo) {
34
35
  return context.dispatch(setMedia({
35
36
  ...mediaInfo,
@@ -37,7 +37,8 @@ const SUPPOSED_MEDIA = {
37
37
  };
38
38
  const readMediaCommand = ({ context, cookieManager, }) => {
39
39
  return function readMedia() {
40
- const mediaInfo = safeStrings.safeParseJSON(cookieManager.get(constants.COOKIE_NAME_MEDIA_INFO) ?? '');
40
+ const rawValue = cookieManager.get(constants.COOKIE_NAME_MEDIA_INFO);
41
+ const mediaInfo = rawValue ? safeStrings.safeParseJSON(rawValue) : null;
41
42
  if (mediaInfo) {
42
43
  return context.dispatch(media.setMedia({
43
44
  ...mediaInfo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-client-hints",
3
- "version": "7.11.1",
3
+ "version": "7.16.0",
4
4
  "description": "",
5
5
  "main": "lib/server.js",
6
6
  "module": "lib/server.es.js",
@@ -20,21 +20,21 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@tinkoff/env-validators": "0.6.1",
23
- "@tinkoff/user-agent": "0.9.33",
23
+ "@tinkoff/user-agent": "0.9.55",
24
24
  "@tinkoff/utils": "^2.1.2",
25
- "@tramvai/module-metrics": "7.11.1",
25
+ "@tramvai/module-metrics": "7.16.0",
26
26
  "@tramvai/safe-strings": "0.10.1",
27
- "@tramvai/tokens-child-app": "7.11.1",
28
- "@tramvai/tokens-common": "7.11.1",
29
- "@tramvai/tokens-cookie": "7.11.1",
30
- "@tramvai/tokens-render": "7.11.1",
27
+ "@tramvai/tokens-child-app": "7.16.0",
28
+ "@tramvai/tokens-common": "7.16.0",
29
+ "@tramvai/tokens-cookie": "7.16.0",
30
+ "@tramvai/tokens-render": "7.16.0",
31
31
  "user-agent-data-types": "^0.3.1"
32
32
  },
33
33
  "peerDependencies": {
34
- "@tinkoff/dippy": "0.13.2",
34
+ "@tinkoff/dippy": "^1.0.0",
35
35
  "@tinkoff/logger": "^0.10.516",
36
- "@tramvai/core": "7.11.1",
37
- "@tramvai/state": "7.11.1",
36
+ "@tramvai/core": "7.16.0",
37
+ "@tramvai/state": "7.16.0",
38
38
  "react": ">=16.14.0",
39
39
  "react-dom": ">=16.14.0",
40
40
  "tslib": "^2.4.0"