Set lib & target to node 14, remove usage of Array.at

This commit is contained in:
Convly 2023-01-05 10:57:08 +01:00
parent 4d327803cd
commit b3ffb28aa9
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -2,7 +2,8 @@
"extends": "@tsconfig/node16/tsconfig.json",
"compilerOptions": {
"strict": true,
"lib": ["ESNEXT"],
"lib": ["ES2020"],
"target": "ES2020",
"skipLibCheck": true,
"outDir": "lib",
"declaration": true,