added test cases and author name

This commit is contained in:
rainshen49
2017-06-06 12:08:34 -04:00
parent 4106095ad7
commit a282f4bc9a
2 changed files with 10 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
// Type definitions for PapaParse v4.1
// Project: https://github.com/mholt/PapaParse
// Definitions by: Pedro Flemming <https://github.com/torpedro>
// Definitions by: Pedro Flemming <https://github.com/torpedro>, Rain Shen <https://github.com/rainshen49>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace PapaParse {

View File

@@ -13,7 +13,7 @@ Papa.parse("3,3,3", {
delimiter: ';',
comments: false,
step: function(results, p) {
step: function (results, p) {
p.abort();
results.data.length;
}
@@ -22,7 +22,7 @@ Papa.parse("3,3,3", {
var file = new File(null, null, null);
Papa.parse(file, {
complete: function(a, b) {
complete: function (a, b) {
a.meta.fields;
b.name;
}
@@ -31,13 +31,19 @@ Papa.parse(file, {
/**
* Unparsing
*/
Papa.unparse([{a: 1, b: 1, c: 1}]);
Papa.unparse([{ a: 1, b: 1, c: 1 }]);
Papa.unparse([[1, 2, 3], [4, 5, 6]]);
Papa.unparse({
fields: ["3"],
data: []
});
Papa.unparse([{ a: 1, b: 1, c: 1 }], { quotes: false });
Papa.unparse([[1, 2, 3], [4, 5, 6]], { delimiter: "," });
Papa.unparse({
fields: ["3"],
data: []
}, { newline: "\n" });
/**