@8base/utils
Advanced tools
Comparing version 0.16.10 to 0.17.0
@@ -15,3 +15,4 @@ "use strict"; | ||
TEXT: 'TEXT', | ||
SMART: 'SMART' | ||
SMART: 'SMART', | ||
JSON: 'JSON' | ||
}; | ||
@@ -18,0 +19,0 @@ exports.FIELD_TYPE = FIELD_TYPE; |
@@ -55,2 +55,10 @@ "use strict"; | ||
if ((0, _verifiers.isJSONField)(fieldSchema)) { | ||
if ((0, _verifiers.isListField)(fieldSchema)) { | ||
result[fieldName] = R.map(JSON.stringify, result[fieldName]); | ||
} else { | ||
result[fieldName] = JSON.stringify(result[fieldName]); | ||
} | ||
} | ||
return result; | ||
@@ -57,0 +65,0 @@ }, {}, R.keys(data)); |
@@ -50,2 +50,8 @@ "use strict"; | ||
} | ||
} else if (verifiers.isJSONField(fieldSchema)) { | ||
if (verifiers.isListField(fieldSchema)) { | ||
nextData = R.map(JSON.parse, nextData); | ||
} else { | ||
nextData = JSON.parse(nextData); | ||
} | ||
} | ||
@@ -52,0 +58,0 @@ |
@@ -60,2 +60,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "isJSONField", { | ||
enumerable: true, | ||
get: function get() { | ||
return _isJSONField.isJSONField; | ||
} | ||
}); | ||
@@ -78,2 +84,4 @@ var _isAddressField = require("./isAddressField"); | ||
var _isBigInt = require("./isBigInt"); | ||
var _isBigInt = require("./isBigInt"); | ||
var _isJSONField = require("./isJSONField"); |
{ | ||
"name": "@8base/utils", | ||
"version": "0.16.10", | ||
"version": "0.17.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
@@ -12,2 +12,3 @@ //@flow | ||
SMART: 'SMART', | ||
JSON: 'JSON', | ||
}; | ||
@@ -95,1 +96,2 @@ | ||
}; | ||
@@ -5,3 +5,9 @@ //@flow | ||
import { getFieldSchemaByName, getTableSchemaByName } from '../selectors'; | ||
import { isRelationField, isFileField, isListField, isMetaField } from '../verifiers'; | ||
import { | ||
isRelationField, | ||
isFileField, | ||
isListField, | ||
isMetaField, | ||
isJSONField, | ||
} from '../verifiers'; | ||
@@ -46,2 +52,10 @@ import type { FieldSchema, TableSchema, Schema } from '../types'; | ||
if (isJSONField(fieldSchema)) { | ||
if (isListField(fieldSchema)) { | ||
result[fieldName] = R.map(JSON.stringify, result[fieldName]); | ||
} else { | ||
result[fieldName] = JSON.stringify(result[fieldName]); | ||
} | ||
} | ||
return result; | ||
@@ -48,0 +62,0 @@ }, {}, R.keys(data)); |
@@ -43,2 +43,8 @@ //@flow | ||
} | ||
} else if (verifiers.isJSONField(fieldSchema)) { | ||
if (verifiers.isListField(fieldSchema)) { | ||
nextData = R.map(JSON.parse, nextData); | ||
} else { | ||
nextData = JSON.parse(nextData); | ||
} | ||
} | ||
@@ -45,0 +51,0 @@ |
@@ -10,1 +10,3 @@ export { isAddressField } from './isAddressField'; | ||
export { isBigInt } from './isBigInt'; | ||
export { isJSONField } from './isJSONField'; | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
417695
115
3493