@untemps/utils 4.0.0-beta.14 → 4.0.0-beta.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t=!1)=>{if(e&&(e=e.startsWith(`.`)?e:`.${e}`,document.styleSheets?.length))for(let n of document.styleSheets)for(let
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t=!1)=>{if(e&&(e=e.startsWith(`.`)?e:`.${e}`,document.styleSheets?.length))for(let n of document.styleSheets){let r;try{r=n.cssRules}catch{continue}for(let n of r){let r=n;if(r.selectorText===e&&r.style)return t?r.style.cssText:r.style}}return null};exports.getCSSDeclaration=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCSSDeclaration.d.ts","sourceRoot":"","sources":["../../src/dom/getCSSDeclaration.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,EAAE,oBAAkB,KAAG,mBAAmB,GAAG,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"getCSSDeclaration.d.ts","sourceRoot":"","sources":["../../src/dom/getCSSDeclaration.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,EAAE,oBAAkB,KAAG,mBAAmB,GAAG,MAAM,GAAG,IAsBxG,CAAA"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
//#region src/dom/getCSSDeclaration.ts
|
|
2
2
|
var e = (e, t = !1) => {
|
|
3
|
-
if (e && (e = e.startsWith(".") ? e : `.${e}`, document.styleSheets?.length)) for (let n of document.styleSheets)
|
|
4
|
-
let
|
|
5
|
-
|
|
3
|
+
if (e && (e = e.startsWith(".") ? e : `.${e}`, document.styleSheets?.length)) for (let n of document.styleSheets) {
|
|
4
|
+
let r;
|
|
5
|
+
try {
|
|
6
|
+
r = n.cssRules;
|
|
7
|
+
} catch {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
for (let n of r) {
|
|
11
|
+
let r = n;
|
|
12
|
+
if (r.selectorText === e && r.style) return t ? r.style.cssText : r.style;
|
|
13
|
+
}
|
|
6
14
|
}
|
|
7
15
|
return null;
|
|
8
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../lang/isNil.cjs`);var t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=e=>Object.keys(e).map(t).join(`|`),r=(r,i={},a=`%`)=>{let o=t(a),s=n(i),c=RegExp(`${o}(${s})${o}`,`g`);return r.replace(c,(t,n)=>e.isNil(i[n])?n:String(i[n]))};exports.interpolate=r;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../lang/isNil.cjs`);var t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=e=>Object.keys(e).map(t).join(`|`),r=(r,i={},a=`%`)=>{let o=t(a),s=n(i),c=s?RegExp(`${o}(${s})${o}`,`g`):/(?!)/g;return r.replace(c,(t,n)=>e.isNil(i[n])?n:String(i[n]))};exports.interpolate=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../src/string/interpolate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAAE,gBAAa,KAAG,
|
|
1
|
+
{"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../src/string/interpolate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAAE,gBAAa,KAAG,MAMhG,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isNil as e } from "../lang/isNil.js";
|
|
2
2
|
//#region src/string/interpolate.ts
|
|
3
3
|
var t = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = (e) => Object.keys(e).map(t).join("|"), r = (r, i = {}, a = "%") => {
|
|
4
|
-
let o = t(a), s = n(i), c = RegExp(`${o}(${s})${o}`, "g");
|
|
4
|
+
let o = t(a), s = n(i), c = s ? RegExp(`${o}(${s})${o}`, "g") : /(?!)/g;
|
|
5
5
|
return r.replace(c, (t, n) => e(i[n]) ? n : String(i[n]));
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|