Skip to content

Commit

Permalink
fix: linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evansiroky committed Jan 4, 2024
1 parent 9e266d8 commit aa55a99
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 30 deletions.
14 changes: 6 additions & 8 deletions scripts/update-data.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import update from '../src/update'

update(
(err) => {
if (err) {
console.log('update unsuccessful. Error: ', err)
} else {
console.log('update successfully completed')
}
update((err) => {
if (err) {
console.log('update unsuccessful. Error: ', err)
} else {
console.log('update successfully completed')
}
)
})
7 changes: 6 additions & 1 deletion src/find-1970.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import type { CacheOptions } from './find'
import { findUsingDataset, setCacheLevel } from './find'

const TZ_DATA = require('../data/timezones-1970.geojson.index.json')
const FEATURE_FILE_PATH = path.join(__dirname, '..', 'data', 'timezones-1970.geojson.geo.dat')
const FEATURE_FILE_PATH = path.join(
__dirname,
'..',
'data',
'timezones-1970.geojson.geo.dat',
)
let featureCache

/**
Expand Down
7 changes: 6 additions & 1 deletion src/find-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import type { CacheOptions } from './find'
import { findUsingDataset, setCacheLevel } from './find'

const TZ_DATA = require('../data/timezones.geojson.index.json')
const FEATURE_FILE_PATH = path.join(__dirname, '..', 'data', 'timezones.geojson.geo.dat')
const FEATURE_FILE_PATH = path.join(
__dirname,
'..',
'data',
'timezones.geojson.geo.dat',
)
let featureCache

/**
Expand Down
7 changes: 6 additions & 1 deletion src/find-now.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import type { CacheOptions } from './find'
import { findUsingDataset, setCacheLevel } from './find'

const TZ_DATA = require('../data/timezones-now.geojson.index.json')
const FEATURE_FILE_PATH = path.join(__dirname, '..', 'data', 'timezones-now.geojson.geo.dat')
const FEATURE_FILE_PATH = path.join(
__dirname,
'..',
'data',
'timezones-now.geojson.geo.dat',
)
let featureCache

/**
Expand Down
36 changes: 17 additions & 19 deletions src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,20 @@ function unzipDownloadProduct(product, callback) {
)
}

function processDataProduct(
product,
callback,
) {
function processDataProduct(product, callback) {
async.series(
[
// unzip data
(cb) => unzipDownloadProduct(product, cb),
// geoIndex data
(cb) => indexGeoJSON(
require(makeUnzipFilePath(product)),
dataDir,
product,
TARGET_INDEX_PERCENT,
cb,
),
(cb) =>
indexGeoJSON(
require(makeUnzipFilePath(product)),
dataDir,
product,
TARGET_INDEX_PERCENT,
cb,
),
],
callback,
)
Expand Down Expand Up @@ -170,21 +168,21 @@ export default function (cfg: { baseDir?: string } | Function, callback?) {
async.map(
dataProducts,
(dataProduct, mapCb) =>
downloadProduct(results.downloadReleaseMetadata, dataProduct, mapCb),
cb
)
downloadProduct(
results.downloadReleaseMetadata,
dataProduct,
mapCb,
),
cb,
),
],
calculateLookupData: [
'recreateDataDir',
'downloadData',
(results, cb) =>
async.map(
dataProducts,
(dataProduct, mapCb) =>
processDataProduct(
dataProduct,
mapCb,
),
(dataProduct, mapCb) => processDataProduct(dataProduct, mapCb),
cb,
),
],
Expand Down

0 comments on commit aa55a99

Please sign in to comment.