minutool 1.0.4 → 1.0.5
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 +4 -2
- package/dist/minutool.js +1 -1
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +1 -1
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -158,11 +158,13 @@ export declare const BLOCK_TAGS: string[];
|
|
|
158
158
|
export declare const buildHtmlHidden: (maps: Record<string, any>) => string;
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
|
-
* 构建 CSS
|
|
161
|
+
* 构建 CSS 变量对象
|
|
162
162
|
* @param {Record<string, number|string|undefined>} vars - CSS 变量对象
|
|
163
163
|
* @returns {Record<string, string>} 返回格式化后的 CSS 变量对象
|
|
164
164
|
* @example
|
|
165
|
-
* buildStyleVars({width:
|
|
165
|
+
* buildStyleVars({width: '100px', color: 'red', text:'"hello"'})
|
|
166
|
+
* 输出 // {'--width': '100px', '--color': 'red', '--text': '"hello"'}
|
|
167
|
+
* 实际样式:style="--width: 100px; --color: red; --text: \"hello\";"
|
|
166
168
|
*/
|
|
167
169
|
export declare const buildStyleVars: (vars: Record<string, number | string | undefined>) => Record<string, string>;
|
|
168
170
|
|
package/dist/minutool.js
CHANGED
|
@@ -378,7 +378,7 @@ g(t.top + t.height, e.top, e.top + e.height) && g(t.left + t.width, e.left, e.le
|
|
|
378
378
|
let e = {};
|
|
379
379
|
for (let n in t) {
|
|
380
380
|
const i = t[n];
|
|
381
|
-
i
|
|
381
|
+
i != null && (e[`--${n}`] = `${i}`);
|
|
382
382
|
}
|
|
383
383
|
return e;
|
|
384
384
|
}, Ve = (t) => t.replace(/[\\/:*?"<>|]/g, "_").replace(/[\0-\x1F]/g, "_").replace(/\s+/g, " ").replace(/^\.+/, "").replace(/\.+$/, "").trim(), I = (t) => new Promise((e, n) => {
|