From 84cf73aa09b318b1e1f93aa08509147f4573da67 Mon Sep 17 00:00:00 2001 From: Roman Kozodoi Date: Sun, 4 Aug 2024 05:26:44 +0700 Subject: [PATCH] fix: id building was not consistent when using deep accessorKey (4754) (#5430) * fix: id building was not consistent when using deep accessorKey (4754) * ci: apply automated fixes --------- Co-authored-by: Kevin Van Cott Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- packages/table-core/src/core/column.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/table-core/src/core/column.ts b/packages/table-core/src/core/column.ts index b725db57db..97ee3e68d4 100644 --- a/packages/table-core/src/core/column.ts +++ b/packages/table-core/src/core/column.ts @@ -79,7 +79,11 @@ export function createColumn( let id = resolvedColumnDef.id ?? - (accessorKey ? accessorKey.replace('.', '_') : undefined) ?? + (accessorKey + ? typeof String.prototype.replaceAll === 'function' + ? accessorKey.replaceAll('.', '_') + : accessorKey.replace(/\./g, '_') + : undefined) ?? (typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined)