Add TopLiba (#1003)
* test * cleanup deleted unused `fetchFile` import replaced fetch with `fetchApi` * eslint * fix * fix multi * Hmm, what to do next. * test URLSearchParams * fix
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import list from './sources.json' with { type: 'json' };
|
||||
import defaultSettings from './settings.json' with { type: 'json' };
|
||||
import { readFileSync } from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, join } from 'path';
|
||||
|
||||
const folder = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export const generateAll = function () {
|
||||
return list.map(metadata => {
|
||||
@@ -12,12 +15,9 @@ export const generateAll = function () {
|
||||
};
|
||||
|
||||
const generator = function generator(metadata) {
|
||||
const IfreedomTemplate = readFileSync(
|
||||
'./scripts/multisrc/ifreedom/template.ts',
|
||||
{
|
||||
encoding: 'utf-8',
|
||||
},
|
||||
);
|
||||
const IfreedomTemplate = readFileSync(join(folder, 'template.ts'), {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
|
||||
const pluginScript = `
|
||||
${IfreedomTemplate}
|
||||
|
||||
@@ -187,7 +187,7 @@ class IfreedomPlugin implements Plugin.PluginBase {
|
||||
}
|
||||
|
||||
parseDate = (dateString: string | undefined = '') => {
|
||||
const months: { [key: string]: number } = {
|
||||
const months: Record<string, number> = {
|
||||
января: 1,
|
||||
февраля: 2,
|
||||
марта: 3,
|
||||
|
||||
Reference in New Issue
Block a user