From 706b0c530cbf7a18cef748b4509e56820464ecac Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Mon, 18 Feb 2019 22:15:00 +0800 Subject: [PATCH] fix: types in GitHubHelper --- src/utils/GitHubHelper.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/utils/GitHubHelper.ts b/src/utils/GitHubHelper.ts index 5d1f970..26bbe3f 100644 --- a/src/utils/GitHubHelper.ts +++ b/src/utils/GitHubHelper.ts @@ -74,15 +74,21 @@ async function getTreeData({ userName, repoName, branchName, accessToken }: Meta export type ItemData = { userName: string repoName: string - branchName: string accessToken: string } export type BlobData = { + encoding: 'base64' | string fileSHA: string -} & ItemData + content?: string +} -async function getBlobData({ userName, repoName, accessToken, fileSHA }: BlobData) { +async function getBlobData({ + userName, + repoName, + accessToken, + fileSHA, +}: Pick) { const url = `https://api.github.com/repos/${userName}/${repoName}/git/blobs/${fileSHA}` return await request(url, { accessToken }) }