Install @freearhey/core

This commit is contained in:
freearhey 2023-09-22 05:17:22 +03:00
parent 03208a262a
commit 4c92b4ecb1
39 changed files with 141 additions and 420 deletions

View file

@ -1,4 +1,5 @@
import { Storage, HTMLTable, Collection, LogParser, LogItem, File } from '../core'
import { Storage, Collection, File } from '@freearhey/core'
import { HTMLTable, LogParser, LogItem } from '../core'
import { Country, Subdivision } from '../models'
import { DATA_DIR, LOGS_DIR, README_DIR } from '../constants'
import { Table } from './table'
@ -17,7 +18,7 @@ export class CountryTable implements Table {
const parser = new LogParser()
const logsStorage = new Storage(LOGS_DIR)
const generatorsLog = await logsStorage.read('generators.log')
const generatorsLog = await logsStorage.load('generators.log')
let data = new Collection()
parser
@ -28,7 +29,7 @@ export class CountryTable implements Table {
)
.forEach((logItem: LogItem) => {
const file = new File(logItem.filepath)
const code = file.getFilename().toUpperCase()
const code = file.name().toUpperCase()
const [countryCode, subdivisionCode] = code.split('-') || ['', '']
if (subdivisionCode) {