datocms-structured-text-utils
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -43,2 +43,19 @@ "use strict"; | ||
} | ||
if ('meta' in node) { | ||
if (!Array.isArray(node.meta)) { | ||
return { value: { | ||
valid: false, | ||
message: "\"" + node.type + "\"'s meta is not an Array:\n\n " + JSON.stringify(node, null, 2), | ||
} }; | ||
} | ||
var invalidMeta = node.meta.find(function (entry) { | ||
return typeof entry !== 'object' || !('id' in entry) || !('value' in entry); | ||
}); | ||
if (invalidMeta) { | ||
return { value: { | ||
valid: false, | ||
message: "\"" + node.type + "\" has an invalid meta " + JSON.stringify(invalidMeta) + ":\n\n " + JSON.stringify(node, null, 2), | ||
} }; | ||
} | ||
} | ||
if ('marks' in node) { | ||
@@ -45,0 +62,0 @@ if (!Array.isArray(node.marks)) { |
{ | ||
"name": "datocms-structured-text-utils", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A set of Typescript types and helpers to work with DatoCMS Structured Text fields", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "ee4667a693fc8a85d607695d0c20bd6c193539fc" | ||
"gitHead": "c8c90e84ca427ad08412fc2a1bca296d70f3e407" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44599
816