@8base/utils
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -0,1 +1,2 @@ | ||
import * as R from 'ramda'; | ||
import { isRelationField } from './isRelationField'; | ||
@@ -5,5 +6,5 @@ | ||
var isRelationReference = function isRelationReference(fieldSchema, data) { | ||
return isRelationField(fieldSchema) && (typeof data === 'string' || data.length === 0 || typeof data[0] === 'string'); | ||
return isRelationField(fieldSchema) && (R.isNil(data) || typeof data === 'string' || Array.isArray(data) && (data.length === 0 || typeof data[0] === 'string')); | ||
}; | ||
export { isRelationReference }; |
{ | ||
"name": "@8base/utils", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"main": "es/index.js", | ||
@@ -5,0 +5,0 @@ "module": "es/index.js", |
//@flow | ||
import * as R from 'ramda'; | ||
import { isRelationField } from './isRelationField'; | ||
@@ -8,5 +9,15 @@ import type { FieldSchema } from '../types'; | ||
&& | ||
(typeof data === 'string' || data.length === 0 || typeof data[0] === 'string') | ||
( | ||
R.isNil(data) | ||
|| | ||
typeof data === 'string' | ||
|| | ||
( | ||
Array.isArray(data) | ||
&& | ||
(data.length === 0 || typeof data[0] === 'string') | ||
) | ||
) | ||
); | ||
export { isRelationReference }; |
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
223305
504