@prismicio/types-internal 2.1.0-alpha.0 → 2.1.0-alpha.2

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.
@@ -62,7 +62,12 @@ function extractMetadata(data) {
62
62
  widgets: {},
63
63
  });
64
64
  const slugs = data["slugs_INTERNAL"] || [];
65
- const uid = data["uid"];
65
+ const uid = (() => {
66
+ const rawUID = data["uid"];
67
+ if ((0, fields_1.isUIDContent)(rawUID))
68
+ return rawUID.value;
69
+ return;
70
+ })();
66
71
  return {
67
72
  widgets,
68
73
  types,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "2.1.0-alpha.0",
3
+ "version": "2.1.0-alpha.2",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -4,7 +4,7 @@ import { pipe } from "fp-ts/lib/function"
4
4
  import * as t from "io-ts"
5
5
 
6
6
  import { WidgetKey } from "../common"
7
- import { WidgetContent, WidgetLegacy } from "./fields"
7
+ import { isUIDContent, WidgetContent, WidgetLegacy } from "./fields"
8
8
  import {
9
9
  defaultCtx,
10
10
  FieldOrSliceType,
@@ -97,7 +97,11 @@ function extractMetadata(data: { [p: string]: unknown }): {
97
97
  )
98
98
 
99
99
  const slugs = (data["slugs_INTERNAL"] as string[]) || []
100
- const uid = data["uid"] as string | undefined
100
+ const uid = (() => {
101
+ const rawUID = data["uid"]
102
+ if (isUIDContent(rawUID)) return rawUID.value
103
+ return
104
+ })()
101
105
 
102
106
  return {
103
107
  widgets,