Skip to content

Commit fb128b9

Browse files
committed
Resolve conflict
2 parents 2a107db + c841855 commit fb128b9

39 files changed

+453
-711
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
## 4.3.0 (2023-10-10)
2+
3+
### ✨ Features
4+
5+
* Enable async callback function for CSVDownloader
6+
7+
Credits
8+
9+
* [@JakeHaitsma](https://github.com/JakeHaitsma)
10+
11+
## 4.2.2 (2023-10-09)
12+
13+
### ✨ Features
14+
15+
* Fix type
16+
17+
Credits
18+
19+
* [@Bunlong](https://github.com/Bunlong)
20+
21+
## 4.2.0 (2023-10-07)
22+
23+
### ✨ Features
24+
25+
* Upgrade dependencies
26+
27+
Credits
28+
29+
* [@Bunlong](https://github.com/Bunlong)
30+
131
## 4.1.0 (2022-08-07)
232

333
### ✨ Bugs

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ export default function CSVDownloader() {
713713

714714
#### Data as a Function/Callback
715715

716-
`data={}` can be a function that returns a data object.
716+
`data={}` can be a synchronous or asynchronous function that returns a data object.
717717

718718
```javascript
719719
import React from 'react';
@@ -809,7 +809,7 @@ export default function JsonToCSV() {
809809
const { jsonToCSV } = usePapaParse();
810810

811811
const handleJsonToCSV = () => {
812-
const jsonData = `[
812+
const jsonData = [
813813
{
814814
"Column 1": "1-1",
815815
"Column 2": "1-2",
@@ -834,7 +834,7 @@ export default function JsonToCSV() {
834834
"Column 3": 6,
835835
"Column 4": 7
836836
}
837-
]`;
837+
];
838838
const results = jsonToCSV(jsonData);
839839
console.log('---------------------------');
840840
console.log('Results:', results);
@@ -886,7 +886,19 @@ readRemoteFile(url, {
886886

887887
## 📜 Changelog
888888

889-
Latest version 4.1.0 (2022-08-07):
889+
Latest version 4.3.0 (2023-10-10):
890+
891+
* Enable async callback function for CSVDownloader
892+
893+
Version 4.2.2 (2023-10-09):
894+
895+
* Fix type
896+
897+
Version 4.2.0 (2023-10-07):
898+
899+
* Upgrade dependencies
900+
901+
Version 4.1.0 (2022-08-07):
890902

891903
* Import readString, readRemoteFile and jsonToCSV as pure function
892904

@@ -911,7 +923,7 @@ Details changes for each release are documented in the [CHANGELOG.md](https://gi
911923

912924
## 🛣️ Roadmap
913925

914-
### 🆕 v4.1.x
926+
### 🆕 v4.4.x
915927

916928
* CSVReader multiple files drag and drop
917929

@@ -1205,6 +1217,15 @@ How to contribute:
12051217
</sub>
12061218
</a>
12071219
</td>
1220+
<td align="center">
1221+
<a href="https://github.com/s5s5">
1222+
<img src="https://avatars.githubusercontent.com/u/6137499?v=4" width="100" alt="Jake Haitsma" />
1223+
<br />
1224+
<sub>
1225+
<b>Jake Haitsma</b>
1226+
</sub>
1227+
</a>
1228+
</td>
12081229
</tr>
12091230
</table>
12101231

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-papaparse-docs",
3-
"version": "3.17.1",
3+
"version": "4.2.2",
44
"description": "react-papaparse docs.",
55
"main": "index.js",
66
"scripts": {
@@ -19,7 +19,7 @@
1919
"raw-loader": "^4.0.0",
2020
"react": "17.0.2",
2121
"react-dom": "17.0.2",
22-
"react-papaparse": "^4.0.0",
22+
"react-papaparse": "^4.2.2",
2323
"react-tabs": "^3.1.0"
2424
},
2525
"devDependencies": {

docs/pages/_app.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class CustomApp extends App {
149149
react-papaparse by{' '}
150150
<a href="https://github.com/bunlong">Bunlong</a>
151151
<br />
152-
&copy; 2018-2022
152+
&copy; 2018-2023
153153
</div>
154154

155155
<div className="grid-15 mobile-grid-50 links">
@@ -160,10 +160,20 @@ class CustomApp extends App {
160160

161161
<div className="grid-15 mobile-grid-50 links">
162162
<h5>Project</h5>
163+
<a href="https://github.com/Bunlong/next-qrcode" target="_blank">
164+
next-qrcode
165+
</a>
163166
<a href="https://github.com/Bunlong/next-share" target="_blank">
164167
next-share
165168
</a>
166169
</div>
170+
171+
<div className="grid-15 mobile-grid-50 links">
172+
<h5>Pattern</h5>
173+
<a href="https://reactpatterns.js.org" target="_blank">
174+
React Patterns
175+
</a>
176+
</div>
167177
</div>
168178
</div>
169179
</footer>

docs/src/components/screens/docs/Navbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Navbar = () => {
1919
</div>
2020
<div className="grid-20 hide-on-mobile text-center">
2121
<a href="/" className="text-logo">
22-
react-papaparse 3
22+
react-papaparse 4
2323
</a>
2424
</div>
2525
<div className="grid-40 mobile-grid-50 text-right">

docs/src/components/screens/indexes/Download.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Download = () => {
1717
<br />
1818
<b style={{ display: 'block', textAlign: 'center' }}>yarn</b>
1919
<pre>
20-
<code className="language-bash">$ yarn add react-papaparse</code>
20+
<code className="language-bash">$ yarn add react-papaparse --save</code>
2121
</pre>
2222
</div>
2323
<div className="clear" />

docs/src/components/screens/indexes/Unparse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function JsonToCSV() {
2323
const { jsonToCSV } = usePapaParse();
2424
2525
const handleJsonToCSV = () => {
26-
const jsonData = '[
26+
const jsonData = [
2727
{
2828
"Column 1": "1-1",
2929
"Column 2": "1-2",
@@ -48,7 +48,7 @@ export default function JsonToCSV() {
4848
"Column 3": 6,
4949
"Column 4": 7
5050
}
51-
]';
51+
];
5252
const results = jsonToCSV(jsonData);
5353
console.log('---------------------------');
5454
console.log('Results:', results);

examples/jsonToCSV.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function JsonToCSV() {
66
const { jsonToCSV } = usePapaParse();
77

88
const handleJsonToCSV = () => {
9-
const jsonData = `[
9+
const jsonData = [
1010
{
1111
"Column 1": "1-1",
1212
"Column 2": "1-2",
@@ -31,7 +31,7 @@ export default function JsonToCSV() {
3131
"Column 3": 6,
3232
"Column 4": 7
3333
}
34-
]`;
34+
];
3535
const results = jsonToCSV(jsonData);
3636
console.log('---------------------------');
3737
console.log('Results:', results);

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-papaparse",
3-
"version": "4.2.0",
3+
"version": "4.3.0",
44
"description": "The fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.",
55
"author": "Bunlong <bunlong.van@gmail.com>",
66
"license": "MIT",
@@ -108,7 +108,7 @@
108108
"dist"
109109
],
110110
"dependencies": {
111-
"@types/papaparse": "^5.3.7",
111+
"@types/papaparse": "^5.3.9",
112112
"papaparse": "^5.4.1"
113113
},
114114
"bundlesize": [
@@ -118,7 +118,7 @@
118118
},
119119
{
120120
"path": "./dist/*.ts",
121-
"maxSize": "1000 B"
121+
"maxSize": "1039 B"
122122
}
123123
]
124124
}

src/jsonToCSV.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import PapaParse, { UnparseConfig } from 'papaparse';
1+
import PapaParse, { UnparseObject, UnparseConfig } from 'papaparse';
22

3-
export function jsonToCSV(json: any, options: UnparseConfig = {}) {
3+
export function jsonToCSV<T>(
4+
json: T[] | UnparseObject<T>,
5+
options: UnparseConfig = {},
6+
) {
47
return PapaParse.unparse(json, options);
58
}

0 commit comments

Comments
 (0)