Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
91c7ce6
docs: update README
mmdapl Oct 16, 2024
cf3f012
fix: 修复`simple-git-hooks`钩子函数触发异常 (#181)
mmdapl Oct 28, 2024
c0eac80
style: update code and docs
mmdapl Oct 28, 2024
6618885
perf: update `@142vip/vuepress` deps
mmdapl Oct 28, 2024
f90d42d
Merge pull request #182 from 142vip/perf/update-deps
mmdapl Oct 28, 2024
7b7d698
chore: update docs by eslint
mmdapl Oct 28, 2024
d78e081
fix: 修复`Docker`构建`OOM`异常,使用增加`OOM`限制的`node:20.17.0-alpine`基础镜像
mmdapl Nov 1, 2024
c9ea4b0
Merge pull request #183 from 142vip/fix/docker-build
chufan443 Nov 1, 2024
ccf4c9e
style: 修复`Eslint`校验报错异常,修改部分代码和文档格式 (#184)
mmdapl Nov 1, 2024
45a50de
chore(release): publish v0.0.2-alpha.22
mmdapl Nov 1, 2024
6363d48
feat: 支持`renovate`自动升级依赖版本
mmdapl Dec 22, 2024
0b889a2
fix(deps): update dependency http-errors to v2 (#203)
renovate[bot] Dec 22, 2024
989a40b
chore(deps): update github/codeql-action action to v3 (#201)
renovate[bot] Dec 22, 2024
abce39c
fix(deps): update dependency express to v4.21.2 (#194)
renovate[bot] Dec 22, 2024
6dbb4c8
fix(deps): update dependency debug to v4 (#202)
renovate[bot] Dec 22, 2024
9e440e4
chore(deps): update dependency @142vip/utils to v0.0.1-alpha.11 (#188)
renovate[bot] Dec 25, 2024
66f9822
chore(deps): update dependency @142vip/vuepress to v0.0.1-alpha.9 (#189)
renovate[bot] Dec 26, 2024
114197f
chore(deps): update dependency @142vip/fairy-cli to v0.0.3-alpha.17 (…
renovate[bot] Dec 26, 2024
2a8c1bb
chore(deps): update dependency vuepress to v2.0.0-rc.19 (#191)
renovate[bot] Feb 3, 2025
9254cc6
chore(deps): update dependency @vuepress/bundler-vite to v2.0.0-rc.19
mmdapl Feb 3, 2025
62b1e26
chore: COREPACK_INTEGRITY_KEYS=0
mmdapl Feb 3, 2025
36fa2a9
chore(deps): update dependency @142vip/utils to v0.0.1-alpha.14 (#206)
renovate[bot] Feb 3, 2025
cd020c3
chore(deps): update dependency @142vip/fairy-cli to v0.0.3-alpha.18 (…
renovate[bot] Feb 3, 2025
7be2229
feat: lock sequelize version (#208)
mmdapl Feb 4, 2025
8ff3965
fix: 修复`clean`命令移除`node_modules`模块
mmdapl Feb 4, 2025
927b22f
feat: 增加`clean:hooks`命令
mmdapl Feb 4, 2025
4d27dda
feat: lock deps version
mmdapl Feb 4, 2025
03b57a3
chore(release): publish v0.0.2-alpha.23
mmdapl Feb 4, 2025
53069a3
chore(deps): update dependency @142vip/utils to v0.0.1-alpha.14 (#210)
renovate[bot] Feb 6, 2025
050f04f
fix(deps): update dependency koa to v2.15.3 (#212)
renovate[bot] Feb 6, 2025
ca914b3
fix(deps): update dependency sequelize to v6.37.5 (#213)
renovate[bot] Feb 6, 2025
242514a
chore(deps): update dependency @142vip/vuepress to v0.0.1-alpha.9 (#211)
renovate[bot] Feb 6, 2025
36b21ef
chore(deps): update dependency @142vip/fairy-cli to v0.0.3-alpha.18 (…
renovate[bot] Feb 6, 2025
a609139
fix: 修复`bundle`脚本异常
mmdapl Feb 6, 2025
9ea91ba
chore(release): publish v0.0.2-alpha.24
mmdapl Feb 6, 2025
066524b
feat(deps): update pnpm to v9.15.0
mmdapl Feb 6, 2025
e9fa05b
Merge pull request #215 from 142vip/feat/pnpm-9.15
mmdapl Feb 6, 2025
9b1beaa
feat(deps): lock the version, use a fixed version number
mmdapl Feb 6, 2025
48a02e7
fix(deps): update dependency koa to v2.15.4 [security] (#220)
renovate[bot] Feb 13, 2025
e2ce7fc
chore(deps): update dependency @142vip/vuepress to v0.0.1-alpha.10 (#…
renovate[bot] Feb 13, 2025
ddf9893
chore(deps): update dependency @142vip/fairy-cli to v0.0.3-alpha.20 (…
renovate[bot] Feb 13, 2025
ef0219f
chore(deps): update dependency @142vip/utils to v0.0.1-alpha.19 (#218)
renovate[bot] Feb 13, 2025
9f17322
fix: 修复`bundle`命令构建异常 (#222)
mmdapl Feb 14, 2025
05345d9
chore(deps): update dependency @142vip/eslint-config to v0.0.1-alpha.3
renovate[bot] Feb 22, 2025
16e12c6
style: eslint code
mmdapl Feb 24, 2025
30cc4ca
chore(release): publish v0.0.2-alpha.25
mmdapl Feb 24, 2025
09c3599
feat: 升级依赖,修复`Dockerfile`镜像构建异常
mmdapl Mar 30, 2025
23bade6
Merge pull request #230 from 142vip/fix/dockerfile
mmdapl Mar 30, 2025
7b530bf
chore(deps): update dependency vuepress to v2.0.0-rc.20
mmdapl Mar 30, 2025
5d42823
feat: 依赖升级,工程化定期改造 (#232)
mmdapl May 7, 2025
b7c798d
fix: 修复新版本`@142vip/vuepress`依赖导致的编译失败 (#233)
mmdapl May 10, 2025
2465705
feat: 基于`@142vip/vuepress`对站点升级,简化配置、优化整体结构 (#234)
mmdapl May 18, 2025
ab34969
chore(deps): update dependency simple-git-hooks to v2.13.0 (#236)
renovate[bot] May 18, 2025
bc3e4bf
chore(deps): update dependency @142vip/commit-linter to v0.0.1-alpha.…
renovate[bot] May 18, 2025
51e5dff
chore: update
mmdapl May 18, 2025
708615c
chore(release): publish v0.0.2-alpha.26
mmdapl May 18, 2025
18b151a
feat: 增加`pull`流水线,自动同步下游 (#237)
mmdapl May 22, 2025
3976247
ci: 升级`@142vip/utils`依赖,调整镜像构建流程,增加hash标签
mmdapl Mar 25, 2026
1b30f31
build(scripts): 支持`corepack`安装校验,优雅下载
mmdapl Mar 25, 2026
b14076b
build(Dockerfile): 修改镜像源,提供`vpc`网络通道
mmdapl Mar 25, 2026
ae0ed9f
style: 文档格式调整,提高阅读效果
mmdapl Mar 25, 2026
4674452
build(scripts): 优化构建脚本,简化镜像打包流程,支持`--proxy`构建
mmdapl Mar 25, 2026
5d29912
chore: 升级`@142vip`相关依赖
mmdapl May 15, 2026
46f684d
fix: 修复首页链接错误,图标显示异常
mmdapl Jun 24, 2026
77b1817
fix: 升级ci脚本依赖,修复构建、部署异常 (#244)
mmdapl Jun 24, 2026
e9c4951
fix: 修复镜像构建异常,简化构建步骤、处理逻辑
mmdapl Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 参考:https://wei.github.io/pull/
version: '1'
rules:
- base: main
upstream: 142vip:main
mergeMethod: hardreset
- base: next
upstream: 142vip:next
mergeMethod: hardreset
# 兼容master分支
- base: master
upstream: 142vip:master
mergeMethod: hardreset
24 changes: 24 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 参考:https://docs.renovatebot.com/configuration-options/#configuration-options
{
"extends": ["config:base"],
"labels": ["PR:dependencies"],
"baseBranches": ["next"],
"schedule": ["before 3am on Friday"],
"additionalBranchPrefix": "{{parentDir}}-",
"branchConcurrentLimit": 6,
// 触发CI流水线
"requiredStatusChecks": [
"CI"
],
"packageRules": [
{
"matchDepTypes": ["devDependencies"],
"matchUpdateTypes": ["minor", "patch"],
"schedule": ["at any time"],
"prConcurrentLimit": 4,
"platformAutomerge": true,
"addLabels": ["devDependencies"],
"automerge": false
}
]
}
4 changes: 2 additions & 2 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: PNPM Install
uses: pnpm/action-setup@v4
with:
version: 9.6.0
version: 9.15.0

# 安装Node环境
- name: Install Node.js
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- name: PNPM Install
uses: pnpm/action-setup@v4
with:
version: 9.6.0
version: 9.15.0

# 安装Node环境
- name: Install Node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: PNPM Install
uses: pnpm/action-setup@v4
with:
version: 9.6.0
version: 9.15.0

# 安装Node环境
- name: Install Node.js
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
queries: +security-extended
# Override language selection by uncommenting this and choosing your languages
Expand All @@ -30,7 +30,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
79 changes: 78 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,86 @@
# Release history
# Changelog

All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<!-- #region recent-alpha -->

## v0.0.2-alpha.26 (2025-05-18)

### ✨ Features

- 升级依赖,修复`Dockerfile`镜像构建异常 &nbsp;-&nbsp; by **chufan** [<samp>(09c35)</samp>](https://github.com/142vip/JavaScriptCollection/commit/09c3599)
- 依赖升级,工程化定期改造 &nbsp;-&nbsp; by **142vip.cn** in https://github.com/142vip/JavaScriptCollection/issues/232 [<samp>(5d428)</samp>](https://github.com/142vip/JavaScriptCollection/commit/5d42823)
- 基于`@142vip/vuepress`对站点升级,简化配置、优化整体结构 &nbsp;-&nbsp; by **142vip.cn** in https://github.com/142vip/JavaScriptCollection/issues/234 [<samp>(24657)</samp>](https://github.com/142vip/JavaScriptCollection/commit/2465705)

### 🐛 Bug Fixes

- 修复新版本`@142vip/vuepress`依赖导致的编译失败 &nbsp;-&nbsp; by **142vip.cn** in https://github.com/142vip/JavaScriptCollection/issues/233 [<samp>(b7c79)</samp>](https://github.com/142vip/JavaScriptCollection/commit/b7c798d)

**Release New Version v0.0.2-alpha.26 [👉 View Changes On GitHub](https://github.com/142vip/JavaScriptCollection/compare/v0.0.2-alpha.25...v0.0.2-alpha.26)**

## v0.0.2-alpha.25 (2025-02-24)

### ✨ Features

- **deps**:
- Update pnpm to v9.15.0 &nbsp;-&nbsp; by **chufan** [<samp>(06652)</samp>](https://github.com/142vip/JavaScriptCollection/commit/066524b)
- Lock the version, use a fixed version number &nbsp;-&nbsp; by **chufan** [<samp>(9b1be)</samp>](https://github.com/142vip/JavaScriptCollection/commit/9b1beaa)

### 🐛 Bug Fixes

- 修复`bundle`命令构建异常 &nbsp;-&nbsp; by **142vip.cn** in https://github.com/142vip/JavaScriptCollection/issues/222 [<samp>(9f173)</samp>](https://github.com/142vip/JavaScriptCollection/commit/9f17322)
- **deps**:
- Update dependency koa to v2.15.4 [security] &nbsp;-&nbsp; by **renovate[bot]** in https://github.com/142vip/JavaScriptCollection/issues/220 [<samp>(48a02)</samp>](https://github.com/142vip/JavaScriptCollection/commit/48a02e7)

**Release New Version v0.0.2-alpha.25 [👉 View Changes On GitHub](https://github.com/142vip/JavaScriptCollection/compare/v0.0.2-alpha.24...v0.0.2-alpha.25)**

## v0.0.2-alpha.24 (2025-02-06)

### 🐛 Bug Fixes

- 修复`bundle`脚本异常 &nbsp;-&nbsp; by **chufan** [<samp>(a6091)</samp>](https://github.com/142vip/JavaScriptCollection/commit/a609139)
- **deps**:
- Update dependency koa to v2.15.3 &nbsp;-&nbsp; by **renovate[bot]** in https://github.com/142vip/JavaScriptCollection/issues/212 [<samp>(050f0)</samp>](https://github.com/142vip/JavaScriptCollection/commit/050f04f)
- Update dependency sequelize to v6.37.5 &nbsp;-&nbsp; by **renovate[bot]** in https://github.com/142vip/JavaScriptCollection/issues/213 [<samp>(ca914)</samp>](https://github.com/142vip/JavaScriptCollection/commit/ca914b3)

**Release New Version v0.0.2-alpha.24 [👉 View Changes On GitHub](https://github.com/142vip/JavaScriptCollection/compare/v0.0.2-alpha.23...v0.0.2-alpha.24)**

## v0.0.2-alpha.23 (2025-02-04)

### ✨ Features

- 支持`renovate`自动升级依赖版本 &nbsp;-&nbsp; by **chufan** [<samp>(6363d)</samp>](https://github.com/142vip/JavaScriptCollection/commit/6363d48)
- Lock sequelize version &nbsp;-&nbsp; by **142vip.cn** in https://github.com/142vip/JavaScriptCollection/issues/208 [<samp>(7be22)</samp>](https://github.com/142vip/JavaScriptCollection/commit/7be2229)
- 增加`clean:hooks`命令 &nbsp;-&nbsp; by **chufan** [<samp>(927b2)</samp>](https://github.com/142vip/JavaScriptCollection/commit/927b22f)
- Lock deps version &nbsp;-&nbsp; by **chufan** [<samp>(4d27d)</samp>](https://github.com/142vip/JavaScriptCollection/commit/4d27dda)

### 🐛 Bug Fixes

- 修复`clean`命令移除`node_modules`模块 &nbsp;-&nbsp; by **chufan** [<samp>(8ff39)</samp>](https://github.com/142vip/JavaScriptCollection/commit/8ff3965)
- **deps**:
- Update dependency http-errors to v2 &nbsp;-&nbsp; by **renovate[bot]** in https://github.com/142vip/JavaScriptCollection/issues/203 [<samp>(0b889)</samp>](https://github.com/142vip/JavaScriptCollection/commit/0b889a2)
- Update dependency express to v4.21.2 &nbsp;-&nbsp; by **renovate[bot]** in https://github.com/142vip/JavaScriptCollection/issues/194 [<samp>(abce3)</samp>](https://github.com/142vip/JavaScriptCollection/commit/abce39c)
- Update dependency debug to v4 &nbsp;-&nbsp; by **renovate[bot]** in https://github.com/142vip/JavaScriptCollection/issues/202 [<samp>(6dbb4)</samp>](https://github.com/142vip/JavaScriptCollection/commit/6dbb4c8)

**Release New Version v0.0.2-alpha.23 [👉 View Changes On GitHub](https://github.com/142vip/JavaScriptCollection/compare/v0.0.2-alpha.22...v0.0.2-alpha.23)**

## v0.0.2-alpha.22 (2024-11-01)

### 🔥 Performance

- Update `@142vip/vuepress` deps &nbsp;-&nbsp; by **chufan** [<samp>(66188)</samp>](https://github.com/142vip/JavaScriptCollection/commit/6618885)

### 🐛 Bug Fixes

- 修复`simple-git-hooks`钩子函数触发异常 &nbsp;-&nbsp; by **142vip.cn** in https://github.com/142vip/JavaScriptCollection/issues/181 [<samp>(cf3f0)</samp>](https://github.com/142vip/JavaScriptCollection/commit/cf3f012)
- 修复`Docker`构建`OOM`异常,使用增加`OOM`限制的`node:20.17.0-alpine`基础镜像 &nbsp;-&nbsp; by **chufan** [<samp>(d78e0)</samp>](https://github.com/142vip/JavaScriptCollection/commit/d78e081)

### 📖 Documentation

- Update README &nbsp;-&nbsp; by **chufan** [<samp>(91c7c)</samp>](https://github.com/142vip/JavaScriptCollection/commit/91c7ce6)

**Release New Version v0.0.2-alpha.22 [👉 View Changes On GitHub](https://github.com/142vip/JavaScriptCollection/compare/v0.0.2-alpha.21...v0.0.2-alpha.22)**

## v0.0.2-alpha.21 (2024-10-16)

### ✨ Features
Expand Down
22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,36 @@
# CONTAINER_BUILD: 采用容器构建
#

FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:20.17.0-alpine AS build_base
FROM registry.cn-hangzhou.aliyuncs.com/142vip-infra/node:25.9.0-base AS build_base

# 是否配置代理
ARG NEED_PROXY=false
ARG NEED_PROXY

## 设置环境变量,支持容器构建时使用layer缓存,参考:https://pnpm.io/zh/docker
ENV NODE_OPTIONS="--max-old-space-size=200000"
# 设置环境变量,支持容器构建时使用layer缓存,参考:https://pnpm.io/zh/docker
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

## corepack 环境变量,在CI脚本中直接设置
#ENV COREPACK_NPM_REGISTRY=https://mirrors.tencent.com/npm/

WORKDIR /apps
COPY . .

## 安装git,博客编译需要使用git信息
RUN apk add --no-cache git --repository http://mirrors.aliyun.com/alpine/v3.14/main/
COPY . .

## 基于容器自动构建
RUN --mount=type=cache,id=pnpm,target=/pnpm/store sh ./scripts/ci && \
# 基于容器自动构建
RUN --mount=type=cache,id=pnpm,target=/pnpm/store sh ./scripts/ci --ignore-scripts && \
if [ "$NEED_PROXY" = "false" ]; \
then \
pnpm build; \
else \
pnpm build:proxy; \
fi;

# 构建linux镜像
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.29.0-alpine

FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine


## 自定义镜像的Label信息
# 自定义镜像的Label信息
ARG APP_NAME
ARG APP_VERSION
ARG APP_DESCRIPTION
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<img
alt="JavaScriptCollection"
src="https://cdn.statically.io/gh/142vip/cdn_service@main/doc_book/jsc/jsc_logo.png"
src="https://cdn.statically.io/gh/142vip/cdn_service@main/apps/jsc/logo-jsc.png"
style="text-align: center;border-radius: 5px"
>
<p style="font-size: 20px">
Expand All @@ -20,7 +20,7 @@
<img alt="Netlify" src="https://api.netlify.com/api/v1/badges/75a7251a-f873-4aff-b387-6449ca241ef7/deploy-status">
</a>
<a href="https://js-collection.vercel.app" target="_blank" style="padding: 5px">
<img alt="Vercel" src="https://therealsujitk-vercel-badge.vercel.app/?app=408">
<img src="https://deploy-badge.vercel.app/vercel/js-collection" alt="JavaScriptCollection Deploy"></img>
</a>
</div>
<div >
Expand Down Expand Up @@ -530,7 +530,7 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的

<div style="text-align: center;margin: 10px" id="we-media-container">
<div align="center" >
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/media/main-code.png"
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/apps/media/wechat/main-code.png"
width="auto"
style="margin:5px;border-radius: 5px"
title="关注微信公众号或添加好友联系储凡" alt="关注微信公众号或添加好友联系储凡"/>
Expand All @@ -542,7 +542,7 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的
target="_blank"
title="点击跳转Github主页"
>
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/main-vip/svg/github.svg" alt="CSDN" title="CSDN"
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/apps/media/svg/github.svg" alt="CSDN" title="CSDN"
style="margin: 5px;width: 24px;height: 24px;">
</a>
<a
Expand All @@ -551,7 +551,7 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的
target="_blank"
title="点击跳转码云主页"
>
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/main-vip/svg/gitee.svg" alt="Gitee" title="Gitee"
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/apps/media/svg/gitee.svg" alt="Gitee" title="Gitee"
style="margin: 5px;width: 24px;height: 24px;">
</a>
<a
Expand All @@ -560,7 +560,7 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的
target="_blank"
title="点击跳转掘金主页"
>
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/main-vip/svg/juejin.svg" alt="掘金"
<img src="https://cdn.statically.io/gh/142vip/cdn_service@main/apps/media/svg/juejin.svg" alt="掘金"
style="margin: 5px;width: 24px;height: 24px;">
</a>
<a
Expand All @@ -570,7 +570,7 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的
title="点击跳转B站主页"
>
<img
src="https://cdn.statically.io/gh/142vip/cdn_service@main/main-vip/svg/bilibili.svg"
src="https://cdn.statically.io/gh/142vip/cdn_service@main/apps/media/svg/bilibili.svg"
alt="Bilibili"
style="margin: 5px;width: 24px;height: 24px;">
</a>
Expand All @@ -581,7 +581,7 @@ Nuxt.js是在vue框架上进行封装的,主要是用来解决单体页面的
title="点击跳转CSDN博客主页"
>
<img
src="https://cdn.statically.io/gh/142vip/cdn_service@main/main-vip/svg/csdn.svg"
src="https://cdn.statically.io/gh/142vip/cdn_service@main/apps/media/svg/csdn.svg"
title="点击跳转CSDN博客主页" alt="CSDN"
style="margin: 5px;width: 24px;height: 24px;"
>
Expand Down
2 changes: 0 additions & 2 deletions code/algorithm/debounce.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* 防抖
* @param func
* @param time
*/
function debounce(func, time) {
let timeout
Expand Down
25 changes: 9 additions & 16 deletions code/algorithm/deepClone.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
/**
* 判断数据类型
*/
function checkType(target) {
// typeof -instanceof -toString.call() -Array.isArray()
return Object.prototype.toString.call(target).slice(8, -1)
}
/**
* 基于Json序列化的深拷贝【不能处理函数】
* @param target
*/
function DeepCloneByJSON(target) {
export function DeepCloneByJSON(target) {
return JSON.parse(JSON.stringify(target))
}

/**
* 基于递归思想的深拷贝
*/
function DeepClone(target) {
export function DeepClone(target) {
let result
const targetType = checkType(target)
if (targetType === 'object') {
Expand All @@ -29,16 +35,3 @@ function DeepClone(target) {
}
return result
}

/**
* 判断数据类型
* @param target
*/
function checkType(target) {
// typeof -instanceof -toString.call() -Array.isArray()
return Object.prototype.toString.call(target).slice(8, -1)
}

// 深拷贝
console.log(DeepCloneByJSON)
console.log(DeepClone)
32 changes: 0 additions & 32 deletions code/algorithm/front-end-ts/add.js

This file was deleted.

3 changes: 2 additions & 1 deletion code/algorithm/front-end-ts/count.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* 计数
* @param str
*/
function count(str: string) {
// 转换为数组后去重
Expand All @@ -22,3 +21,5 @@ function count(str: string) {
}
return result
}

count('12321')
Loading
Loading