mindee 4.17.0 → 4.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v4.17.1 - 2024-10-17
|
|
4
|
+
### Fixes
|
|
5
|
+
* :bug: fix invalid handling of boolean fields & fix accidental coercion into numbers in `GeneratedObjectField` fields
|
|
6
|
+
* :bug: fix `GeneratedObjectField` fields being inaccessible in typescript without going through the main object
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|
## v4.17.0 - 2024-10-11
|
|
4
10
|
### Changes
|
|
5
11
|
* :sparkles: add support for Financial Document v1.10
|
package/package.json
CHANGED
|
@@ -10,6 +10,8 @@ export declare class GeneratedObjectField {
|
|
|
10
10
|
rawValue?: string;
|
|
11
11
|
/** List of all printable field names. */
|
|
12
12
|
private printableValues;
|
|
13
|
+
/** All potentially present fields. */
|
|
14
|
+
[key: string]: string | number | boolean | object | undefined;
|
|
13
15
|
constructor({ prediction, pageId, }: BaseFieldConstructor);
|
|
14
16
|
/**
|
|
15
17
|
* ReSTructured-compliant string representation.
|
|
@@ -24,6 +26,7 @@ export declare class GeneratedObjectField {
|
|
|
24
26
|
*/
|
|
25
27
|
private toNumberString;
|
|
26
28
|
toString(): string;
|
|
29
|
+
get(fieldName: string): string | number | boolean | object | undefined;
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Checks whether a field is a custom object or not.
|
|
@@ -28,9 +28,16 @@ class GeneratedObjectField {
|
|
|
28
28
|
this.rawValue = fieldValue;
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
|
-
if (fieldValue !== null &&
|
|
31
|
+
if (fieldValue !== null &&
|
|
32
|
+
fieldValue !== undefined &&
|
|
33
|
+
typeof fieldValue === "number" &&
|
|
34
|
+
!isNaN(fieldValue) &&
|
|
35
|
+
fieldName !== "degrees") {
|
|
32
36
|
Object.assign(this, { [fieldName]: this.toNumberString(fieldValue) });
|
|
33
37
|
}
|
|
38
|
+
else if (typeof fieldValue === "boolean") {
|
|
39
|
+
Object.assign(this, { [fieldName]: fieldValue });
|
|
40
|
+
}
|
|
34
41
|
else {
|
|
35
42
|
Object.assign(this, {
|
|
36
43
|
[fieldName]: (fieldValue !== undefined && fieldValue !== null) ?
|
|
@@ -70,6 +77,9 @@ class GeneratedObjectField {
|
|
|
70
77
|
toString() {
|
|
71
78
|
return this.toStringLevel();
|
|
72
79
|
}
|
|
80
|
+
get(fieldName) {
|
|
81
|
+
return this[fieldName];
|
|
82
|
+
}
|
|
73
83
|
}
|
|
74
84
|
exports.GeneratedObjectField = GeneratedObjectField;
|
|
75
85
|
/**
|