dozy 1.0.96 → 1.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +40 -2
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -498,6 +498,44 @@ declare function $formatPoints(points?: number, bits?: number): string;
|
|
|
498
498
|
* $formatPointsWithChange(0, 2) // 返回 ["0.00", "#333"]
|
|
499
499
|
*/
|
|
500
500
|
declare function $formatPointsWithChange(points?: number, bits?: number): [display: string, color: string];
|
|
501
|
+
/**
|
|
502
|
+
* 字节数语义化显示,格式与 npm `pretty-bytes` 库一致(1000 进制)。
|
|
503
|
+
*
|
|
504
|
+
* 行为说明:
|
|
505
|
+
* - 0 / NaN / undefined 返回 `'0 B'`。
|
|
506
|
+
* - 负数与官方一致:记录符号 → 取绝对值计算 → 前缀拼回 `'-'`。
|
|
507
|
+
* - 保留 3 位有效数字,单位前后有空格。
|
|
508
|
+
*
|
|
509
|
+
* @param n 字节数。
|
|
510
|
+
* @returns 返回语义化字符串。
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* $humanizeBytes(0) // 返回 "0 B"
|
|
514
|
+
* $humanizeBytes(1234) // 返回 "1.23 kB"
|
|
515
|
+
* $humanizeBytes(12345678) // 返回 "12.3 MB"
|
|
516
|
+
* $humanizeBytes(1500000000) // 返回 "1.5 GB"
|
|
517
|
+
* $humanizeBytes(-1234) // 返回 "-1.23 kB"
|
|
518
|
+
*/
|
|
519
|
+
declare function $humanizeBytes(n?: number): string;
|
|
520
|
+
/**
|
|
521
|
+
* 以 k 为单位、保留 1 位小数;整数部分每 3 位加英文逗号。
|
|
522
|
+
*
|
|
523
|
+
* 行为说明:
|
|
524
|
+
* - NaN / undefined 当作 0 处理。
|
|
525
|
+
* - 负数:记录符号 → 取绝对值计算 → 前缀拼回 `'-'`。
|
|
526
|
+
* - 小数四舍五入到 1 位,进位到 10 时整数部分 +1、小数归零。
|
|
527
|
+
*
|
|
528
|
+
* @param n 待格式化的整数。
|
|
529
|
+
* @returns 返回语义化字符串。
|
|
530
|
+
*
|
|
531
|
+
* @example
|
|
532
|
+
* $formatK(0) // 返回 "0.0k"
|
|
533
|
+
* $formatK(999) // 返回 "1.0k"
|
|
534
|
+
* $formatK(12345) // 返回 "12.3k"
|
|
535
|
+
* $formatK(1234567) // 返回 "1,234.6k"
|
|
536
|
+
* $formatK(-12345) // 返回 "-12.3k"
|
|
537
|
+
*/
|
|
538
|
+
declare function $formatK(n?: number): string;
|
|
501
539
|
/**
|
|
502
540
|
* 将错误转换成一个始终包含 `msg` 字段的对象。
|
|
503
541
|
*
|
|
@@ -1423,6 +1461,6 @@ declare function toRgbString(input: string | Color | any): string | undefined;
|
|
|
1423
1461
|
*/
|
|
1424
1462
|
declare function toHslString(input: string | Color | any): string | undefined;
|
|
1425
1463
|
|
|
1426
|
-
declare const DOZY = "1.0.
|
|
1464
|
+
declare const DOZY = "1.0.97";
|
|
1427
1465
|
|
|
1428
|
-
export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $backgroundColor, $borderColor, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $compressImageBase64, $compressImageDefaultOptions, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $ensureUrl, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatPoints, $formatPointsWithChange, $formatWithCommas, $freeze, $genSSF, $getFileType, $getHue, $getTimeString, $hasKey, $if, $inRange, $inRange2, $inferExtensionFormPureBase64, $inferMimeTypeFormPureBase64, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $purifyBase64, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $toDataUrlFromBase64, $validName, $values, $window, type Any, type Atoa, type Coord, type Coord3, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Hel, type IOpt, type Items, type Null, type Nullable, RainbowGen, RepoStore, type ScaleComputer, type ScaleIniter, type ScaleResponsiveOptions, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, isValidColor, maybeString, registerCustomColor, s, shanghaiDateFormatter, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };
|
|
1466
|
+
export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $backgroundColor, $borderColor, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $compressImageBase64, $compressImageDefaultOptions, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $ensureUrl, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatK, $formatPoints, $formatPointsWithChange, $formatWithCommas, $freeze, $genSSF, $getFileType, $getHue, $getTimeString, $hasKey, $humanizeBytes, $if, $inRange, $inRange2, $inferExtensionFormPureBase64, $inferMimeTypeFormPureBase64, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $purifyBase64, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $toDataUrlFromBase64, $validName, $values, $window, type Any, type Atoa, type Coord, type Coord3, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Hel, type IOpt, type Items, type Null, type Nullable, RainbowGen, RepoStore, type ScaleComputer, type ScaleIniter, type ScaleResponsiveOptions, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, isValidColor, maybeString, registerCustomColor, s, shanghaiDateFormatter, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };
|