Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beisen/common-func

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beisen/common-func - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

8

lib/index.js

@@ -34,4 +34,8 @@ 'use strict';

var parNode = dom_1.parentNode;
parNode.removeChild(dom_1);
parNode.removeChild(dom_2);
if (parNode.parentNode && parNode.parentNode.className == 'tooltip__hidden') {
parNode.parentNode.removeChild(parNode);
} else {
parNode.removeChild(dom_1);
parNode.removeChild(dom_2);
}
}

@@ -38,0 +42,0 @@ }

{
"name": "@beisen\/common-func",
"version": "0.0.13",
"version": "0.0.14",
"description": "CommonFunc",

@@ -5,0 +5,0 @@ "main": "lib\/index.js",

@@ -14,26 +14,18 @@ # common-func 使用说明

```
1. clearToolTipDom() //清除tooltip,防止某些情况下tooltip未被清除
2. uid(flag) //生成 标识符+时间
- `clearToolTipDom()` 清除tooltip,防止某些情况下tooltip未被清除
- `uid(flag)` 生成 标识符+时间毫秒数
- `judgeBrowser()` 获取当前浏览器名称
- `judgeSys()` 获取当前系统名称
- `contains(root, n)` 判断n元素是否是root中的子元素
- `addResizeListener(element, fn)` 监听element变化
- `removeResizeListener(element, fn)` 移除监听
- `createDom(id)` 在body上追加一个id为xx的div节点
- `getHeightLight(searchval, text)` 筛选关键字,例: `searchval:"测试", text:"通用测试样例"`,返回值中 "测试" 会被`<em>`标签包裹
- `deepClone(data)` 深克隆
- `transferData(data)` 将扁平结构数据转化为树形结构,例: [{id:1,pid:0},{id:2,pid:1}] => [{id:1,pid:0,li:[{id:2,pid:1}]}]
- `encode(str)` 把正常字符串编码成HTML格式
- `decode(str)` 把HTML格式字符串编码成正常字符串
3. judgeBrowser() //获取当前浏览器版本
4. judgeSys() //获取当前系统版本
5. contains(root, n) //判断n 元素是否是 root中的子元素
6. addResizeListener(element, fn) //监听element变化
7. removeResizeListener(element, fn) //移除监听
8. createDom(id) //在body上创建id为xx的节点
9. getHeightLight(searchval, text) //筛选关键字,例: searchval:"测试", text:"通用测试样例",返回值中 "测试" 会被<em>标签包裹
10. deepClone(data) //深克隆
11. transferData(data) //将扁平结构数据转化为树形结构,例: [{id:1,pid:0},{id:2,pid:1}] => [{id:1,pid:0,li:[{id:2,pid:1}]}]
```
## common-func调用方法

@@ -49,5 +41,5 @@

```
```javascript
import {clearToolTipDom, xx} from "@beisen/common-func"
```
```

@@ -9,4 +9,8 @@ /* eslint-disable */

let parNode = dom_1.parentNode;
parNode.removeChild(dom_1);
parNode.removeChild(dom_2);
if(parNode.parentNode && parNode.parentNode.className == 'tooltip__hidden'){
parNode.parentNode.removeChild(parNode)
} else {
parNode.removeChild(dom_1);
parNode.removeChild(dom_2);
}
}

@@ -13,0 +17,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc