Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@8base/utils

Package Overview
Dependencies
Maintainers
2
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@8base/utils - npm Package Compare versions

Comparing version 0.4.8 to 0.4.9

7

es/formatters/formatFileCreationForMutation.js

@@ -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 @@ );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc