This repository was archived by the owner on May 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- <div class =" center " >
2-
3- ![ Code Statistic] ( /docs/icon .png )
4-
1+ <div align =" center " >
2+
3+ ![ Code Statistic] ( /public/logo .png )
4+ # Code Statistic
55</div >
66
7- # 🍏 Quickstart
7+
8+ ## 🍏 Quickstart
89
910<div align =" center " >
1011
4243
4344<a href =" https://github.com/zmh-program/code-statistic " ><img src =" https://stats.deeptrain.net/repo/zmh-program/Zh-Website/?theme=dark " ></a >
4445
45- # 🍎 Build Your Own Server
46+ ## 🍎 Build Your Own Server
4647##### 👉 * Build a [ Free Server] ( https://replit.com/@zmh-program/code-stats ) using the template ([ Replit] ( https://replit.com ) )*
4748### 🍒 Initialization
4849``` shell
Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ class Cache {
1616 get ( key : string ) : undefined | any { //@ts -ignore
1717 const value = this . caches [ key ] ;
1818 if ( this . exist ( key ) ) { //@ts -ignore
19- return JSON . parse ( value . value ) ;
19+ return value . value ;
2020 }
2121 }
2222
2323 set ( key : string , value : any ) : void { //@ts -ignore
2424 this . caches [ key ] = {
25- value : JSON . stringify ( value ) ,
25+ value : value ,
2626 expiration : ( new Date ( ) . getTime ( ) / 1000 ) + this . expiration ,
2727 }
2828 }
@@ -57,7 +57,7 @@ class Cache {
5757 const _this : Cache = this ;
5858 const name : string = func . name [ 0 ] === "_" ? func . name . slice ( 1 ) : func . name ;
5959 return async function ( ...params : any [ ] ) {
60- const key : string = name + JSON . stringify ( params ) ;
60+ const key : string = name + params . toString ( ) ;
6161 if ( _this . exist ( key ) ) {
6262 logger . debug ( `Hit Cache <${ name } >` )
6363 return _this . get ( key ) ;
Original file line number Diff line number Diff line change 22 "name" : " code-statistic" ,
33 "version" : " 1.0.0" ,
44 "description" : " Parse the lines of code for each language in the repository/account and generate the results. " ,
5- "main" : " index.js " ,
5+ "main" : " index.ts " ,
66 "scripts" : {
77 "test" : " echo \" Error: no test specified\" && exit 1"
88 },
You can’t perform that action at this time.
0 commit comments