@@ -15,13 +15,13 @@ import { BaseOptions, ExtendedOptions, Result, setDefaults } from "./util.ts";
1515 * @param project - インポート先のprojectの名前
1616 * @param data - インポートするページデータ
1717 */
18- export async function importPages (
18+ export const importPages = async (
1919 project : string ,
2020 data : ImportedData < boolean > ,
2121 init : ExtendedOptions ,
2222) : Promise <
2323 Result < string , ErrorLike >
24- > {
24+ > => {
2525 if ( data . pages . length === 0 ) {
2626 return { ok : true , value : "No pages to import." } ;
2727 }
@@ -65,7 +65,7 @@ export async function importPages(
6565
6666 const { message } = ( await res . json ( ) ) as { message : string } ;
6767 return { ok : true , value : message } ;
68- }
68+ } ;
6969
7070/** `exportPages`の認証情報 */
7171export interface ExportInit < withMetadata extends true | false >
@@ -76,15 +76,15 @@ export interface ExportInit<withMetadata extends true | false>
7676 *
7777 * @param project exportしたいproject
7878 */
79- export async function exportPages < withMetadata extends true | false > (
79+ export const exportPages = async < withMetadata extends true | false > (
8080 project : string ,
8181 init : ExportInit < withMetadata > ,
8282) : Promise <
8383 Result <
8484 ExportedData < withMetadata > ,
8585 NotFoundError | NotPrivilegeError | NotLoggedInError
8686 >
87- > {
87+ > => {
8888 const { sid, hostName, fetch, metadata } = setDefaults ( init ?? { } ) ;
8989 const path =
9090 `https://${ hostName } /api/page-data/export/${ project } .json?metadata=${ metadata } ` ;
@@ -111,4 +111,4 @@ export async function exportPages<withMetadata extends true | false>(
111111
112112 const value = ( await res . json ( ) ) as ExportedData < withMetadata > ;
113113 return { ok : true , value } ;
114- }
114+ } ;
0 commit comments