@flatfile/hooks
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -12,2 +12,3 @@ type TPrimitive = string | boolean | number | null; | ||
interface IRawRecord { | ||
metadata?: Object; | ||
rawData: TRecordDataWithLinks; | ||
@@ -41,2 +42,3 @@ rowId: number | string; | ||
private readonly data; | ||
private readonly metadata; | ||
private readonly mutated; | ||
@@ -52,4 +54,6 @@ private readonly _rowId; | ||
set(field: string, value: TPrimitive): this | undefined; | ||
setMetadata(data: Object): this; | ||
setLinkedValue(linkedFieldKey: string, childKey: string, value: TPrimitive): this; | ||
get(field: string): null | TPrimitive; | ||
getMetadata(): Object; | ||
getLinks(field: string): any; | ||
@@ -56,0 +60,0 @@ getLinkedValue(linkedFieldKey: string, childKey: string): string | number | boolean | { |
@@ -36,2 +36,3 @@ "use strict"; | ||
this.data = Object.assign({}, raw.rawData); | ||
this.metadata = Object.assign({}, raw.metadata); | ||
this._rowId = raw.rowId; | ||
@@ -82,2 +83,6 @@ } | ||
} | ||
setMetadata(data) { | ||
Object.defineProperty(this, "metadata", { value: data }); | ||
return this; | ||
} | ||
setLinkedValue(linkedFieldKey, childKey, value) { | ||
@@ -100,2 +105,5 @@ if (!this.verifyField(linkedFieldKey)) { | ||
} | ||
getMetadata() { | ||
return this.metadata; | ||
} | ||
getLinks(field) { | ||
@@ -130,2 +138,5 @@ if (this.verifyField(field)) { | ||
} | ||
/** | ||
* @alias addInfo | ||
*/ | ||
addComment(fields, message) { | ||
@@ -158,3 +169,4 @@ return this.addInfo(fields, message); | ||
rawData: this.mutated, | ||
rowId: this.rowId | ||
rowId: this.rowId, | ||
metadata: this.metadata | ||
}, | ||
@@ -161,0 +173,0 @@ info: this._info |
{ | ||
"name": "@flatfile/hooks", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"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
16143
507