mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-26 03:26:41 +08:00
2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
function d(e,t){const n=Object.create(null),s=e.split(",");for(let o=0;o<s.length;o++)n[s[o]]=!0;return t?o=>!!n[o.toLowerCase()]:o=>!!n[o]}const F={},K=[],L=()=>{},k=()=>!1,E=/^on[^a-z]/,H=e=>E.test(e),$=e=>e.startsWith("onUpdate:"),G=Object.assign,J=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},T=Object.prototype.hasOwnProperty,q=(e,t)=>T.call(e,t),c=Array.isArray,w=e=>a(e)==="[object Map]",I=e=>a(e)==="[object Set]",h=e=>a(e)==="[object Date]",W=e=>a(e)==="[object RegExp]",p=e=>typeof e=="function",r=e=>typeof e=="string",O=e=>typeof e=="symbol",i=e=>e!==null&&typeof e=="object",Y=e=>i(e)&&p(e.then)&&p(e.catch),S=Object.prototype.toString,a=e=>S.call(e),Z=e=>a(e).slice(8,-1),A=e=>a(e)==="[object Object]",Q=e=>r(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,X=d(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),u=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},C=/-(\w)/g,v=u(e=>e.replace(C,(t,n)=>n?n.toUpperCase():"")),P=/\B([A-Z])/g,ee=u(e=>e.replace(P,"-$1").toLowerCase()),z=u(e=>e.charAt(0).toUpperCase()+e.slice(1)),te=u(e=>e?`on${z(e)}`:""),ne=(e,t)=>!Object.is(e,t),se=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},oe=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},re=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ie=e=>{const t=r(e)?Number(e):NaN;return isNaN(t)?e:t};let b;const ce=()=>b||(b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),B="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console",ae=d(B);function j(e){if(c(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=r(s)?x(s):j(s);if(o)for(const l in o)t[l]=o[l]}return t}else{if(r(e))return e;if(i(e))return e}}const M=/;(?![^(]*\))/g,U=/:([^]+)/,_=/\/\*[^]*?\*\//g;function x(e){const t={};return e.replace(_,"").split(M).forEach(n=>{if(n){const s=n.split(U);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function N(e){let t="";if(r(e))t=e;else if(c(e))for(let n=0;n<e.length;n++){const s=N(e[n]);s&&(t+=s+" ")}else if(i(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function le(e){if(!e)return null;let{class:t,style:n}=e;return t&&!r(t)&&(e.class=N(t)),n&&(e.style=j(n)),e}const D="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",fe=d(D);function ue(e){return!!e||e===""}function V(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=y(e[s],t[s]);return n}function y(e,t){if(e===t)return!0;let n=h(e),s=h(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=O(e),s=O(t),n||s)return e===t;if(n=c(e),s=c(t),n||s)return n&&s?V(e,t):!1;if(n=i(e),s=i(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,l=Object.keys(t).length;if(o!==l)return!1;for(const f in e){const g=e.hasOwnProperty(f),m=t.hasOwnProperty(f);if(g&&!m||!g&&m||!y(e[f],t[f]))return!1}}return String(e)===String(t)}function pe(e,t){return e.findIndex(n=>y(n,t))}const de=e=>r(e)?e:e==null?"":c(e)||i(e)&&(e.toString===S||!p(e.toString))?JSON.stringify(e,R,2):String(e),R=(e,t)=>t&&t.__v_isRef?R(e,t.value):w(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o])=>(n[`${s} =>`]=o,n),{})}:I(t)?{[`Set(${t.size})`]:[...t.values()]}:i(t)&&!c(t)&&!A(t)?String(t):t;export{v as A,ee as B,z as C,k as D,F as E,$ as F,ie as G,W as H,ae as I,fe as J,ue as K,pe as L,y as M,L as N,le as O,de as P,i as a,p as b,c,q as d,Q as e,oe as f,w as g,ne as h,O as i,G as j,r as k,j as l,d as m,N as n,H as o,ce as p,I as q,J as r,A as s,Z as t,Y as u,K as v,X as w,se as x,re as y,te as z};
|