feat: merge records (#13436)

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
neo773
2025-07-31 15:36:36 +05:30
committed by GitHub
parent 00d12e854a
commit 06e0814ce8
45 changed files with 2047 additions and 29 deletions
@@ -0,0 +1,29 @@
export const hasRecordFieldValue = (value: unknown): boolean => {
if (value === null || value === undefined) {
return false;
}
if (typeof value === 'string') {
return value.trim() !== '';
}
if (typeof value === 'number') {
return !isNaN(value);
}
if (typeof value === 'boolean') {
return true;
}
if (Array.isArray(value)) {
return value.length > 0;
}
if (typeof value === 'object') {
const objectValue = value as Record<string, unknown>;
return Object.values(objectValue).some((val) => hasRecordFieldValue(val));
}
return true;
};