Skip to content

Commit e082140

Browse files
fix: πŸ› handle attribute of type array when merging pages (#60)
* fix: πŸ› handle attribute of type array when merging pages * chg: πŸ”– prepare v1.0.9 release
1 parent 0755885 commit e082140

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

β€ŽCHANGELOG.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
# CHANGELOG
22

3+
## v1.0.9 (2021-12-09)
4+
5+
### Fixes
6+
7+
- fix: πŸ› handle attribute of type array when merging pages
8+
39
## v1.0.8 (2021-11-29)
410

511
### Fixes
12+
613
- πŸ› fix cutPDF for ReadableStream + add it for base64 file string
714
- πŸ› Updated api Input initialization to specifically declare parameters
815
- πŸ› prevent error when the mime type isn't detectable
916
- πŸ› raise proper error when the APi doesn't return a valid JSON
1017

1118
### new
19+
1220
- :see_no_evil: add .DS_Store to ignore file
1321

1422
## v1.0.7 (2021-11-25)
1523

1624
### New
25+
1726
- ✨ Added pdf page number parameter for multi-pages pdfs with file
1827

1928
### Changes
29+
2030
- :arrow_up: upgrade path-parse dependency
2131
- :arrow_up: upgrade browserslist dependency
2232
- :arrow_up: upgrade lodash dependency
@@ -25,29 +35,31 @@
2535
## v1.0.4 (2021-02-18)
2636

2737
### New
28-
* :sparkles: :zap: Add a parameter `filename` and a default filename for streams
38+
39+
- :sparkles: :zap: Add a parameter `filename` and a default filename for streams
2940

3041
### Changes
31-
* :zap: Change parse function to use an object instead of multiples parameters
3242

43+
- :zap: Change parse function to use an object instead of multiples parameters
3344

3445
## v1.0.3 (2021-02-01)
3546

3647
### Fixes
37-
* :bug: _request parameters
38-
* :bug: `pageNumber` default value
39-
* :bug: reconstruction method set fields to probability
4048

49+
- :bug: \_request parameters
50+
- :bug: `pageNumber` default value
51+
- :bug: reconstruction method set fields to probability
4152

4253
## v1.0.2 (2021-02-01)
4354

4455
### Changes
45-
* :zap: Better coverage for total tax
56+
57+
- :zap: Better coverage for total tax
4658

4759
### Fixes
48-
* :bug: `includeWords` is now working
4960

61+
- :bug: `includeWords` is now working
5062

5163
## v1.0.1 (2021-01-11)
5264

53-
* πŸŽ‰ First release
65+
- πŸŽ‰ First release

β€Žmindee/documents/document.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class Document {
5050
const attributes = Object.getOwnPropertyNames(finalDocument);
5151
for (const document of documents) {
5252
for (const attribute of attributes) {
53-
if (
53+
if (Array.isArray(document?.[attribute])) {
54+
finalDocument[attribute] = finalDocument[attribute]?.length
55+
? finalDocument[attribute]
56+
: document?.[attribute];
57+
} else if (
5458
document?.[attribute]?.probability >
5559
finalDocument[attribute].probability
5660
) {

β€Žpackage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mindee",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "Mindee API SDK for Node.js",
55
"main": "mindee/index.js",
66
"license": "GPL-3.0",

0 commit comments

Comments
Β (0)