monorepo 버전 준비

## @strpc
기존 RPC를 package화

### @strpc/express
express의 middleware + router 결함

## @sammo
게임 전체
- server, client
- gateway_server, gateway_client
This commit is contained in:
2023-09-23 16:29:18 +00:00
parent 734e0cb7bf
commit e59f9a9659
197 changed files with 15458 additions and 3 deletions
+18
View File
@@ -0,0 +1,18 @@
import { format, formatISO9075 } from 'date-fns';
//const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
const DATE_TIME_FORMAT_WITH_FRACTION = 'yyyy-MM-dd HH:mm:ss.SSS';
export function formatTime(time: Date, withFraction?:boolean): string;
export function formatTime(time: Date, format:string): string;
export function formatTime(time: Date, withFractionOrFormat:string|boolean = false): string {
if (typeof withFractionOrFormat === "string") {
return format(time, withFractionOrFormat);
}
else if(withFractionOrFormat){
return format(time, DATE_TIME_FORMAT_WITH_FRACTION);
}
else {
return formatISO9075(time);
}
}
@@ -0,0 +1,4 @@
import { formatTime } from './formatTime.js';
export function getDateTimeNow(withFraction = false): string {
return formatTime(new Date(), withFraction);
}
+3
View File
@@ -0,0 +1,3 @@
export * from "./formatTime.js";
export * from "./parseTime.js";
export * from "./parseYearMonth.js";
@@ -0,0 +1,3 @@
export function joinYearMonth(year: number, month: number): number {
return year * 12 + month - 1;
}
+5
View File
@@ -0,0 +1,5 @@
import {parseISO} from 'date-fns';
export function parseTime(dateString: string): Date{
return parseISO(dateString);
}
@@ -0,0 +1,3 @@
export function parseYearMonth(yearMonth: number): [number, number] {
return [(yearMonth / 12) | 0, yearMonth % 12 + 1];
}