@flatfile/hooks
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -56,3 +56,3 @@ type TPrimitive = string | boolean | number | null; | ||
getMetadata(): Object; | ||
getLinks(field: string): any; | ||
getLinks(field: string): TRecordData<TPrimitive>[] | null; | ||
getLinkedValue(linkedFieldKey: string, childKey: string): string | number | boolean | { | ||
@@ -59,0 +59,0 @@ value: TPrimitive; |
@@ -109,16 +109,10 @@ "use strict"; | ||
const fieldValue = this.mutated[field]; | ||
if (!fieldValue) | ||
return null; | ||
if (typeof fieldValue === "object") { | ||
if (fieldValue && typeof fieldValue === "object") { | ||
const { links } = fieldValue; | ||
if (!links) { | ||
console.error("Field is has no links."); | ||
return null; | ||
if (links) { | ||
return links; | ||
} | ||
return links; | ||
} else if (typeof fieldValue === "string") { | ||
console.error("Field is not a ReferenceField."); | ||
return fieldValue; | ||
} | ||
} | ||
console.error("Field has no links."); | ||
return null; | ||
@@ -125,0 +119,0 @@ } |
{ | ||
"name": "@flatfile/hooks", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18544
536