Skip to content

Commit 139c202

Browse files
committed
feat: init pull version
1 parent 5b7daba commit 139c202

4 files changed

Lines changed: 15 additions & 17 deletions

File tree

.gitignore

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ dist
132132
.yarn/build-state.yml
133133
.yarn/install-state.gz
134134
.pnp.*
135-
.user.ini
135+
.user.ini

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// index.js
21
const Koa = require('koa');
32
const Router = require('koa-router');
43
const { koaBody } = require('koa-body');

utils/appendSuffixToFilename.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
function appendSuffixToFilename(filename, suffix) {
2-
// 找到最后一个点的位置
3-
const lastDotIndex = filename.lastIndexOf('.');
4-
// 如果找到了点,则在点之前插入后缀
5-
if (lastDotIndex !== -1) {
6-
return `${filename.substring(
7-
0,
8-
lastDotIndex
9-
)}_${suffix}${filename.substring(lastDotIndex)}`;
10-
} else {
11-
// 如果没有点,直接在末尾添加后缀
12-
return `${filename}_${suffix}`;
13-
}
2+
// 找到最后一个点的位置
3+
const lastDotIndex = filename.lastIndexOf('.');
4+
// 如果找到了点,则在点之前插入后缀
5+
if (lastDotIndex !== -1) {
6+
return `${filename.substring(
7+
0,
8+
lastDotIndex
9+
)}_${suffix}${filename.substring(lastDotIndex)}`;
10+
} else {
11+
// 如果没有点,直接在末尾添加后缀
12+
return `${filename}_${suffix}`;
1413
}
15-
16-
module.exports = { appendSuffixToFilename };
17-
14+
}
15+
16+
module.exports = { appendSuffixToFilename };

yarn.lock

100755100644
File mode changed.

0 commit comments

Comments
 (0)