in packages/hooks/gulpfile.js [26:54]
async function genMetaData() {
const metadata = {
functions: [],
};
const hooks = fg
.sync('src/use*', {
onlyDirectories: true,
})
.map((hook) => hook.replace('src/', ''))
.sort();
await Promise.allSettled(
hooks.map(async (hook) => {
const description = await genDesc(`src/${hook}/index.en-US.md`);
return {
name: hook,
docs: `https://ahooks.js.org/hooks/${camelToKebab(hook)}`,
description,
};
}),
).then((res) => {
metadata.functions = res.map((item) => {
if (item.status === 'fulfilled') {
return item.value;
}
return null;
});
});
return metadata;
}