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 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 变量对象(自动添加 -- 前缀和 px 单位)
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: 100, color: 'red'}) // {'--width': '100px', '--color': 'red'}
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 !== void 0 && (e[`--${n}`] = `${i}` + (typeof i == "number" ? "px" : ""));
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) => {