diff --git a/packages/core/data-transfer/src/strapi/providers/local-destination/strategies/restore/entities.ts b/packages/core/data-transfer/src/strapi/providers/local-destination/strategies/restore/entities.ts index d3eb397a00..c34403762e 100644 --- a/packages/core/data-transfer/src/strapi/providers/local-destination/strategies/restore/entities.ts +++ b/packages/core/data-transfer/src/strapi/providers/local-destination/strategies/restore/entities.ts @@ -1,6 +1,6 @@ import type { SchemaUID } from '@strapi/strapi/lib/types/utils'; -import { get } from 'lodash/fp'; +import { get, last } from 'lodash/fp'; import { Writable } from 'stream'; import type { IEntity } from '../../../../../../types'; @@ -72,7 +72,7 @@ const createEntitiesWriteStream = (options: IEntitiesRestoreStreamOptions) => { // For each difference found on an ID attribute, // update the mapping the table accordingly diffs.forEach((diff) => { - if (diff.kind === 'modified' && diff.path.at(-1) === 'id') { + if (diff.kind === 'modified' && last(diff.path) === 'id') { const target = resolveType(diff.path); // If no type is found for the given path, then ignore the diff diff --git a/packages/core/data-transfer/tsconfig.json b/packages/core/data-transfer/tsconfig.json index cf0ec9c76a..120e31fd97 100644 --- a/packages/core/data-transfer/tsconfig.json +++ b/packages/core/data-transfer/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@tsconfig/node16/tsconfig.json", "compilerOptions": { "strict": true, - "lib": ["ESNEXT"], + "lib": ["ES2020"], + "target": "ES2020", "skipLibCheck": true, "outDir": "lib", "declaration": true,