Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function traversePathAsync<T extends object>(
let parent = obj;

while (path.length < realPath.length) {
const key = path.at(-1) as keyof typeof parent;
const key = path[path.length - 1] as keyof typeof parent;

const value = modifier
? await modifier({
Expand All @@ -110,7 +110,7 @@ export async function traversePathAsync<T extends object>(
path.push(realPath[path.length]);
}

const key = realPath.at(-1);
const key = realPath[realPath.length - 1];

return {
parent,
Expand Down Expand Up @@ -145,7 +145,7 @@ export function traversePath<T extends object>(
let parent = obj;

while (path.length < realPath.length) {
const key = path.at(-1) as keyof typeof parent;
const key = path[path.length - 1] as keyof typeof parent;

const value = modifier
? modifier({
Expand All @@ -164,7 +164,7 @@ export function traversePath<T extends object>(
path.push(realPath[path.length]);
}

const key = realPath.at(-1);
const key = realPath[realPath.length - 1];
return {
parent,
key: String(key),
Expand Down