feat: remove unclean require in core
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { describe, expect, it, jest, afterEach, afterAll } from '@jest/globals';
|
||||
import supertest from 'supertest';
|
||||
import Parser from 'rss-parser';
|
||||
import querystring from 'query-string';
|
||||
import type { serve } from '@hono/node-server';
|
||||
|
||||
const parser = new Parser();
|
||||
@@ -127,7 +126,12 @@ const testAntiHotlink = async (path, expectObj, query?: string | Record<string,
|
||||
|
||||
let queryStr;
|
||||
if (query) {
|
||||
queryStr = typeof query === 'string' ? query : querystring.stringify(query);
|
||||
queryStr =
|
||||
typeof query === 'string'
|
||||
? query
|
||||
: Object.entries(query)
|
||||
.map(([key, value]) => `${key}=${value}`)
|
||||
.join('&');
|
||||
}
|
||||
path = path + (queryStr ? `?${queryStr}` : '');
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
const title = require('title');
|
||||
import title from 'title';
|
||||
|
||||
// convert a string into title case
|
||||
const toTitleCase = (str: string) => title(str);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const assert = require('assert').strict;
|
||||
import { strict as assert } from 'assert';
|
||||
|
||||
const millisInAnHour = 60 * 60 * 1000;
|
||||
const serverTimezone = -new Date().getTimezoneOffset() / 60;
|
||||
|
||||
Reference in New Issue
Block a user