-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GTFS object #1
Conversation
helpers/csv.js
Outdated
return null; | ||
} | ||
|
||
if (string.includes('"') === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬
helpers/export.js
Outdated
const deepness = schema.deepnessByTableName[tableName]; | ||
let sampleItem; | ||
|
||
if (deepness === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not have a while loop in deepness instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO it is not worth having to think about the while do
or do while
choice.
helpers/import.js
Outdated
const rows = []; | ||
let rowsSlice; | ||
let position = 0; | ||
const length = 50000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name this batchLength
helpers/import.js
Outdated
|
||
if (sortedKeys.length !== arrayOfValues.length) { | ||
if (process.notices && process.notices.addWarning) { | ||
process.notices.addWarning(`Row not valid in table: ${JSON.stringify(item)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you intend to make this work in a public repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaning, it will work but not sure that should be public at all?
package.json
Outdated
"description": "A Node.js librairie for GTFS", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha tests.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm scripts already have the package context in them you can use mocha
here
.gitignore
Outdated
@@ -57,3 +57,5 @@ typings/ | |||
# dotenv environment variables file | |||
.env | |||
|
|||
package-lock.json | |||
.idea/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.idea/
This is basically the old code used by our internal UpdateStaticData, with only some small improvements:
lodash
, nomoment
, onlyasync
&fs-extra
(&acomb
)