Skip to content

Commit

Permalink
♻️ refactor: #17 타입 컨벤션에 맞게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkdumbbel committed Jul 17, 2022
1 parent ae3bd3a commit a4789fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/@types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ declare module 'request' {
media: MediaInterface[];
}

interface TotalData {
interface TotalDataInterface {
[date: string]: {
reports: ReportInterface[];
media: MediaInterface[];
Expand Down
4 changes: 2 additions & 2 deletions src/utils/createWeeklyList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
nextSunday,
getUnixTime,
} from 'date-fns';
import { MediaInterface, ReportInterface, TotalData } from 'request';
import { MediaInterface, ReportInterface, TotalDataInterface } from 'request';

type CombineDataType = ReportInterface | MediaInterface;

Expand Down Expand Up @@ -125,7 +125,7 @@ const setWeeklyData = (
dataList: string[][],
combinedData: CombineDataType[]
) => {
const weeklyData: TotalData = {};
const weeklyData: TotalDataInterface = {};

dataList.forEach(([periodOfWeek, startDate, endDate]) => {
const reportData = combinedData.filter(
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"isolatedModules": true, //각 파일을 분리된 모듈로 트랜스파일
"baseUrl": "./", // Non-relativ 모듈 혹은 paths 옵션의 기준 디렉토리
"resolveJsonModule": true, // 타입스크립트에서 json모듈 import 되도록 허용
"downlevelIteration": true,
"downlevelIteration": true, //target이 es6 이전 버전인 경우에 이터러블 프로토콜을 사용 할 수 있도록 해줌
"paths": {
// baseUrl 옵션을 기준디렉토리로 불러올 모듈의 위치 설정이 가능
"@/*": ["src/*"]
Expand Down

0 comments on commit a4789fa

Please sign in to comment.