dozy 1.0.63 → 1.0.64
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 -3
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,8 @@ declare class Dozy {
|
|
|
20
20
|
declare const dozy: Dozy;
|
|
21
21
|
|
|
22
22
|
type Any = Items<any>;
|
|
23
|
-
type Null = undefined | null;
|
|
23
|
+
type Null = undefined | null | void;
|
|
24
|
+
declare function isNull<T>(v: T | Null): v is Null;
|
|
24
25
|
type Nullable<T> = T | Null;
|
|
25
26
|
type Items<T> = {
|
|
26
27
|
[x: string]: T;
|
|
@@ -87,6 +88,42 @@ declare function errArg(): void;
|
|
|
87
88
|
declare function errNotLoggedIn(): void;
|
|
88
89
|
declare function err403(): void;
|
|
89
90
|
declare function isNowAroundUtcHour(targetHour: number): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* 清洗 base64 输入,统一得到“纯 base64”(不含 data URL 前缀)。
|
|
93
|
+
*
|
|
94
|
+
* 说明:
|
|
95
|
+
* - 会移除 `data:*;base64,` 前缀。
|
|
96
|
+
* - 会移除所有空白字符并 trim。
|
|
97
|
+
* - 非字符串输入会返回空字符串。
|
|
98
|
+
*
|
|
99
|
+
* 返回值约定:
|
|
100
|
+
* - 一定返回 `string`(不会返回 null/undefined)。
|
|
101
|
+
*/
|
|
102
|
+
declare function $purifyBase64(input: string | null | undefined): string;
|
|
103
|
+
/**
|
|
104
|
+
* 基于“纯 base64”推断图片 mime 类型。
|
|
105
|
+
*
|
|
106
|
+
* 说明:
|
|
107
|
+
* - 自动支持:jpeg/png/gif/webp/bmp/tiff/avif/heic/x-icon。
|
|
108
|
+
* - 输入可为纯 base64 或 data URL,内部会先清洗。
|
|
109
|
+
* - 无法识别时回退为 `image/png`。
|
|
110
|
+
*
|
|
111
|
+
* 返回值约定:
|
|
112
|
+
* - 一定返回非空 mime 字符串(不会返回 null/undefined/空串)。
|
|
113
|
+
*/
|
|
114
|
+
declare function $inferMimeTypeFormPureBase64(pureBase64: string | null | undefined): "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/bmp" | "image/tiff" | "image/avif" | "image/heic" | "image/x-icon";
|
|
115
|
+
/**
|
|
116
|
+
* 将“纯 base64 或 data URL”统一转成标准 data URL。
|
|
117
|
+
*
|
|
118
|
+
* 说明:
|
|
119
|
+
* - 如果输入本来是 data URL,会清洗并标准化后返回。
|
|
120
|
+
* - 如果输入是纯 base64,会自动推断 mime 并补齐 `data:*;base64,` 前缀。
|
|
121
|
+
* - 非字符串或空字符串输入返回空字符串。
|
|
122
|
+
*
|
|
123
|
+
* 返回值约定:
|
|
124
|
+
* - 一定返回 `string`(不会返回 null/undefined)。
|
|
125
|
+
*/
|
|
126
|
+
declare function $toDataUrlFromBase64(base64WithDataOrPure: string | null | undefined): string;
|
|
90
127
|
|
|
91
128
|
declare function web$setPathTarget(s: string): void;
|
|
92
129
|
declare function web$pathStartData(): {
|
|
@@ -333,6 +370,6 @@ declare function toRgbString(input: string | Color | any): string | undefined;
|
|
|
333
370
|
*/
|
|
334
371
|
declare function toHslString(input: string | Color | any): string | undefined;
|
|
335
372
|
|
|
336
|
-
declare const DOZY = "1.0.
|
|
373
|
+
declare const DOZY = "1.0.64";
|
|
337
374
|
|
|
338
|
-
export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatWithCommas, $freeze, $genSSF, $getFileType, $getTimeString, $hasKey, $if, $inRange, $inRange2, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $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, type ScaleComputer, type ScaleIniter, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isValidColor, maybeString, registerCustomColor, s, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };
|
|
375
|
+
export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatWithCommas, $freeze, $genSSF, $getFileType, $getTimeString, $hasKey, $if, $inRange, $inRange2, $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, type ScaleComputer, type ScaleIniter, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, isValidColor, maybeString, registerCustomColor, s, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };
|