Skip to main content

utils

Home > @nipem/utils

utils package

Functions

FunctionDescription
copy(input, { target })复制字符串到剪贴板 必须响应用户手势事件调用,例如“click”或“keyup”。
parseMilliseconds(milliseconds)将毫秒转换成对象
prettyBytes(number, options)Convert bytes to a human readable string: 13371.34 kB.
prettyMilliseconds(milliseconds, keepMilliseconds)将毫秒格式化成 n天n小时n分钟n秒[n毫秒]
second2str(seconds)秒转换成 n天n小时n分钟n秒
slice2star(string, begin, end)提取字符串的一部分替换成 * 号,且不会改动原字符串
toThousand(n, digits)format a number to thousand points

Namespaces

NamespaceDescription
CopySpecify a DOM element where the temporary, behind-the-scenes textarea should be appended, in cases where you need to stay within a focus trap, like in a modal.
PrettyBytes

Variables

VariableDescription
parseMSparseMilliseconds 的别名
prettyMSprettyMilliseconds 的别名

Type Aliases

Type AliasDescription
TimeComponents