@8base/utils
Advanced tools
Comparing version 0.4.8 to 0.4.9
@@ -0,8 +1,11 @@ | ||
import * as R from 'ramda'; | ||
var formatFileCreationForMutation = function formatFileCreationForMutation(type, data) { | ||
if (Array.isArray(data)) { | ||
data = R.reject(R.isNil, data); | ||
} | ||
var formatFileCreationForMutation = function formatFileCreationForMutation(type, data) { | ||
return { create: data }; | ||
}; | ||
export { formatFileCreationForMutation }; |
@@ -0,1 +1,3 @@ | ||
import * as R from 'ramda'; | ||
import { isFileField } from './isFileField'; | ||
@@ -5,5 +7,5 @@ | ||
var isFileInstance = function isFileInstance(fieldSchema, data) { | ||
return isFileField(fieldSchema) && (data && typeof data.fileId === 'string' || Array.isArray(data) && isFileInstance(fieldSchema, data[0])); | ||
return isFileField(fieldSchema) && (data && typeof data.fileId === 'string' || Array.isArray(data) && isFileInstance(fieldSchema, data[0]) || R.isNil(data)); | ||
}; | ||
export { isFileInstance }; |
{ | ||
"name": "@8base/utils", | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"main": "es/index.js", | ||
@@ -5,0 +5,0 @@ "module": "es/index.js", |
//@flow | ||
import * as R from 'ramda'; | ||
import type { MutationType } from '../types'; | ||
const formatFileCreationForMutation = (type: MutationType, data: Object) => { | ||
if (Array.isArray(data)) { | ||
data = R.reject(R.isNil, data); | ||
} | ||
return { create: data }; | ||
@@ -6,0 +12,0 @@ }; |
//@flow | ||
import * as R from 'ramda'; | ||
import { isFileField } from './isFileField'; | ||
@@ -11,2 +13,4 @@ import type { FieldSchema } from '../types'; | ||
(Array.isArray(data) && isFileInstance(fieldSchema, data[0])) | ||
|| | ||
R.isNil(data) | ||
) | ||
@@ -13,0 +17,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
286113
612