Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit a58bf13

Browse files
committed
2.0-readme
1 parent 1a732b1 commit a58bf13

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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

@@ -42,7 +43,7 @@
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

cache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

docs/icon.png

-287 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
},

public/logo.png

13.2 KB
Loading

0 commit comments

Comments
 (0)