@prismicio/types-internal 2.0.0-alpha.6 → 2.0.0-alpha.7

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.
@@ -12,6 +12,6 @@ function hasFieldContentType(obj) {
12
12
  }
13
13
  exports.hasFieldContentType = hasFieldContentType;
14
14
  function hasContentType(obj) {
15
- return typeof obj.__TYPE__ === "string";
15
+ return typeof obj === "object" && obj !== null && "__TYPE__" in obj;
16
16
  }
17
17
  exports.hasContentType = hasContentType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.7",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -15,5 +15,5 @@ export function hasFieldContentType(obj: unknown): obj is WithFieldType {
15
15
 
16
16
  type WithContentType = { __TYPE__: string }
17
17
  export function hasContentType(obj: unknown): obj is WithContentType {
18
- return typeof (obj as WithContentType).__TYPE__ === "string"
18
+ return typeof obj === "object" && obj !== null && "__TYPE__" in obj
19
19
  }