Moved web root into root of project; this makes deployment easier.

Also deleted 'docs', which is now redundant.
This commit is contained in:
Simon Brooke 2020-02-27 14:18:29 +00:00
parent a5204c66b9
commit 743d8a1740
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
1592 changed files with 53626 additions and 139250 deletions

279
vendor/node_modules/papaparse/.eslintrc.js generated vendored Normal file
View file

@ -0,0 +1,279 @@
module.exports = {
"parserOptions": {
"ecmaVersion": 5
},
"env": {
"browser": true,
"worker": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": ["error", "consistent"],
"array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": "error",
"array-element-newline": "off",
"arrow-body-style": "error",
"arrow-parens": "error",
"arrow-spacing": "error",
"block-scoped-var": "error",
"block-spacing": "error",
"brace-style": "off",
"callback-return": "error",
"camelcase": ["error", {"properties": "never"}],
"capitalized-comments": "off",
"class-methods-use-this": "error",
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"error",
"never"
],
"consistent-return": "off",
"consistent-this": "off",
"curly": "off",
"default-case": "error",
"dot-location": "error",
"dot-notation": "error",
"eol-last": "error",
"eqeqeq": "error",
"for-direction": "error",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": [
"error",
"never"
],
"func-style": "off",
"function-paren-newline": "off",
"generator-star-spacing": "error",
"getter-return": "error",
"global-require": "off",
"guard-for-in": "off",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": "error",
"indent": [
"error",
"tab"
],
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": "off",
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": "error",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": "off",
"multiline-ternary": [
"error",
"always-multiline"
],
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "error",
"no-bitwise": "error",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "off",
"no-cond-assign": [
"error",
"except-parens"
],
"no-confusing-arrow": "error",
"no-console": "off",
"no-continue": "off",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty": ["error", {"allowEmptyCatch": true}],
"no-empty-function": "off",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": [
"error",
"functions"
],
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "error",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": "off",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "off",
"no-plusplus": "off",
"no-process-env": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-prototype-builtins": "error",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-spaced-func": "error",
"no-sync": ["error", {"allowAtRootLevel": true}],
"no-tabs": "off",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "off",
"no-unneeded-ternary": "error",
"no-unused-expressions": "off",
"no-unused-vars": ["error", {"args": "none"}],
"no-use-before-define": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "off",
"no-var": "off",
"no-void": "error",
"no-warning-comments": "error",
"no-whitespace-before-property": "error",
"no-with": "error",
"nonblock-statement-body-position": [
"error",
"any"
],
"object-curly-newline": ["error", {"consistent": true}],
"object-curly-spacing": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "off",
"operator-assignment": [
"error",
"always"
],
"operator-linebreak": "off",
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "error",
"prefer-destructuring": "off",
"prefer-numeric-literals": "error",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "error",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": [
"error",
"as-needed"
],
"require-await": "error",
"require-jsdoc": "off",
"rest-spread-spacing": "error",
"semi": "error",
"semi-spacing": "error",
"semi-style": [
"error",
"last"
],
"sort-imports": "error",
"sort-keys": "off",
"sort-vars": "off",
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
"never"
],
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "error",
"space-unary-ops": [
"error",
{
"nonwords": false,
"words": false
}
],
"spaced-comment": "off",
"strict": "off",
"switch-colon-spacing": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "off",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": "off"
}
};

6
vendor/node_modules/papaparse/.travis.yml generated vendored Normal file
View file

@ -0,0 +1,6 @@
language: node_js
node_js:
- "8"
- "9"
- "10"
- "11"

27
vendor/node_modules/papaparse/Gruntfile.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
options: {
compress: {
global_defs: {
'PAPA_BROWSER_CONTEXT': true
},
dead_code: true
},
output: {
comments: 'some',
},
},
min: {
files: {
'papaparse.min.js': ['papaparse.js']
},
},
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('build', ['uglify']);
grunt.registerTask('default', ['uglify']);
};

20
vendor/node_modules/papaparse/LICENSE generated vendored Normal file
View file

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2015 Matthew Holt
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

