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.11 to 0.4.13

4

es/formatters/formatConnectionForMutation.js

@@ -0,1 +1,3 @@

import * as R from 'ramda';
import { MUTATION_TYPE } from '../constants';

@@ -8,2 +10,4 @@

if (Array.isArray(formatedData)) {
formatedData = R.reject(R.isNil, formatedData);
formatedData = formatedData.map(function (item) {

@@ -10,0 +14,0 @@ return {

4

es/formatters/formatDataAfterQuery.js
import * as R from 'ramda';
import { getFieldSchemaByName, getTableSchemaByName } from '../selectors';
import { isRelationField, isListField } from '../verifiers';
import { isRelationField, isFileField, isListField } from '../verifiers';

@@ -27,3 +27,3 @@

if (isRelationField(fieldSchema) && isListField(fieldSchema)) {
if ((isRelationField(fieldSchema) || isFileField(fieldSchema)) && isListField(fieldSchema)) {
if (data[fieldName]) {

@@ -30,0 +30,0 @@ result = R.assoc(fieldName, data[fieldName].items, result);

@@ -7,5 +7,5 @@ import * as R from 'ramda';

var isFileReference = function isFileReference(fieldSchema, data) {
return isFileField(fieldSchema) && !R.isNil(data) && (typeof data === 'string' || data.length === 0 || typeof data[0] === 'string' || data && typeof data.id === 'string');
return isFileField(fieldSchema) && !R.isNil(data) && (typeof data === 'string' || data && typeof data.id === 'string' || Array.isArray(data) && (data.length === 0 || isFileReference(fieldSchema, data[0])));
};
export { isFileReference };
{
"name": "@8base/utils",
"version": "0.4.11",
"version": "0.4.13",
"main": "es/index.js",

@@ -5,0 +5,0 @@ "module": "es/index.js",

//@flow
import * as R from 'ramda';
import { MUTATION_TYPE } from '../constants';

@@ -9,2 +11,4 @@ import type { MutationType } from '../types';

if (Array.isArray(formatedData)) {
formatedData = R.reject(R.isNil, formatedData);
formatedData = formatedData.map((item) => ({

@@ -11,0 +15,0 @@ id: typeof item === 'string' ? item : (item.id || item),

@@ -5,3 +5,3 @@ //@flow

import { getFieldSchemaByName, getTableSchemaByName } from '../selectors';
import { isRelationField, isListField } from '../verifiers';
import { isRelationField, isFileField, isListField } from '../verifiers';
import type { FieldSchema, TableSchema, Schema } from '../types';

@@ -29,3 +29,3 @@

if (isRelationField(fieldSchema) && isListField(fieldSchema)) {
if ((isRelationField(fieldSchema) || isFileField(fieldSchema)) && isListField(fieldSchema)) {
if (data[fieldName]) {

@@ -32,0 +32,0 @@ result = R.assoc(fieldName, data[fieldName].items, result);

@@ -15,5 +15,15 @@ //@flow

||
(data.length === 0 || typeof data[0] === 'string')
(
data && typeof data.id === 'string'
)
||
(data && typeof data.id === 'string')
(
Array.isArray(data)
&&
(
data.length === 0
||
isFileReference(fieldSchema, data[0])
)
)
)

@@ -20,0 +30,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