Skip to content

Commit 1d0f9ae

Browse files
authored
Merge pull request #54 from mmdapl/feat/dev
feat: 算法md文档更新,新增百度统计相关配置
2 parents 1ee2370 + 0724b3b commit 1d0f9ae

File tree

278 files changed

+296
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+296
-99
lines changed

.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
node_modules
2-
manuscript
1+
node_modules

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
2-
manuscript
2+
docs/manuscripts
33
.github
44
.idea
55
.dockerignore

.github/workflows/CD.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ jobs:
129129
- name: Create Zip Package
130130
run: |
131131
zip -r JavaScriptCollection.zip . \
132-
-x "node_modules/*"
132+
-x "node_modules/*" \
133+
-x ".git/*" \
133134
134135
# 提取版本号
135136
- name: Get New Version Number

.gitignore

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ pids
1616
*.seed
1717
*.pid.lock
1818

19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
2219
# Coverage directory used by tools like istanbul
2320
coverage
2421
*.lcov
@@ -27,15 +24,6 @@ coverage
2724
.nyc_output
2825

2926

30-
# Bower dependency directory (https://bower.io/)
31-
bower_components
32-
33-
# node-waf configuration
34-
.lock-wscript
35-
36-
# Compiled binary addons (https://nodejs.org/api/addons.html)
37-
build/Release
38-
3927
# Dependency directories
4028
node_modules/
4129
jspm_packages/
@@ -58,12 +46,9 @@ typings/
5846
.rts2_cache_es/
5947
.rts2_cache_umd/
6048

61-
6249
# Output of 'npm pack'
6350
*.tgz
6451

65-
# Yarn Integrity file
66-
.yarn-integrity
6752

6853
# dotenv environment variables file
6954
.env

CHANGELOG.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ All notable changes to this project will be documented in this file. See [Conven
1414
* **algorithm:** 算法文档更新,侧边栏优化 ([80f08f6](https://github.com/mmdapl/JavaScriptCollection/commit/80f08f66dd98e3a511f6ac48f1f55bca8bbc6655))
1515
* build-proxy image ([e460747](https://github.com/mmdapl/JavaScriptCollection/commit/e460747d5719490c659a6b015418a4daa7179d89))
1616
* **ci:** add code-ci for eslint ([c8b91aa](https://github.com/mmdapl/JavaScriptCollection/commit/c8b91aa5fe3b50411f65d878c89193cb64f1a7bf))
17-
* **ci:** update code-ci rule ([7106c25](https://github.com/mmdapl/JavaScriptCollection/commit/7106c2535c71aa8a60076e5eda698b09bcdeff61))
18-
* **ci:** update run ([a9d6b0d](https://github.com/mmdapl/JavaScriptCollection/commit/a9d6b0d0740eda7d61fb2efe97f37131d54be7e5))
19-
* **ci:** update secrets ([6c5b40f](https://github.com/mmdapl/JavaScriptCollection/commit/6c5b40f821bf402199c0d4ce353047ee0ab0aa63))
2017
* ci回滚 ([7f9f9b4](https://github.com/mmdapl/JavaScriptCollection/commit/7f9f9b46bd0738bc2ecd2c676b6c073e2c1a9c3f))
2118
* **ci:** 支持master分之部署 ([b60319c](https://github.com/mmdapl/JavaScriptCollection/commit/b60319cba8049d0488d4e32a60f1e3c9af1d9a45))
2219
* ci流程优化,修复部分脚本异常 ([8e50abf](https://github.com/mmdapl/JavaScriptCollection/commit/8e50abfc505a36be3f31d5ac4e17dceb72a80981))
@@ -41,13 +38,7 @@ All notable changes to this project will be documented in this file. See [Conven
4138
* update ([871d031](https://github.com/mmdapl/JavaScriptCollection/commit/871d0311a78bcf3e24f9fbe436f88318ccc72f0c))
4239
* update /service_env/ ([0434970](https://github.com/mmdapl/JavaScriptCollection/commit/0434970eb89836cd3a0db685ff738a324f67326b))
4340
* update ci ([f01ca69](https://github.com/mmdapl/JavaScriptCollection/commit/f01ca6903e5bf992598f62a636269489b0bfee95))
44-
* update ci rule ([177c2f4](https://github.com/mmdapl/JavaScriptCollection/commit/177c2f4e8077debe50809e00c162a433b13a81ab))
4541
* update ci yaml ([e7e33f5](https://github.com/mmdapl/JavaScriptCollection/commit/e7e33f56ad20820ced703567690c84bc4a9070c6))
46-
* update config ([f7eaeac](https://github.com/mmdapl/JavaScriptCollection/commit/f7eaeac28bada71001dd884023e8a3dad7e0ff83))
47-
* update docs ([510f213](https://github.com/mmdapl/JavaScriptCollection/commit/510f21308a12c653706c2409f4f251bc7dff0bc1))
48-
* update job sort ([46ba934](https://github.com/mmdapl/JavaScriptCollection/commit/46ba934711958d8d300bd8c780fb68de22a09df5))
49-
* update logo ([435550c](https://github.com/mmdapl/JavaScriptCollection/commit/435550cd03ab34ac8da708d3fd5213573fa1006f))
50-
* update todo list ([c9b8b8e](https://github.com/mmdapl/JavaScriptCollection/commit/c9b8b8e341f3257e29c4b44239bd2b3a19960320))
5142
* update-desc ([185af9d](https://github.com/mmdapl/JavaScriptCollection/commit/185af9db8762d9cd394bad944a66e6a2d672afee))
5243
* **vercel:** vercel 统计相关配置 ([fe5f02e](https://github.com/mmdapl/JavaScriptCollection/commit/fe5f02ed5b921b26105233653ef66d9eef932430))
5344
* 优化js代码,新增链表相关刷题文档 ([d99044f](https://github.com/mmdapl/JavaScriptCollection/commit/d99044f1ffc643b14b8c41cc63f6e9bab105b71b))

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN if [ "$CONTAINER_BUILD" = "true" ]; then \
2424
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine
2525
ARG APP_VERSION
2626
LABEL version=$APP_VERSION description="JavaScriptCollection文档合集、博客"
27-
LABEL author="【Github&公众号】:Rong姐姐好可爱" email="fairy@2925.com"
27+
LABEL author="【Github&公众号】:储凡" email="fairy@2925.com"
2828
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面 注意:--from参数
2929
COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
3030
COPY nginx.conf /etc/nginx/
File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* 计数
3+
* @param str
4+
*/
5+
function count(str:string) {
6+
// 转换为数组后去重
7+
const originArr = str.split('')
8+
const arr = Array.from(new Set<string>(originArr))
9+
const result = {}
10+
for (let index = 0; index < arr.length; index++) {
11+
const value = arr[index]
12+
let count = 0
13+
if (value !== ' ') {
14+
originArr.forEach(item => {
15+
if (item === value) {
16+
count++
17+
}
18+
})
19+
// 对象计数
20+
result[value] = count
21+
}
22+
}
23+
return result
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* 找出数组 arr 中重复出现过的元素
3+
*/
4+
function duplicates(arr:number[]) {
5+
const sortArr = arr.sort()
6+
const result = []
7+
const len = sortArr.length
8+
for (let index = 0; index < len - 1; index++) {
9+
if (sortArr[index] === sortArr[index++]) {
10+
result.push(sortArr[index])
11+
}
12+
}
13+
// 去重
14+
return Array.from(new Set(result))
15+
}
16+
17+
console.log(duplicates([1, 2, 4, 4, 3, 3, 1, 5, 3]))

0 commit comments

Comments
 (0)