mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
type: fix typescript error (#44769)
This commit is contained in:
parent
4f7655ce31
commit
bcf7c924e2
@ -122,8 +122,10 @@ async function printLog() {
|
|||||||
const text = `${message} ${body}`;
|
const text = `${message} ${body}`;
|
||||||
|
|
||||||
const match = text.match(/#\d+/g);
|
const match = text.match(/#\d+/g);
|
||||||
const prs = (match || []).map((pr) => pr.slice(1));
|
|
||||||
const validatePRs = [];
|
const prs = match?.map((pr) => pr.slice(1)) || [];
|
||||||
|
|
||||||
|
const validatePRs: PR[] = [];
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
`[${i + 1}/${logs.all.length}]`,
|
`[${i + 1}/${logs.all.length}]`,
|
||||||
@ -135,26 +137,24 @@ async function printLog() {
|
|||||||
const pr = prs[j];
|
const pr = prs[j];
|
||||||
|
|
||||||
// Use jquery to get full html page since it don't need auth token
|
// Use jquery to get full html page since it don't need auth token
|
||||||
let res: any;
|
let res: Response | undefined;
|
||||||
|
let html: string | undefined;
|
||||||
let tryTimes = 0;
|
let tryTimes = 0;
|
||||||
const timeout = 30000;
|
const timeout = 30000;
|
||||||
let html: HTMLElement | undefined;
|
|
||||||
const fetchPullRequest = async () => {
|
const fetchPullRequest = async () => {
|
||||||
try {
|
try {
|
||||||
res = await new Promise((resolve, reject) => {
|
res = await new Promise<Response>((resolve, reject) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
reject(new Error(`Fetch timeout of ${timeout}ms exceeded`));
|
reject(new Error(`Fetch timeout of ${timeout}ms exceeded`));
|
||||||
}, timeout);
|
}, timeout);
|
||||||
fetch(`https://github.com/ant-design/ant-design/pull/${pr}`)
|
fetch(`https://github.com/ant-design/ant-design/pull/${pr}`)
|
||||||
.then((response: Response) => {
|
.then((response) => {
|
||||||
response.text().then((htmlRes) => {
|
response.text().then((htmlRes) => {
|
||||||
html = htmlRes;
|
html = htmlRes;
|
||||||
resolve(response);
|
resolve(response);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch(reject);
|
||||||
reject(error);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
tryTimes++;
|
tryTimes++;
|
||||||
@ -224,11 +224,11 @@ async function printLog() {
|
|||||||
|
|
||||||
console.log('\n', chalk.green('Done. Here is the log:'));
|
console.log('\n', chalk.green('Done. Here is the log:'));
|
||||||
|
|
||||||
function printPR(lang: string, postLang: (str?: string) => string) {
|
function printPR(lang: string, postLang: (str: string) => string) {
|
||||||
prList.forEach((entity) => {
|
prList.forEach((entity) => {
|
||||||
const { pr, author, hash, title } = entity;
|
const { pr, author, hash, title } = entity;
|
||||||
if (pr) {
|
if (pr) {
|
||||||
const str = postLang(entity[lang as keyof PR]);
|
const str = postLang(entity[lang as keyof PR]!);
|
||||||
let icon = '';
|
let icon = '';
|
||||||
if (str.toLowerCase().includes('fix') || str.includes('修复')) {
|
if (str.toLowerCase().includes('fix') || str.includes('修复')) {
|
||||||
icon = '🐞';
|
icon = '🐞';
|
||||||
|
Loading…
Reference in New Issue
Block a user