New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@pky/fe-utils

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pky/fe-utils

fe utils and React hooks.

latest
Source
npmnpm
Version
0.2.4
Version published
Maintainers
1
Created
Source

fe-utils

Typescript 实现的前端常用工具库,持续更新

使用

npm i -S @pky/fe-utils

JS 相关

文件名使用
deep-copy深拷贝
delay延迟
flatten数组扁平化
for-each同 Array.prototype.forEach
get-ext获取 string 或 FileLike 对象后缀名
hex-to-rgb#fff 转 rgb(255,255,255)
keys同 Object.keys,正确 key 类型
many数组包裹
map同 Array.prototype.map
mime-to-extmime 类型转后缀名
remove删除元素或根据规则函数删除
separate根据规则函数把数组中元素分成两个数组
sort-by根据规则函数排序
swap交换数组中两个元素
type-oftoString 类型判断
debounce防抖
throttle节流
event-emitter发布订阅

浏览器环境

文件名使用
url-to-bloburl 转 blob 对象,支持 dataUrl 和 blobUrl
load-image加载图片
parse-url-query解析 url 的 query
resize-watch监听元素尺寸变化,基于 ResizeObserver
select-file选择文件

判断类

文件名使用
is-array-like是否类数组
is-data-url是否 data url,data 协议
is-empty是否空值,支持所有类型
is-file-like是否类文件对象
is-image是否图片,支持 FileLike 和 string
is-object-url是否 object url,blob 协议
is-prototype是否原型对象

Keywords

typescript

FAQs

Package last updated on 20 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts