Skip to content

Commit 3ad1f97

Browse files
committed
chore: update
1 parent ee21514 commit 3ad1f97

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
<a href="https://www.npmjs.com/package/simon-js-tool"><img src="https://img.shields.io/npm/dm/simon-js-tool?style=social" alt="NPM version"></a>
88
<a href="https://github.com/Simon-He95/simon-js-tool"><img src="https://img.shields.io/github/stars/Simon-He95/simon-js-tool?style=social" alt="NPM version"></a>
99
</p>
10-
<p align="center"><a href="http://vitepress.hejian.club/">Docs</a></p>
10+
<p align="center"><a href="http://vitepress.hejian.club/">文档</a></p>
1111
<p align="center"> <a href="./README_en.md">English</a> | 简体中文</p>
1212

1313
## 此文是介绍封装的工具函数的文档[simon-js-tool](https://www.npmjs.com/package/simon-js-tool)
14-
目前整理了<strong>90+</strong>的常用函数,还在持续更新中...,你的认可是对我最大的鼓励! :hearts:
14+
目前整理了<strong>100+</strong>的常用函数,还在持续更新中...,你的认可是对我最大的鼓励! :hearts:
15+
1516

1617
## 🔥 亮点
1718
- 纯js的工具函数,不依赖vue,react,angular

README_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<p align="center"> English | <a href="./README.md">简体中文</a></p>
1212

1313
## This article is documentation that describes the encapsulated utility functions [simon-js-tool](https://www.npmjs.com/package/simon-js-tool)
14-
At present, I have sorted out <strong>90+</strong> commonly used functions, and I am still updating..., and your recognition is the biggest encouragement to me! :hearts:
14+
At present, I have sorted out <strong>100+</strong> commonly used functions, and I am still updating..., and your recognition is the biggest encouragement to me! :hearts:
1515

1616
## 🔥 Highlights
1717
- Pure js tool functions, not dependent on vue, react, angular

src/collisionDetection.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { isStr } from './isStr'
2+
13
export function collisionDetection(o1: string | HTMLElement, o2: string | HTMLElement) {
2-
const obj1: HTMLElement = typeof o1 === 'string' ? document.querySelector(o1)! : o1
3-
const obj2: HTMLElement = typeof o2 === 'string' ? document.querySelector(o2)! : o2
4+
const obj1: HTMLElement = isStr(o1) ? document.querySelector(o1)! : o1
5+
const obj2: HTMLElement = isStr(o2) ? document.querySelector(o2)! : o2
46
if (!obj1 || !obj2)
57
return
68
const left1_start = obj1.offsetLeft

0 commit comments

Comments
 (0)