Skip to content

Commit

Permalink
fix(core): use isEmpty to check for nested metakey instead of using l…
Browse files Browse the repository at this point in the history
…ength
  • Loading branch information
nartc committed Feb 26, 2021
1 parent 23174a1 commit 0329e6e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NamingConvention } from '@automapper/types';
import { isDefined } from '../utils';
import { isDefined, isEmpty } from '../utils';

export function getNestedMetaKeyAtDestinationPath(
destinationNestedMeta: any[],
Expand All @@ -9,7 +9,7 @@ export function getNestedMetaKeyAtDestinationPath(
) {
let destinationNestedMetaKeyAtPath: [unknown, unknown];

if (destinationNestedMeta.length && sourceNestedMeta.length) {
if (!isEmpty(sourceNestedMeta) && !isEmpty(destinationNestedMeta)) {
let sourceNestedMetaAtPath;
const destinationNestedMetaAtPath = destinationNestedMeta.find(
([dnmPath]) => dnmPath === destinationPath
Expand Down

0 comments on commit 0329e6e

Please sign in to comment.