67
vendor/node_modules/papaparse/README.md generated vendored Normal file
View file

@ -0,0 +1,67 @@
Parse CSV with JavaScript
========================================
Papa Parse is the [fastest](http://jsperf.com/javascript-csv-parsers/4) in-browser CSV (or delimited text) parser for JavaScript. It is reliable and correct according to [RFC 4180](https://tools.ietf.org/html/rfc4180), and it comes with these features:
- Easy to use
- Parse CSV files directly (local or over the network)
- Fast mode ([is really fast](http://jsperf.com/javascript-csv-parsers/3))
- Stream large files (even via HTTP)
- Reverse parsing (converts JSON to CSV)
- Auto-detect delimiter
- Worker threads to keep your web page reactive
- Header row support
- Pause, resume, abort
- Can convert numbers and booleans to their types
- Optional jQuery integration to get files from `<input type="file">` elements
- One of the only parsers that correctly handles line-breaks and quotations
Papa Parse has **no dependencies** - not even jQuery.
Install
-------
papaparse is available on [npm](https://www.npmjs.com/package/papaparse). It
can be installed with the following command:
npm install papaparse
If you don't want to use npm, [papaparse.min.js](https://unpkg.com/papaparse@latest/papaparse.min.js) can be downloaded to your project source.
Homepage & Demo
----------------
- [Homepage](http://papaparse.com)
- [Demo](http://papaparse.com/demo)
To learn how to use Papa Parse:
- [Documentation](http://papaparse.com/docs)
The website is hosted on [Github Pages](https://pages.github.com/). Its content is also included in the docs folder of this repository. If you want to contribute on it just clone the master of this repository and open a pull request.
Papa Parse for Node
--------------------
Papa Parse can parse a [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams) instead of a [File](https://www.w3.org/TR/FileAPI/) when used in Node.js environments (in addition to plain strings). In this mode, `encoding` must, if specified, be a Node-supported character encoding. The `Papa.LocalChunkSize`, `Papa.RemoteChunkSize` , `download`, `withCredentials` and `worker` config options are unavailable.
Papa Parse can also parse in a node streaming style which makes `.pipe` available. Simply pipe the [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams) to the stream returned from `Papa.parse(Papa.NODE_STREAM_INPUT, options)`. The `Papa.LocalChunkSize`, `Papa.RemoteChunkSize` , `download`, `withCredentials`, `worker`, `step`, and `complete` config options are unavailable. To register a callback with the stream to process data, use the `data` event like so: `stream.on('data', callback)` and to signal the end of stream, use the 'end' event like so: `stream.on('end', callback)`.
Get Started
-----------
For usage instructions, see the [homepage](http://papaparse.com) and, for more detail, the [documentation](http://papaparse.com/docs).
Tests
-----
Papa Parse is under test. Download this repository, run `npm install`, then `npm test` to run the tests.
Contributing
------------
To discuss a new feature or ask a question, open an issue. To fix a bug, submit a pull request to be credited with the [contributors](https://github.com/mholt/PapaParse/graphs/contributors)! Remember, a pull request, *with test*, is best. You may also discuss on Twitter with [#PapaParse](https://twitter.com/search?q=%23PapaParse&src=typd&f=realtime) or directly to me, [@mholt6](https://twitter.com/mholt6).
If you contribute a patch, ensure the tests suite is running correctly. We run continuous integration on each pull request and will not accept a patch that breaks the tests.

40
vendor/node_modules/papaparse/bower.json generated vendored Normal file
View file

@ -0,0 +1,40 @@
{
"name": "papaparse",
"main": "papaparse.js",
"homepage": "http://papaparse.com",
"authors": [
"Matthew Holt"
],
"description": "Fast and powerful CSV parser for the browser. Converts CSV->JSON and JSON->CSV. Supports web workers and streaming large files.",
"keywords": [
"csv",
"parse",
"parsing",
"parser",
"delimited",
"text",
"data",
"auto-detect",
"comma",
"tab",
"pipe",
"file",
"filereader",
"stream",
"worker",
"workers",
"ajax",
"thread",
"threading",
"multi-threaded"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"player"
]
}

85
vendor/node_modules/papaparse/package.json generated vendored Normal file
View file

@ -0,0 +1,85 @@
{
"_from": "papaparse@5.1.0",
"_id": "papaparse@5.1.0",
"_inBundle": false,
"_integrity": "sha512-3jEYMiCc8qN7V5ffi2BTS2mRauKxCu5AIED6DxbjnHhIm7OY7fzKYkndfPlHWaaKUDCTml5XTU6V+hiuxGlZuw==",
"_location": "/papaparse",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "papaparse@5.1.0",
"name": "papaparse",
"escapedName": "papaparse",
"rawSpec": "5.1.0",
"saveSpec": null,
"fetchSpec": "5.1.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.1.0.tgz",
"_shasum": "6228e8d96de99630ad017cf6522042319facc5eb",
"_spec": "papaparse@5.1.0",
"_where": "/home/simon/workspace/geocsv-lite/resources/public/vendor",
"author": {
"name": "Matthew Holt",
"url": "https://twitter.com/mholt6"
},
"browser": "papaparse.min.js",
"bugs": {
"url": "https://github.com/mholt/PapaParse/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Fast and powerful CSV parser for the browser that supports web workers and streaming large files. Converts CSV to JSON and JSON to CSV.",
"devDependencies": {
"chai": "^4.2.0",
"connect": "^3.3.3",
"eslint": "^4.19.1",
"grunt": "^1.0.2",
"grunt-contrib-uglify": "^3.3.0",
"mocha": "^5.2.0",
"mocha-headless-chrome": "^2.0.1",
"open": "0.0.5",
"serve-static": "^1.7.1"
},
"homepage": "http://papaparse.com",
"keywords": [
"csv",
"parser",
"parse",
"parsing",
"delimited",
"text",
"data",
"auto-detect",
"comma",
"tab",
"pipe",
"file",
"filereader",
"stream",
"worker",
"workers",
"thread",
"threading",
"multi-threaded",
"jquery-plugin"
],
"license": "MIT",
"main": "papaparse.js",
"name": "papaparse",
"repository": {
"type": "git",
"url": "git+https://github.com/mholt/PapaParse.git"
},
"scripts": {
"lint": "eslint --no-ignore papaparse.js Gruntfile.js .eslintrc.js 'tests/**/*.js'",
"test": "npm run lint && npm run test-node && npm run test-mocha-headless-chrome",
"test-browser": "node tests/test.js",
"test-mocha-headless-chrome": "node tests/test.js --mocha-headless-chrome",
"test-node": "mocha tests/node-tests.js tests/test-cases.js"
},
"version": "5.1.0"
}

1904
vendor/node_modules/papaparse/papaparse.js generated vendored Executable file

File diff suppressed because it is too large Load diff

7
vendor/node_modules/papaparse/papaparse.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1045
vendor/node_modules/papaparse/player/player.css generated vendored Normal file

File diff suppressed because it is too large Load diff

78
vendor/node_modules/papaparse/player/player.html generated vendored Normal file
View file

@ -0,0 +1,78 @@
<!DOCTYPE html>
<html>
<head>
<title>Papa Parse Player</title>
<meta charset="utf-8">
<link rel="stylesheet" href="player.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="../papaparse.js"></script>
<script src="player.js"></script>
</head>
<body>
<h1><a href="http://papaparse.com">Papa Parse</a> Player</h1>
<div class="grid-container">
<div class="grid-25">
<label><input type="checkbox" id="download"> Download</label>
<label><input type="checkbox" id="stream"> Stream</label>
<label><input type="checkbox" id="chunk"> Chunk</label>
<label><input type="checkbox" id="worker"> Worker thread</label>
<label><input type="checkbox" id="header"> Header row</label>
<label><input type="checkbox" id="dynamicTyping"> Dynamic typing</label>
<label><input type="checkbox" id="fastmode"> Fast mode</label>
<label><input type="checkbox" id="skipEmptyLines"> Skip empty lines</label>
<label><input type="checkbox" id="step-pause"> Pause on step</label>
<label><input type="checkbox" id="print-steps"> Log each step/chunk</label>
<label>Delimiter: <input type="text" size="5" placeholder="auto" id="delimiter"> <a href="javascript:" id="insert-tab">tab</a></label>
Line Endings:
<label style="display: inline;"><input type="radio" name="newline" id="newline-auto" checked>Auto</label>
<label style="display: inline;"><input type="radio" name="newline" id="newline-n">\n</label>
<label style="display: inline;"><input type="radio" name="newline" id="newline-r">\r</label>
<label style="display: inline;"><input type="radio" name="newline" id="newline-rn">\r\n</label>
<label>Preview: <input type="number" min="0" max="1000" placeholder="default" id="preview"></label>
<label>Encoding: <input type="text" id="encoding" placeholder="default" size="10"></label>
<label>Comment char: <input type="text" size="5" maxlength="1" placeholder="default" id="comments"></label>
<label>Papa.LocalChunkSize: <input type="number" min="0" placeholder="default" id="localChunkSize"></label>
<label>Papa.RemoteChunkSize: <input type="number" min="0" placeholder="default" id="remoteChunkSize"></label>
</div>
<div class="grid-75 text-center">
<textarea id="input" placeholder="Input">Column 1,Column 2,Column 3,Column 4
1-1,1-2,1-3,1-4
2-1,2-2,2-3,2-4
3-1,3-2,3-3,3-4
40,41,42,43
"Quoted field",No quotes,"Foo","bar",extra
"Field quoted with
line break"</textarea>
<br>
<b>or</b>
<br>
<input type="file" id="files" multiple>
<br><br>
<button id="submit-parse">Parse</button>
&nbsp;
<button id="submit-unparse">Unparse</button>
<br><br>
<i>Open the Console in your browser's inspector tools to see results.</i>
</div>
</div>
</body>
</html>

180
vendor/node_modules/papaparse/player/player.js generated vendored Normal file
View file

@ -0,0 +1,180 @@
var stepped = 0, chunks = 0, rows = 0;
var start, end;
var parser;
var pauseChecked = false;
var printStepChecked = false;
$(function()
{
$('#submit-parse').click(function()
{
stepped = 0;
chunks = 0;
rows = 0;
var txt = $('#input').val();
var localChunkSize = $('#localChunkSize').val();
var remoteChunkSize = $('#remoteChunkSize').val();
var files = $('#files')[0].files;
var config = buildConfig();
// NOTE: Chunk size does not get reset if changed and then set back to empty/default value
if (localChunkSize)
Papa.LocalChunkSize = localChunkSize;
if (remoteChunkSize)
Papa.RemoteChunkSize = remoteChunkSize;
pauseChecked = $('#step-pause').prop('checked');
printStepChecked = $('#print-steps').prop('checked');
if (files.length > 0)
{
if (!$('#stream').prop('checked') && !$('#chunk').prop('checked'))
{
for (var i = 0; i < files.length; i++)
{
if (files[i].size > 1024 * 1024 * 10)
{
alert("A file you've selected is larger than 10 MB; please choose to stream or chunk the input to prevent the browser from crashing.");
return;
}
}
}
start = performance.now();
$('#files').parse({
config: config,
before: function(file, inputElem)
{
console.log("Parsing file:", file);
},
complete: function()
{
console.log("Done with all files.");
}
});
}
else
{
start = performance.now();
var results = Papa.parse(txt, config);
console.log("Synchronous parse results:", results);
}
});
$('#submit-unparse').click(function()
{
var input = $('#input').val();
var delim = $('#delimiter').val();
var header = $('#header').prop('checked');
var results = Papa.unparse(input, {
delimiter: delim,
header: header,
});
console.log("Unparse complete!");
console.log("--------------------------------------");
console.log(results);
console.log("--------------------------------------");
});
$('#insert-tab').click(function()
{
$('#delimiter').val('\t');
});
});
function buildConfig()
{
return {
delimiter: $('#delimiter').val(),
newline: getLineEnding(),
header: $('#header').prop('checked'),
dynamicTyping: $('#dynamicTyping').prop('checked'),
preview: parseInt($('#preview').val() || 0),
step: $('#stream').prop('checked') ? stepFn : undefined,
encoding: $('#encoding').val(),
worker: $('#worker').prop('checked'),
comments: $('#comments').val(),
complete: completeFn,
error: errorFn,
download: $('#download').prop('checked'),
fastMode: $('#fastmode').prop('checked'),
skipEmptyLines: $('#skipEmptyLines').prop('checked'),
chunk: $('#chunk').prop('checked') ? chunkFn : undefined,
beforeFirstChunk: undefined,
};
function getLineEnding()
{
if ($('#newline-n').is(':checked'))
return "\n";
else if ($('#newline-r').is(':checked'))
return "\r";
else if ($('#newline-rn').is(':checked'))
return "\r\n";
else
return "";
}
}
function stepFn(results, parserHandle)
{
stepped++;
rows += results.data.length;
parser = parserHandle;
if (pauseChecked)
{
console.log(results, results.data[0]);
parserHandle.pause();
return;
}
if (printStepChecked)
console.log(results, results.data[0]);
}
function chunkFn(results, streamer, file)
{
if (!results)
return;
chunks++;
rows += results.data.length;
parser = streamer;
if (printStepChecked)
console.log("Chunk data:", results.data.length, results);
if (pauseChecked)
{
console.log("Pausing; " + results.data.length + " rows in chunk; file:", file);
streamer.pause();
return;
}
}
function errorFn(error, file)
{
console.log("ERROR:", error, file);
}
function completeFn()
{
end = performance.now();
if (!$('#stream').prop('checked')
&& !$('#chunk').prop('checked')
&& arguments[0]
&& arguments[0].data)
rows = arguments[0].data.length;
console.log("Finished input (async). Time:", end-start, arguments);
console.log("Rows:", rows, "Stepped:", stepped, "Chunks:", chunks);
}

9
vendor/node_modules/papaparse/tests/.eslintrc.js generated vendored Normal file
View file

@ -0,0 +1,9 @@
module.exports = {
"extends": ["../.eslintrc.js"],
"env": {
"mocha": true
},
"rules": {
}
};

8
vendor/node_modules/papaparse/tests/long-sample.csv generated vendored Normal file
View file

@ -0,0 +1,8 @@
Grant,Dyer,Donec.elementum@orciluctuset.example,2013-11-23T02:30:31-08:00,2014-05-31T01:06:56-07:00,Magna Ut Associates,ljenkins
Cherokee,Shields,Nulla.Semper.Tellus@duinec.example,2014-11-22T16:43:51-08:00,2013-09-26T11:47:15-07:00,Pede Corporation,Donec.elementum@orciluctuset.example
Catherine,Parrish,lorem@feugiatnon.example,2015-02-11T12:01:10-08:00,2015-02-26T00:29:40-08:00,Phasellus Fermentum Convallis PC,Donec.elementum@orciluctuset.example
Destiny,Shannon,libero@Aenean.example,2015-07-14T09:38:11-07:00,2014-01-11T14:53:04-08:00,Pretium Et Inc.,Donec.elementum@orciluctuset.example
Callum,Underwood,Phasellus@Quisquetincidunt.example,2013-09-13T18:49:35-07:00,2014-12-04T23:04:19-08:00,Sed Turpis Nec LLP,ljenkins
Elliott,Wright,cursus@nibh.example,2015-04-20T14:35:19-07:00,2015-03-05T12:56:46-08:00,Dolor Associate,Phasellus@Quisquetincidunt.example
Galvin,Foley,nisi.Aenean.eget@atauctorullamcorper.example,2014-03-20T23:20:15-07:00,2014-06-11T15:00:23-07:00,Adipiscing Industrie,Phasellus@Quisquetincidunt.example
Talon,Salinas,posuere.vulputate.lacus@Donecsollicitudin.example,2015-01-31T09:19:02-08:00,2014-12-17T04:59:18-08:00,Aliquam Iaculis Incorporate,Phasellus@Quisquetincidunt.example
1 Grant Dyer Donec.elementum@orciluctuset.example 2013-11-23T02:30:31-08:00 2014-05-31T01:06:56-07:00 Magna Ut Associates ljenkins
2 Cherokee Shields Nulla.Semper.Tellus@duinec.example 2014-11-22T16:43:51-08:00 2013-09-26T11:47:15-07:00 Pede Corporation Donec.elementum@orciluctuset.example
3 Catherine Parrish lorem@feugiatnon.example 2015-02-11T12:01:10-08:00 2015-02-26T00:29:40-08:00 Phasellus Fermentum Convallis PC Donec.elementum@orciluctuset.example
4 Destiny Shannon libero@Aenean.example 2015-07-14T09:38:11-07:00 2014-01-11T14:53:04-08:00 Pretium Et Inc. Donec.elementum@orciluctuset.example
5 Callum Underwood Phasellus@Quisquetincidunt.example 2013-09-13T18:49:35-07:00 2014-12-04T23:04:19-08:00 Sed Turpis Nec LLP ljenkins
6 Elliott Wright cursus@nibh.example 2015-04-20T14:35:19-07:00 2015-03-05T12:56:46-08:00 Dolor Associate Phasellus@Quisquetincidunt.example
7 Galvin Foley nisi.Aenean.eget@atauctorullamcorper.example 2014-03-20T23:20:15-07:00 2014-06-11T15:00:23-07:00 Adipiscing Industrie Phasellus@Quisquetincidunt.example
8 Talon Salinas posuere.vulputate.lacus@Donecsollicitudin.example 2015-01-31T09:19:02-08:00 2014-12-17T04:59:18-08:00 Aliquam Iaculis Incorporate Phasellus@Quisquetincidunt.example

290
vendor/node_modules/papaparse/tests/node-tests.js generated vendored Normal file
View file

@ -0,0 +1,290 @@
"use strict";
var Papa = require("../papaparse.js");
var fs = require('fs');
var assert = require('assert');
var longSampleRawCsv = fs.readFileSync(__dirname + '/long-sample.csv', 'utf8');
function assertLongSampleParsedCorrectly(parsedCsv) {
assert.equal(8, parsedCsv.data.length);
assert.deepEqual(parsedCsv.data[0], [
'Grant',
'Dyer',
'Donec.elementum@orciluctuset.example',
'2013-11-23T02:30:31-08:00',
'2014-05-31T01:06:56-07:00',
'Magna Ut Associates',
'ljenkins'
]);
assert.deepEqual(parsedCsv.data[7], [
'Talon',
'Salinas',
'posuere.vulputate.lacus@Donecsollicitudin.example',
'2015-01-31T09:19:02-08:00',
'2014-12-17T04:59:18-08:00',
'Aliquam Iaculis Incorporate',
'Phasellus@Quisquetincidunt.example'
]);
assert.deepEqual(parsedCsv.meta, {
"delimiter": ",",
"linebreak": "\n",
"aborted": false,
"truncated": false,
"cursor": 1209
});
assert.equal(parsedCsv.errors.length, 0);
}
describe('PapaParse', function() {
it('synchronously parsed CSV should be correctly parsed', function() {
assertLongSampleParsedCorrectly(Papa.parse(longSampleRawCsv));
});
it('Pause and resume works (Regression Test for Bug #636)', function(done) {
this.timeout(30000);
var mod200Rows = [
["Etiam a dolor vitae est vestibulum","84","DEF"],
["Etiam a dolor vitae est vestibulum","84","DEF"],
["Lorem ipsum dolor sit","42","ABC"],
["Etiam a dolor vitae est vestibulum","84","DEF"],
["Etiam a dolor vitae est vestibulum","84"],
["Lorem ipsum dolor sit","42","ABC"],
["Etiam a dolor vitae est vestibulum","84","DEF"],
["Etiam a dolor vitae est vestibulum","84","DEF"],
["Lorem ipsum dolor sit","42","ABC"],
["Lorem ipsum dolor sit","42"]
];
var stepped = 0;
var dataRows = [];
Papa.parse(fs.createReadStream(__dirname + '/verylong-sample.csv'), {
step: function(results, parser) {
stepped++;
if (results)
{
parser.pause();
parser.resume();
if (results.data && stepped % 200 === 0) {
dataRows.push(results.data);
}
}
},
complete: function() {
assert.strictEqual(2001, stepped);
assert.deepEqual(mod200Rows, dataRows);
done();
}
});
});
it('asynchronously parsed CSV should be correctly parsed', function(done) {
Papa.parse(longSampleRawCsv, {
complete: function(parsedCsv) {
assertLongSampleParsedCorrectly(parsedCsv);
done();
},
});
});
it('asynchronously parsed streaming CSV should be correctly parsed', function(done) {
Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), {
complete: function(parsedCsv) {
assertLongSampleParsedCorrectly(parsedCsv);
done();
},
});
});
it('reports the correct row number on FieldMismatch errors', function(done) {
Papa.parse(fs.createReadStream(__dirname + '/verylong-sample.csv'), {
header: true,
fastMode: true,
complete: function(parsedCsv) {
assert.deepEqual(parsedCsv.errors, [
{
"type": "FieldMismatch",
"code": "TooFewFields",
"message": "Too few fields: expected 3 fields but parsed 2",
"row": 498
},
{
"type": "FieldMismatch",
"code": "TooFewFields",
"message": "Too few fields: expected 3 fields but parsed 2",
"row": 998
},
{
"type": "FieldMismatch",
"code": "TooFewFields",
"message": "Too few fields: expected 3 fields but parsed 2",
"row": 1498
},
{
"type": "FieldMismatch",
"code": "TooFewFields",
"message": "Too few fields: expected 3 fields but parsed 2",
"row": 1998
}
]);
assert.strictEqual(2000, parsedCsv.data.length);
done();
},
});
});
it('piped streaming CSV should be correctly parsed', function(done) {
var data = [];
var readStream = fs.createReadStream(__dirname + '/long-sample.csv', 'utf8');
var csvStream = readStream.pipe(Papa.parse(Papa.NODE_STREAM_INPUT));
csvStream.on('data', function(item) {
data.push(item);
});
csvStream.on('end', function() {
assert.deepEqual(data[0], [
'Grant',
'Dyer',
'Donec.elementum@orciluctuset.example',
'2013-11-23T02:30:31-08:00',
'2014-05-31T01:06:56-07:00',
'Magna Ut Associates',
'ljenkins'
]);
assert.deepEqual(data[7], [
'Talon',
'Salinas',
'posuere.vulputate.lacus@Donecsollicitudin.example',
'2015-01-31T09:19:02-08:00',
'2014-12-17T04:59:18-08:00',
'Aliquam Iaculis Incorporate',
'Phasellus@Quisquetincidunt.example'
]);
done();
});
});
it('piped streaming CSV should be correctly parsed when header is true', function(done) {
var data = [];
var readStream = fs.createReadStream(__dirname + '/sample-header.csv', 'utf8');
var csvStream = readStream.pipe(Papa.parse(Papa.NODE_STREAM_INPUT, {header: true}));
csvStream.on('data', function(item) {
data.push(item);
});
csvStream.on('end', function() {
assert.deepEqual(data[0], { title: 'test title 01', name: 'test name 01' });
assert.deepEqual(data[1], { title: '', name: 'test name 02' });
done();
});
});
it('should support pausing and resuming on same tick when streaming', function(done) {
var rows = [];
Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), {
chunk: function(results, parser) {
rows = rows.concat(results.data);
parser.pause();
parser.resume();
},
error: function(err) {
done(new Error(err));
},
complete: function() {
assert.deepEqual(rows[0], [
'Grant',
'Dyer',
'Donec.elementum@orciluctuset.example',
'2013-11-23T02:30:31-08:00',
'2014-05-31T01:06:56-07:00',
'Magna Ut Associates',
'ljenkins'
]);
assert.deepEqual(rows[7], [
'Talon',
'Salinas',
'posuere.vulputate.lacus@Donecsollicitudin.example',
'2015-01-31T09:19:02-08:00',
'2014-12-17T04:59:18-08:00',
'Aliquam Iaculis Incorporate',
'Phasellus@Quisquetincidunt.example'
]);
done();
}
});
});
it('should support pausing and resuming asynchronously when streaming', function(done) {
var rows = [];
Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), {
chunk: function(results, parser) {
rows = rows.concat(results.data);
parser.pause();
setTimeout(function() {
parser.resume();
}, 200);
},
error: function(err) {
done(new Error(err));
},
complete: function() {
assert.deepEqual(rows[0], [
'Grant',
'Dyer',
'Donec.elementum@orciluctuset.example',
'2013-11-23T02:30:31-08:00',
'2014-05-31T01:06:56-07:00',
'Magna Ut Associates',
'ljenkins'
]);
assert.deepEqual(rows[7], [
'Talon',
'Salinas',
'posuere.vulputate.lacus@Donecsollicitudin.example',
'2015-01-31T09:19:02-08:00',
'2014-12-17T04:59:18-08:00',
'Aliquam Iaculis Incorporate',
'Phasellus@Quisquetincidunt.example'
]);
done();
}
});
});
it('handles errors in beforeFirstChunk', function(done) {
var expectedError = new Error('test');
Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), {
beforeFirstChunk: function() {
throw expectedError;
},
error: function(err) {
assert.deepEqual(err, expectedError);
done();
}
});
});
it('handles errors in chunk', function(done) {
var expectedError = new Error('test');
Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), {
chunk: function() {
throw expectedError;
},
error: function(err) {
assert.deepEqual(err, expectedError);
done();
}
});
});
it('handles errors in step', function(done) {
var expectedError = new Error('test');
Papa.parse(fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'), {
step: function() {
throw expectedError;
},
error: function(err) {
assert.deepEqual(err, expectedError);
done();
}
});
});
});

View file

@ -0,0 +1,3 @@
title,name
test title 01,test name 01
,test name 02
1 title name
2 test title 01 test name 01
3 test name 02

2
vendor/node_modules/papaparse/tests/sample.csv generated vendored Normal file
View file

@ -0,0 +1,2 @@
A,B,C
X,Y,Z
1 A B C
2 X Y Z

2380
vendor/node_modules/papaparse/tests/test-cases.js generated vendored Normal file

File diff suppressed because it is too large Load diff

20
vendor/node_modules/papaparse/tests/test.js generated vendored Normal file
View file

@ -0,0 +1,20 @@
var connect = require('connect');
var serveStatic = require('serve-static');
var open = require('open');
var path = require('path');
var childProcess = require('child_process');
var server = connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() {
if (process.argv.indexOf('--mocha-headless-chrome') !== -1) {
childProcess.spawn('node_modules/.bin/mocha-headless-chrome', ['-f', 'http://localhost:8071/tests/tests.html'], {
stdio: 'inherit'
}).on('exit', function(code) {
server.close();
process.exit(code); // eslint-disable-line no-process-exit
});
} else {
open('http://localhost:8071/tests/tests.html');
console.log('Serving tests...');
}
});

22
vendor/node_modules/papaparse/tests/tests.html generated vendored Normal file
View file

@ -0,0 +1,22 @@
<html>
<head>
<title>Papa Parse Tests</title>
<meta charset="utf-8">
<script src="../node_modules/mocha/mocha.js"></script>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<script src="../papaparse.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script>mocha.setup('bdd')</script>
<script src="test-cases.js" id="test-cases"></script>
</head>
<body>
<div id="mocha"></div>
<script>
mocha.checkLeaks();
mocha.run();
</script>
</body>
</html>

2001
vendor/node_modules/papaparse/tests/verylong-sample.csv generated vendored Normal file

File diff suppressed because it is too large Load diff