Skip to content

Commit 736ad26

Browse files
authored
Merge pull request #240 from takker99:feat/rename-get-links-functions
feat(api): rename get/list functions to getLinks/getLinksStream
2 parents fe4d6a4 + 9fe975f commit 736ad26

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

api/pages/project/search/titles.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "../../../../error.ts";
1616

1717
/**
18-
* Options for {@linkcode get}
18+
* Options for {@linkcode getLinks}
1919
*
2020
* @experimental **UNSTABLE**: New API, yet to be vetted.
2121
*/
@@ -33,7 +33,7 @@ export interface GetLinksOptions<R extends Response | undefined>
3333
* @param options - Additional configuration options
3434
* @returns A {@linkcode Request} object for fetching link data
3535
*/
36-
export const makeGetRequest = <R extends Response | undefined>(
36+
export const makeGetLinksRequest = <R extends Response | undefined>(
3737
project: string,
3838
options?: GetLinksOptions<R>,
3939
): Request => {
@@ -59,7 +59,7 @@ export const makeGetRequest = <R extends Response | undefined>(
5959
* @param options Additional configuration options for the request
6060
* @returns A {@linkcode Response} object containing the link data
6161
*/
62-
export const get = <R extends Response | undefined = Response>(
62+
export const getLinks = <R extends Response | undefined = Response>(
6363
project: string,
6464
options?: GetLinksOptions<R>,
6565
): Promise<
@@ -72,7 +72,7 @@ export const get = <R extends Response | undefined = Response>(
7272
}, R>
7373
> =>
7474
setDefaults(options ?? {}).fetch(
75-
makeGetRequest(project, options),
75+
makeGetLinksRequest(project, options),
7676
) as Promise<
7777
ResponseOfEndpoint<{
7878
200: SearchedTitle[];
@@ -92,13 +92,13 @@ export const get = <R extends Response | undefined = Response>(
9292
* @returns An async generator that yields each link data
9393
* @throws {TypedError<"NotLoggedInError" | "NotMemberError" | "NotFoundError" | "InvalidFollowingIdError"> | HTTPError}
9494
*/
95-
export async function* list(
95+
export async function* getLinksStream(
9696
project: string,
9797
options?: GetLinksOptions<Response>,
9898
): AsyncGenerator<SearchedTitle, void, unknown> {
9999
let followingId = options?.followingId ?? "";
100100
do {
101-
const response = await get(project, { ...options, followingId });
101+
const response = await getLinks(project, { ...options, followingId });
102102
switch (response.status) {
103103
case 200:
104104
break;

0 commit comments

Comments
 (0)