@8base/utils
Advanced tools
Comparing version 0.2.8 to 0.2.9
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
import * as R from 'ramda'; | ||
import { isRelationField } from './isRelationField'; | ||
@@ -7,5 +8,5 @@ | ||
var isRelationInstance = function isRelationInstance(fieldSchema, data) { | ||
return isRelationField(fieldSchema) && (typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object'; | ||
return isRelationField(fieldSchema) && !R.isNil(data) && (typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object'; | ||
}; | ||
export { isRelationInstance }; |
@@ -1,2 +0,1 @@ | ||
import * as R from 'ramda'; | ||
import { isRelationField } from './isRelationField'; | ||
@@ -6,5 +5,5 @@ | ||
var isRelationReference = function isRelationReference(fieldSchema, data) { | ||
return isRelationField(fieldSchema) && (R.isNil(data) || typeof data === 'string' || Array.isArray(data) && (data.length === 0 || typeof data[0] === 'string')); | ||
return isRelationField(fieldSchema) && (typeof data === 'string' || Array.isArray(data) && (data.length === 0 || typeof data[0] === 'string')); | ||
}; | ||
export { isRelationReference }; |
{ | ||
"name": "@8base/utils", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"main": "es/index.js", | ||
@@ -5,0 +5,0 @@ "module": "es/index.js", |
//@flow | ||
import * as R from 'ramda'; | ||
import { isRelationField } from './isRelationField'; | ||
@@ -8,2 +9,4 @@ import type { FieldSchema } from '../types'; | ||
&& | ||
!R.isNil(data) | ||
&& | ||
typeof data === 'object' | ||
@@ -10,0 +13,0 @@ ); |
//@flow | ||
import * as R from 'ramda'; | ||
import { isRelationField } from './isRelationField'; | ||
@@ -10,4 +9,2 @@ import type { FieldSchema } from '../types'; | ||
( | ||
R.isNil(data) | ||
|| | ||
typeof data === 'string' | ||
@@ -14,0 +11,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
223303