@8base/utils
Advanced tools
Comparing version 0.4.15 to 0.4.16
@@ -5,5 +5,5 @@ import { isRelationField } from './isRelationField'; | ||
var isRelationReference = function isRelationReference(fieldSchema, data) { | ||
return isRelationField(fieldSchema) && (typeof data === 'string' || Array.isArray(data) && (data.length === 0 || typeof data[0] === 'string') || Array.isArray(data) && (data.length === 0 || typeof data[0].id === 'string')); | ||
return isRelationField(fieldSchema) && (typeof data === 'string' || data && typeof data.id === 'string' || Array.isArray(data) && (data.length === 0 || isRelationReference(fieldSchema, data[0]))); | ||
}; | ||
export { isRelationReference }; |
{ | ||
"name": "@8base/utils", | ||
"version": "0.4.15", | ||
"version": "0.4.16", | ||
"main": "es/index.js", | ||
@@ -5,0 +5,0 @@ "module": "es/index.js", |
@@ -11,7 +11,3 @@ //@flow | ||
|| | ||
( | ||
Array.isArray(data) | ||
&& | ||
(data.length === 0 || typeof data[0] === 'string') | ||
) | ||
data && typeof data.id === 'string' | ||
|| | ||
@@ -21,3 +17,3 @@ ( | ||
&& | ||
(data.length === 0 || typeof data[0].id === 'string') | ||
(data.length === 0 || isRelationReference(fieldSchema, data[0])) | ||
) | ||
@@ -24,0 +20,0 @@ ) |
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
287099
646