refactor(website): remove unneccessary addPackageToModel function (#9983)

* types: fix links in @deprecated tags

* Merge branch 'main' into fix/deprecated-links-d.ts

* fix: searchIndices

* refactor: apply review suggestions

* refactor: remove addPackageToModel function

* fix: event links in search index

* fix: wrong overload condition
This commit is contained in:
Qjuh
2023-11-21 10:06:13 +01:00
committed by GitHub
parent ce0be392d8
commit 3d1c884926
6 changed files with 28 additions and 30 deletions

View File

@@ -1,6 +0,0 @@
import { type ApiModel, ApiPackage } from '@discordjs/api-extractor-model';
export const addPackageToModel = (model: ApiModel, data: any) => {
model.addMember(ApiPackage.loadFromJson(data));
return model;
};

View File

@@ -1,6 +1,5 @@
import { ApiModel, ApiFunction } from '@discordjs/api-extractor-model';
import { ApiModel, ApiFunction, ApiPackage } from '@discordjs/api-extractor-model';
import { fetchModelJSON } from '~/app/docAPI';
import { addPackageToModel } from './addPackageToModel';
import { OVERLOAD_SEPARATOR, PACKAGES } from './constants';
import { findMember, findMemberByKey } from './model';
@@ -21,7 +20,7 @@ export const fetchMember = async (packageName: string, branchName: string, item?
return null;
}
addPackageToModel(model, modelJSON);
model.addMember(ApiPackage.loadFromJson(modelJSON));
const [memberName, overloadIndex] = decodeURIComponent(item).split(OVERLOAD_SEPARATOR);