🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@baiwusanyu/utils-normalize

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@baiwusanyu/utils-normalize

## Function

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
661
22.41%
Maintainers
1
Weekly downloads
 
Created
Source

@baiwusanyu/utils-normalize

Function

normalizePath

统一化路径,抹平win与 mac、linux 路径差异

参数参数类型默认值说明
pathstring-需要统一的路径
返回值返回类型说明
resstring统一化路径

normalizeEllipsis

统一化文本过长,缩略展示

参数参数类型默认值说明
strstring""需要统一的路径
limitLennumber24限制的文本字符数量,超过的部分会被省略显示
返回值返回类型说明
resstring缩略展示结果

normalizeSizeUnits

统一化存储单位,字节转化为英文缩写bytes, KB, MB, GB

参数参数类型默认值说明
bytesnumber-需要转换的字节大小
返回值返回类型说明
resstring转化后的字节字符串

normalizeNum2Comma

统一化数字,将数字转化为逗号分隔的字符串

参数参数类型默认值说明
numnumber-需要转换的数字
decimalnumber6转换精度
返回值返回类型说明
resstring转化后的数字字符串

normalizeVarStrEmpty

将虚值或字符串 'undefined''null' 转化为空字符串

参数参数类型默认值说明
strstring-需要转换的字符串
返回值返回类型说明
resstring返回空字符串 ''

Keywords

typescript

FAQs

Package last updated on 12 Dec 2024

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