xhs-mp-compiler-utils 2.0.3 → 2.0.4-beta.1
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
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t,
|
|
1
|
+
"use strict";var t=require("path");var e,o;exports.CompileCallRuntimeMethodsNames=void 0,(e=exports.CompileCallRuntimeMethodsNames||(exports.CompileCallRuntimeMethodsNames={})).ExecExpWithContext="x0",e.CalcClass="x1",e.Rpx2vw="x2",e.RunModuleUpdater="x3",exports.CompileAddedAttrs=void 0,(o=exports.CompileAddedAttrs||(exports.CompileAddedAttrs={})).OwnerId="xhs__i",o.EventMap="xhs__p",o.ComponentIndex="xhs__c",o.ComponentId="xhs__id",o.ComponentOwnerId="xhs__oid",o.MLPath="xhs__mlpath";const s=(t,e)=>{const o=10**(e+1),s=Math.floor(t*o);return 10*Math.round(s/10)/o};const r=/([\d.]+)rpx/g;function p(){var t;return null===(t=process.env.__platform||"xhs")||void 0===t?void 0:t.trim()}function n(){return`${p()}ml`.trim()}const x=(e="")=>e.split(t.sep).join(t.posix.sep);exports.COMPILE_CALL_RUNTIME="$__t",exports.RPX_REGEX=r,exports.calcRpx2Vw=(t,e=750,o=5,r="vw")=>s(parseFloat(`${t}`)/e*100,o)+r,exports.getCssSuffixName=function(){return"xhs"===p()?"css":"wxss"},exports.getMlSuffixName=n,exports.getPlatform=p,exports.getShortPath=(t,e)=>{const o=n();t=(t=x(t)).endsWith("/")?t:`${t}/`;const s=new RegExp(`.${o}$`,"g");return x(e).replace(s,"").replace(t,"")},exports.isRpxValue=t=>!(!t||!(null==t?void 0:t.match(r))||(null==t?void 0:t.startsWith("'"))||(null==t?void 0:t.startsWith('"'))||(null==t?void 0:t.startsWith("url"))),exports.rpx2vwll=function(t){return t.replace(/([\d.]+)rpx/g,((t,e)=>`${s(e/750*100,5)}vw`))},exports.toFixed=s,exports.toUnixPath=x,exports.unixJoin=(...e)=>x(t.join(...e)),exports.unixResolve=(...e)=>x(t.resolve(...e));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const toUnixPath: (pathStr?: string) => string;
|
|
2
|
+
export declare const unixJoin: (...paths: string[]) => string;
|
|
3
|
+
export declare const unixResolve: (...paths: string[]) => string;
|
|
4
|
+
export declare const getShortPath: (miniprogramDir: string, rootContext: string) => string;
|
package/package.json
CHANGED
|
File without changes
|