Merge fix and linting
This commit is contained in:
parent
998afad950
commit
fe374c0439
|
@ -1,14 +0,0 @@
|
|||
// eslint-disable-next-line no-undef
|
||||
const breweries = data
|
||||
const totals = {}
|
||||
|
||||
for (let brewery of breweries) {
|
||||
const state = brewery.state
|
||||
if (totals[state] == null) {
|
||||
totals[state] = 1
|
||||
} else {
|
||||
totals[state]++
|
||||
}
|
||||
}
|
||||
const entries = Object.entries(totals)
|
||||
return entries.map(([state, count]) => ({ state, count }))
|
|
@ -1,31 +0,0 @@
|
|||
// eslint-disable-next-line no-undef
|
||||
const breweries = data
|
||||
const totals = {}
|
||||
for (let brewery of breweries) {
|
||||
const state = brewery.state
|
||||
if (totals[state] == null) {
|
||||
totals[state] = 1
|
||||
} else {
|
||||
totals[state]++
|
||||
}
|
||||
}
|
||||
const stateCodes = {
|
||||
texas: "tx",
|
||||
colorado: "co",
|
||||
florida: "fl",
|
||||
iwoa: "ia",
|
||||
louisiana: "la",
|
||||
california: "ca",
|
||||
pennsylvania: "pa",
|
||||
georgia: "ga",
|
||||
"new hampshire": "nh",
|
||||
virginia: "va",
|
||||
michigan: "mi",
|
||||
maryland: "md",
|
||||
ohio: "oh",
|
||||
}
|
||||
const entries = Object.entries(totals)
|
||||
return entries.map(([state, count]) => {
|
||||
stateCodes[state.toLowerCase()]
|
||||
return { state, count, flag: "http://flags.ox3.in/svg/us/${stateCode}.svg" }
|
||||
})
|
|
@ -153,8 +153,15 @@ export function isIsoDateString(str: string) {
|
|||
* @param column The column to check, to see if it is a valid relationship.
|
||||
* @param tableIds The IDs of the tables which currently exist.
|
||||
*/
|
||||
function shouldCopyRelationship(column: { type: string, tableId?: string }, tableIds: [string]) {
|
||||
return column.type === FieldTypes.LINK && column.tableId && tableIds.includes(column.tableId)
|
||||
function shouldCopyRelationship(
|
||||
column: { type: string; tableId?: string },
|
||||
tableIds: [string]
|
||||
) {
|
||||
return (
|
||||
column.type === FieldTypes.LINK &&
|
||||
column.tableId &&
|
||||
tableIds.includes(column.tableId)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -165,9 +172,15 @@ function shouldCopyRelationship(column: { type: string, tableId?: string }, tabl
|
|||
* @param column The column to check for options or boolean type.
|
||||
* @param fetchedColumn The fetched column to check for the type in the external database.
|
||||
*/
|
||||
function shouldCopySpecialColumn(column: { type: string }, fetchedColumn: { type: string } | undefined) {
|
||||
return column.type === FieldTypes.OPTIONS ||
|
||||
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) && column.type === FieldTypes.BOOLEAN)
|
||||
function shouldCopySpecialColumn(
|
||||
column: { type: string },
|
||||
fetchedColumn: { type: string } | undefined
|
||||
) {
|
||||
return (
|
||||
column.type === FieldTypes.OPTIONS ||
|
||||
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) &&
|
||||
column.type === FieldTypes.BOOLEAN)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue