1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00
Files
seahub/frontend/src/metadata/metadata-view/utils/cell-value-utils.js

18 lines
545 B
JavaScript
Raw Normal View History

import { PRIVATE_COLUMN_KEYS } from '../_basic';
export const isValidCellValue = (value) => {
if (value === undefined) return false;
if (value === null) return false;
if (value === '') return false;
if (JSON.stringify(value) === '{}') return false;
if (JSON.stringify(value) === '[]') return false;
return true;
};
export const getCellValueByColumn = (record, column) => {
if (!record || !column) return null;
const { key, name } = column;
if (PRIVATE_COLUMN_KEYS.includes(key)) return record[key];
return record[name];
};