Skip to content

Commit 0c36f00

Browse files
committed
🗑️ limpiar
1 parent b369d6e commit 0c36f00

File tree

14 files changed

+2888
-3092
lines changed

14 files changed

+2888
-3092
lines changed

package.json

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,30 @@
2222
"body-parser": "^1.13.3",
2323
"compression": "^1.5.2",
2424
"cors": "^2.8.5",
25-
"dotenv": "^6.1.0",
25+
"dotenv": "^10.0.0",
2626
"express": "^4.13.3",
27-
"express-graphql": "^0.6.12",
28-
"express-handlebars": "^4.0.4",
27+
"express-handlebars": "^5.3.4",
2928
"geojson": "^0.5.0",
30-
"googleapis": "^39.1.0",
31-
"graphql": "^0.13.2",
29+
"googleapis": "^87.0.0",
3230
"morgan": "^1.8.0",
3331
"mz": "^2.7.0",
34-
"node-fetch": "^2.6.1",
35-
"object-hash": "^1.3.0",
36-
"ramda": "^0.25.0",
37-
"resource-router-middleware": "^0.6.0",
38-
"xlsx": "^0.16.8"
32+
"node-fetch": "^3.0.0",
33+
"object-hash": "^2.2.0",
34+
"ramda": "^0.27.1",
35+
"resource-router-middleware": "^0.7.0",
36+
"xlsx": "^0.17.2"
3937
},
4038
"devDependencies": {
41-
"@babel/cli": "^7.1.2",
42-
"@babel/core": "^7.1.2",
43-
"@babel/node": "^7.0.0",
39+
"@babel/cli": "^7.15.7",
40+
"@babel/core": "^7.15.5",
41+
"@babel/node": "^7.15.4",
4442
"@babel/polyfill": "^7.0.0",
45-
"@babel/preset-env": "^7.1.0",
46-
"@babel/register": "^7.0.0",
47-
"ava": "1.0.0-beta.8",
43+
"@babel/preset-env": "^7.15.6",
44+
"@babel/register": "^7.15.3",
45+
"ava": "3.15.0",
4846
"cross-env": "^7.0.3",
49-
"nodemon": "1.18.7",
50-
"standard": "^12.0.1"
47+
"nodemon": "2.0.13",
48+
"standard": "^16.0.3"
5149
},
5250
"babel": {
5351
"presets": [

src/api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import copy from '../copy/en'
44
import GeoJSON from 'geojson'
55

66
export default ({ config, controller }) => {
7-
let api = Router()
7+
const api = Router()
88

99
api.get('/', (req, res) => {
1010
res.json({
@@ -40,7 +40,7 @@ export default ({ config, controller }) => {
4040
api.get('/geojson', (req, res) => {
4141
controller
4242
.retrieve('gvp', 'eventos', 'deeprows')
43-
.then(data => res.json(GeoJSON.parse(data, {Point: ['latitude', 'longitude']})))
43+
.then(data => res.json(GeoJSON.parse(data, { Point: ['latitude', 'longitude'] })))
4444
.catch(err =>
4545
res.status(err.status || 404)
4646
.send({ error: err.message })

src/blueprinters/deeprows.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default (data) => {
3131
if (labelPrefix in structure) {
3232
structure[labelPrefix].push(label)
3333
} else {
34-
structure[labelPrefix] = [ label ]
34+
structure[labelPrefix] = [label]
3535
}
3636
}
3737
})

src/copy/en.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export default {
55
onlyTab: 'You cannot query a tab directly. The URL needs to be in the format /:sheet/:tab/:resource.',
66
noSheet: sheet => `The sheet ${sheet} is not available in this server.`,
77
noResource: prts => `The resource '${prts[2]}' does not exists in the tab '${prts[1]}' in this sheet.`,
8-
noFragment: prts => `Fragment index does not exist`,
9-
modelLayer: prts => `Something went wrong at the model layer`
8+
noFragment: prts => 'Fragment index does not exist',
9+
modelLayer: prts => 'Something went wrong at the model layer'
1010
},
1111
success: {
1212
update: 'All sheets updated'

src/index.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import http from 'http'
22
import path from 'path'
33
import express from 'express'
44
import initialize from './initialize'
5-
import middleware from './middleware'
65
import api from './api'
76
import dotenv from 'dotenv'
87

98
dotenv.config()
109

1110
const hbs = require('express-handlebars')
1211

13-
let app = express()
12+
const app = express()
1413
app.server = http.createServer(app)
1514
app.engine('.hbs', hbs({
1615
extname: '.hbs',
@@ -28,12 +27,6 @@ if (process.env.NODE_ENV === 'development') {
2827
const config = process.env
2928

3029
initialize(controller => {
31-
app.use(
32-
middleware({
33-
config,
34-
controller
35-
})
36-
)
3730
app.use(
3831
'/api',
3932
api({

src/lib.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import BP from './lib/blueprinters'
22

3-
function blueprintExists(format) {
4-
return typeof format === 'string' && format in BP;
3+
function blueprintExists (format) {
4+
return typeof format === 'string' && format in BP
55
}
66

7-
function prefixedTabs(prefix, cfg, sheets) {
8-
if (!sheets) return;
9-
if (!cfg) cfg = {};
7+
function prefixedTabs (prefix, cfg, sheets) {
8+
if (!sheets) return
9+
if (!cfg) cfg = {}
1010

11-
const ret = {};
11+
const ret = {}
1212

1313
sheets.forEach((sheet) => {
14-
const format = sheet.format;
15-
let cb;
14+
const format = sheet.format
15+
let cb
1616

1717
if (Array.isArray(format)) {
18-
cb = format.filter((f) => blueprintExists(f)).map((f) => BP[f]);
18+
cb = format.filter((f) => blueprintExists(f)).map((f) => BP[f])
1919
} else if (blueprintExists(format)) {
20-
cb = BP[format];
20+
cb = BP[format]
2121
}
2222

23-
ret[sheet.name] = cb;
24-
});
23+
ret[sheet.name] = cb
24+
})
2525

26-
return ret;
26+
return ret
2727

2828
// return {
2929
// [`${prf('eventos')}eventos`]: BP.rows,

src/lib/Fetcher.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Fetcher {
5353
const allParts = allUrls.reduce((acc, url) => {
5454
if (url.startsWith(this.id)) {
5555
const parts = url.split('/')
56-
let duplicateTab = acc.reduce((tabFound, p) => {
56+
const duplicateTab = acc.reduce((tabFound, p) => {
5757
return tabFound || p[0] === parts[1]
5858
}, false)
5959
if (duplicateTab) {
@@ -63,7 +63,7 @@ class Fetcher {
6363
}
6464
})
6565
} else {
66-
acc.push([ parts[1], [ parts[2] ] ])
66+
acc.push([parts[1], [parts[2]]])
6767
}
6868
}
6969
return acc
@@ -246,8 +246,8 @@ class LocalFetcher extends Fetcher {
246246
}
247247

248248
export default {
249-
'gsheets': GsheetFetcher,
250-
'xlsx': LocalFetcher,
251-
'ods': LocalFetcher,
252-
'local': LocalFetcher
249+
gsheets: GsheetFetcher,
250+
xlsx: LocalFetcher,
251+
ods: LocalFetcher,
252+
local: LocalFetcher
253253
}

src/lib/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const fmtObj = R.curry(
4646

4747
/* search for object with key in array. Return index if exists, or -1 if not */
4848
export const idxSearcher = R.curry((attrName, searchValue, myArray) => {
49-
for (var i = 0; i < myArray.length; i++) {
49+
for (let i = 0; i < myArray.length; i++) {
5050
if (myArray[i][attrName] === searchValue) {
5151
return i
5252
}

src/middleware/index.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/middleware/mapbox/index.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)