mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
chore: update frontend build for v1.1.84 [skip ci]
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
*.log
|
||||
.DS_Store
|
||||
.env
|
||||
@@ -6,5 +6,5 @@ This branch contains the pre-built frontend assets for Claude Relay Service.
|
||||
|
||||
These files are automatically generated by the CI/CD pipeline.
|
||||
|
||||
Version: 1.1.83
|
||||
Build Date: 2025-08-06 02:30:40 UTC
|
||||
Version: 1.1.84
|
||||
Build Date: 2025-08-06 05:51:23 UTC
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
.loading-spinner[data-v-2c7d7fea]{width:24px;height:24px;border:2px solid #e5e7eb;border-top:2px solid #3b82f6;border-radius:50%;animation:spin-2c7d7fea 1s linear infinite}@keyframes spin-2c7d7fea{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.accounts-container[data-v-2c7d7fea]{min-height:calc(100vh - 300px)}.table-container[data-v-2c7d7fea]{overflow-x:auto;border-radius:12px;border:1px solid rgba(0,0,0,.05)}.table-row[data-v-2c7d7fea]{transition:all .2s ease}.table-row[data-v-2c7d7fea]:hover{background-color:#00000005}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.custom-scrollbar[data-v-8e1e3115]{scrollbar-width:thin;scrollbar-color:#cbd5e0 #f7fafc}.custom-scrollbar[data-v-8e1e3115]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-8e1e3115]::-webkit-scrollbar-track{background:#f7fafc}.custom-scrollbar[data-v-8e1e3115]::-webkit-scrollbar-thumb{background-color:#cbd5e0;border-radius:3px}.custom-scrollbar[data-v-8e1e3115]::-webkit-scrollbar-thumb:hover{background-color:#a0aec0}pre[data-v-2c02f1f7],pre[data-v-cff10d08]{white-space:pre-wrap;word-wrap:break-word}@keyframes fadeIn-060bf571{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.animate-fadeIn[data-v-060bf571]{animation:fadeIn-060bf571 .2s ease-out}.loading-spinner[data-v-060bf571]{width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top:2px solid white;border-radius:50%;animation:spin-060bf571 .8s linear infinite;display:inline-block}@keyframes spin-060bf571{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tab-content[data-v-a6056fd1]{min-height:calc(100vh - 300px)}.table-container[data-v-a6056fd1]{overflow-x:auto;border-radius:12px;border:1px solid rgba(0,0,0,.05)}.table-row[data-v-a6056fd1]{transition:all .2s ease}.table-row[data-v-a6056fd1]:hover{background-color:#00000005}.loading-spinner[data-v-a6056fd1]{width:24px;height:24px;border:2px solid #e5e7eb;border-top:2px solid #3b82f6;border-radius:50%;animation:spin-a6056fd1 1s linear infinite}@keyframes spin-a6056fd1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.api-key-date-picker[data-v-a6056fd1] .el-input__inner{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.api-key-date-picker[data-v-a6056fd1] .el-input__inner:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.api-key-date-picker[data-v-a6056fd1] .el-range-separator{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.custom-date-picker[data-v-a1b368e2] .el-input__inner{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.custom-date-picker[data-v-a1b368e2] .el-input__inner:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.custom-date-picker[data-v-a1b368e2] .el-input__inner{font-size:13px;padding:0 10px}.custom-date-picker[data-v-a1b368e2] .el-range-separator{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));padding:0 2px}.custom-date-picker[data-v-a1b368e2] .el-range-input{font-size:13px}@keyframes spin-a1b368e2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin[data-v-a1b368e2]{animation:spin-a1b368e2 1s linear infinite}
|
||||
@@ -1 +0,0 @@
|
||||
import{c as x,r as b,q as f,x as a,z as t,L as i,Q as y,u as o,P as d,Y as w,K as u,aq as c,O as p,y as n}from"./vue-vendor-CKToUHZx.js";import{_,u as v}from"./index-D-2UnWMj.js";/* empty css */import"./element-plus-B8Fs_0jW.js";import"./vendor-BDiMbLwQ.js";const h={class:"flex items-center justify-center min-h-screen p-4 sm:p-6"},k={class:"glass-strong rounded-xl sm:rounded-2xl md:rounded-3xl p-6 sm:p-8 md:p-10 w-full max-w-md shadow-2xl"},L={class:"text-center mb-6 sm:mb-8"},S={class:"w-16 h-16 sm:w-20 sm:h-20 mx-auto mb-4 sm:mb-6 bg-gradient-to-br from-blue-500/20 to-purple-500/20 border border-gray-300/30 rounded-xl sm:rounded-2xl flex items-center justify-center backdrop-blur-sm overflow-hidden"},V=["src"],I={key:1,class:"fas fa-cloud text-2xl sm:text-3xl text-gray-700"},N={key:1,class:"w-10 h-10 sm:w-12 sm:h-12 bg-gray-300/50 rounded animate-pulse"},q={key:0,class:"text-2xl sm:text-3xl font-bold text-white mb-2 header-title"},D={key:1,class:"h-8 sm:h-9 w-48 sm:w-64 bg-gray-300/50 rounded animate-pulse mx-auto mb-2"},E=["disabled"],j={key:0,class:"fas fa-sign-in-alt mr-2"},B={key:1,class:"loading-spinner mr-2"},M={key:0,class:"mt-4 sm:mt-6 p-3 sm:p-4 bg-red-500/20 border border-red-500/30 rounded-lg sm:rounded-xl text-red-800 text-xs sm:text-sm text-center backdrop-blur-sm"},F={__name:"LoginView",setup(O){const e=v(),m=x(()=>e.oemLoading),l=b({username:"",password:""});f(()=>{e.loadOemSettings()});const g=async()=>{await e.login(l.value)};return(T,s)=>(n(),a("div",h,[t("div",k,[t("div",L,[t("div",S,[m.value?(n(),a("div",N)):(n(),a(y,{key:0},[o(e).oemSettings.siteIconData||o(e).oemSettings.siteIcon?(n(),a("img",{key:0,src:o(e).oemSettings.siteIconData||o(e).oemSettings.siteIcon,alt:"Logo",class:"w-10 h-10 sm:w-12 sm:h-12 object-contain",onError:s[0]||(s[0]=r=>r.target.style.display="none")},null,40,V)):(n(),a("i",I))],64))]),!m.value&&o(e).oemSettings.siteName?(n(),a("h1",q,d(o(e).oemSettings.siteName),1)):m.value?(n(),a("div",D)):i("",!0),s[3]||(s[3]=t("p",{class:"text-gray-600 text-base sm:text-lg"}," 管理后台 ",-1))]),t("form",{class:"space-y-4 sm:space-y-6",onSubmit:w(g,["prevent"])},[t("div",null,[s[4]||(s[4]=t("label",{class:"block text-sm font-semibold text-gray-900 mb-2 sm:mb-3"},"用户名",-1)),u(t("input",{"onUpdate:modelValue":s[1]||(s[1]=r=>l.value.username=r),type:"text",required:"",class:"form-input w-full",placeholder:"请输入用户名"},null,512),[[c,l.value.username]])]),t("div",null,[s[5]||(s[5]=t("label",{class:"block text-sm font-semibold text-gray-900 mb-2 sm:mb-3"},"密码",-1)),u(t("input",{"onUpdate:modelValue":s[2]||(s[2]=r=>l.value.password=r),type:"password",required:"",class:"form-input w-full",placeholder:"请输入密码"},null,512),[[c,l.value.password]])]),t("button",{type:"submit",disabled:o(e).loginLoading,class:"btn btn-primary w-full py-3 sm:py-4 px-4 sm:px-6 text-base sm:text-lg font-semibold"},[o(e).loginLoading?i("",!0):(n(),a("i",j)),o(e).loginLoading?(n(),a("div",B)):i("",!0),p(" "+d(o(e).loginLoading?"登录中...":"登录"),1)],8,E)],32),o(e).loginError?(n(),a("div",M,[s[6]||(s[6]=t("i",{class:"fas fa-exclamation-triangle mr-2"},null,-1)),p(d(o(e).loginError),1)])):i("",!0)])]))}},P=_(F,[["__scopeId","data-v-d68c64ae"]]);export{P as default};
|
||||
@@ -1 +0,0 @@
|
||||
@keyframes pulse-718feedc{0%{opacity:.7}50%{opacity:.4}to{opacity:.7}}.animate-pulse[data-v-718feedc]{animation:pulse-718feedc 2s cubic-bezier(.4,0,.6,1) infinite}.header-title[data-v-718feedc]{text-shadow:0 1px 2px rgba(0,0,0,.1)}
|
||||
@@ -1 +0,0 @@
|
||||
/* empty css */import{_ as r}from"./index-D-2UnWMj.js";import{x as t,y as s,z as o,Q as d,L as a,A as c,C as g,P as i}from"./vue-vendor-CKToUHZx.js";const u={class:"flex items-center gap-4"},f={class:"w-12 h-12 bg-gradient-to-br from-blue-500/20 to-purple-500/20 border border-gray-300/30 rounded-xl flex items-center justify-center backdrop-blur-sm flex-shrink-0 overflow-hidden"},y=["src"],m={key:1,class:"fas fa-cloud text-xl text-gray-700"},h={key:1,class:"w-8 h-8 bg-gray-300/50 rounded animate-pulse"},x={class:"flex flex-col justify-center min-h-[48px]"},b={class:"flex items-center gap-3"},k={key:1,class:"h-8 w-64 bg-gray-300/50 rounded animate-pulse"},_={key:0,class:"text-gray-600 text-sm leading-tight mt-0.5"},S={__name:"LogoTitle",props:{loading:{type:Boolean,default:!1},title:{type:String,default:""},subtitle:{type:String,default:""},logoSrc:{type:String,default:""},titleClass:{type:String,default:"text-gray-900"}},setup(e){const n=l=>{l.target.style.display="none"};return(l,p)=>(s(),t("div",u,[o("div",f,[e.loading?(s(),t("div",h)):(s(),t(d,{key:0},[e.logoSrc?(s(),t("img",{key:0,src:e.logoSrc,alt:"Logo",class:"w-8 h-8 object-contain",onError:n},null,40,y)):(s(),t("i",m))],64))]),o("div",x,[o("div",b,[!e.loading&&e.title?(s(),t("h1",{key:0,class:g(["text-2xl font-bold header-title leading-tight",e.titleClass])},i(e.title),3)):e.loading?(s(),t("div",k)):a("",!0),c(l.$slots,"after-title",{},void 0,!0)]),e.subtitle?(s(),t("p",_,i(e.subtitle),1)):a("",!0)])]))}},C=r(S,[["__scopeId","data-v-718feedc"]]);export{C as L};
|
||||
@@ -1 +0,0 @@
|
||||
.user-menu-dropdown[data-v-ba157918]{margin-top:8px}.fade-enter-active[data-v-ba157918],.fade-leave-active[data-v-ba157918]{transition:opacity .3s}.fade-enter-from[data-v-ba157918],.fade-leave-to[data-v-ba157918]{opacity:0}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.settings-container[data-v-7f74a34a]{min-height:calc(100vh - 300px)}.card[data-v-7f74a34a]{background:#fff;border-radius:12px;box-shadow:0 2px 12px #0000001a;border:1px solid #e5e7eb}.table-container[data-v-7f74a34a]{overflow:hidden;border-radius:8px;border:1px solid #f3f4f6}.table-row[data-v-7f74a34a]{transition:background-color .2s ease}.table-row[data-v-7f74a34a]:hover{background-color:#f9fafb}.form-input[data-v-7f74a34a]{width:100%;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding:.5rem 1rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.form-input[data-v-7f74a34a]:focus{border-color:transparent;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.btn[data-v-7f74a34a]{display:inline-flex;align-items:center;justify-content:center;border-radius:.5rem;padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.btn[data-v-7f74a34a]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-offset-width: 2px}.btn-primary[data-v-7f74a34a]{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.btn-primary[data-v-7f74a34a]:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.btn-primary[data-v-7f74a34a]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.btn-success[data-v-7f74a34a]{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.btn-success[data-v-7f74a34a]:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.btn-success[data-v-7f74a34a]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(34 197 94 / var(--tw-ring-opacity, 1))}.loading-spinner[data-v-7f74a34a]{height:1.25rem;width:1.25rem}@keyframes spin-7f74a34a{to{transform:rotate(360deg)}}.loading-spinner[data-v-7f74a34a]{animation:spin-7f74a34a 1s linear infinite;border-radius:9999px;border-width:2px;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-border-opacity: 1;border-top-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.tutorial-container[data-v-3c2eeab4]{min-height:calc(100vh - 300px)}.tutorial-content[data-v-3c2eeab4]{animation:fadeIn-3c2eeab4 .3s ease-in-out}@keyframes fadeIn-3c2eeab4{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}code[data-v-3c2eeab4]{font-family:Fira Code,Monaco,Menlo,Ubuntu Mono,monospace}.tutorial-content h4[data-v-3c2eeab4]{scroll-margin-top:100px}.tutorial-content .bg-gradient-to-r[data-v-3c2eeab4]{transition:all .2s ease}.tutorial-content .bg-gradient-to-r[data-v-3c2eeab4]:hover{transform:translateY(-1px);box-shadow:0 4px 12px #0000001a}
|
||||
13
web/admin-spa/dist/assets/chart-Cor9iTVD.js
vendored
13
web/admin-spa/dist/assets/chart-Cor9iTVD.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
web/admin-spa/dist/assets/fa-brands-400-D1LuMI3I.ttf
vendored
BIN
web/admin-spa/dist/assets/fa-brands-400-D1LuMI3I.ttf
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
web/admin-spa/dist/assets/fa-solid-900-D0aA9rwL.ttf
vendored
BIN
web/admin-spa/dist/assets/fa-solid-900-D0aA9rwL.ttf
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
web/admin-spa/dist/assets/index-D-2UnWMj.js
vendored
2
web/admin-spa/dist/assets/index-D-2UnWMj.js
vendored
File diff suppressed because one or more lines are too long
5
web/admin-spa/dist/assets/index-apD7Mw0c.css
vendored
5
web/admin-spa/dist/assets/index-apD7Mw0c.css
vendored
File diff suppressed because one or more lines are too long
22
web/admin-spa/dist/assets/toast-BvwA7Mwb.js
vendored
22
web/admin-spa/dist/assets/toast-BvwA7Mwb.js
vendored
@@ -1,22 +0,0 @@
|
||||
let e=null,r=0;function c(n,s="info",a="",i=3e3){e||(e=document.createElement("div"),e.id="toast-container",e.style.cssText="position: fixed; top: 20px; right: 20px; z-index: 10000;",document.body.appendChild(e));const o=++r,t=document.createElement("div");t.className=`toast rounded-2xl p-4 shadow-2xl backdrop-blur-sm toast-${s}`,t.style.cssText=`
|
||||
position: relative;
|
||||
min-width: 320px;
|
||||
max-width: 500px;
|
||||
margin-bottom: 16px;
|
||||
transform: translateX(100%);
|
||||
transition: transform 0.3s ease-in-out;
|
||||
`;const l={success:"fas fa-check-circle",error:"fas fa-times-circle",warning:"fas fa-exclamation-triangle",info:"fas fa-info-circle"};return t.innerHTML=`
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="flex-shrink-0 mt-0.5">
|
||||
<i class="${l[s]} text-lg"></i>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
${a?`<h4 class="font-semibold text-sm mb-1">${a}</h4>`:""}
|
||||
<p class="text-sm opacity-90 leading-relaxed">${n}</p>
|
||||
</div>
|
||||
<button onclick="this.parentElement.parentElement.remove()"
|
||||
class="flex-shrink-0 text-white/70 hover:text-white transition-colors ml-2">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
`,e.appendChild(t),setTimeout(()=>{t.style.transform="translateX(0)"},10),i>0&&setTimeout(()=>{t.style.transform="translateX(100%)",setTimeout(()=>{t.remove()},300)},i),o}export{c as s};
|
||||
30
web/admin-spa/dist/assets/vendor-BDiMbLwQ.js
vendored
30
web/admin-spa/dist/assets/vendor-BDiMbLwQ.js
vendored
File diff suppressed because one or more lines are too long
25
web/admin-spa/dist/assets/vue-vendor-CKToUHZx.js
vendored
25
web/admin-spa/dist/assets/vue-vendor-CKToUHZx.js
vendored
File diff suppressed because one or more lines are too long
31
web/admin-spa/dist/index.html
vendored
31
web/admin-spa/dist/index.html
vendored
@@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Claude Relay Service - 管理后台</title>
|
||||
|
||||
<!-- Google Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- 预连接到CDN域名,加速资源加载 -->
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
|
||||
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin>
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com">
|
||||
<script type="module" crossorigin src="/admin-next/assets/index-D-2UnWMj.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/admin-next/assets/vue-vendor-CKToUHZx.js">
|
||||
<link rel="modulepreload" crossorigin href="/admin-next/assets/vendor-BDiMbLwQ.js">
|
||||
<link rel="modulepreload" crossorigin href="/admin-next/assets/element-plus-B8Fs_0jW.js">
|
||||
<link rel="stylesheet" crossorigin href="/admin-next/assets/element-plus-CPnoEkWW.css">
|
||||
<link rel="stylesheet" crossorigin href="/admin-next/assets/index-apD7Mw0c.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
1
web/admin-spa/node_modules/.bin/acorn
generated
vendored
1
web/admin-spa/node_modules/.bin/acorn
generated
vendored
@@ -1 +0,0 @@
|
||||
../acorn/bin/acorn
|
||||
1
web/admin-spa/node_modules/.bin/autoprefixer
generated
vendored
1
web/admin-spa/node_modules/.bin/autoprefixer
generated
vendored
@@ -1 +0,0 @@
|
||||
../autoprefixer/bin/autoprefixer
|
||||
1
web/admin-spa/node_modules/.bin/browserslist
generated
vendored
1
web/admin-spa/node_modules/.bin/browserslist
generated
vendored
@@ -1 +0,0 @@
|
||||
../browserslist/cli.js
|
||||
1
web/admin-spa/node_modules/.bin/cssesc
generated
vendored
1
web/admin-spa/node_modules/.bin/cssesc
generated
vendored
@@ -1 +0,0 @@
|
||||
../cssesc/bin/cssesc
|
||||
1
web/admin-spa/node_modules/.bin/esbuild
generated
vendored
1
web/admin-spa/node_modules/.bin/esbuild
generated
vendored
@@ -1 +0,0 @@
|
||||
../esbuild/bin/esbuild
|
||||
1
web/admin-spa/node_modules/.bin/eslint
generated
vendored
1
web/admin-spa/node_modules/.bin/eslint
generated
vendored
@@ -1 +0,0 @@
|
||||
../eslint/bin/eslint.js
|
||||
1
web/admin-spa/node_modules/.bin/jiti
generated
vendored
1
web/admin-spa/node_modules/.bin/jiti
generated
vendored
@@ -1 +0,0 @@
|
||||
../jiti/bin/jiti.js
|
||||
1
web/admin-spa/node_modules/.bin/js-yaml
generated
vendored
1
web/admin-spa/node_modules/.bin/js-yaml
generated
vendored
@@ -1 +0,0 @@
|
||||
../js-yaml/bin/js-yaml.js
|
||||
1
web/admin-spa/node_modules/.bin/nanoid
generated
vendored
1
web/admin-spa/node_modules/.bin/nanoid
generated
vendored
@@ -1 +0,0 @@
|
||||
../nanoid/bin/nanoid.cjs
|
||||
1
web/admin-spa/node_modules/.bin/node-which
generated
vendored
1
web/admin-spa/node_modules/.bin/node-which
generated
vendored
@@ -1 +0,0 @@
|
||||
../which/bin/node-which
|
||||
1
web/admin-spa/node_modules/.bin/parser
generated
vendored
1
web/admin-spa/node_modules/.bin/parser
generated
vendored
@@ -1 +0,0 @@
|
||||
../@babel/parser/bin/babel-parser.js
|
||||
1
web/admin-spa/node_modules/.bin/prettier
generated
vendored
1
web/admin-spa/node_modules/.bin/prettier
generated
vendored
@@ -1 +0,0 @@
|
||||
../prettier/bin/prettier.cjs
|
||||
1
web/admin-spa/node_modules/.bin/resolve
generated
vendored
1
web/admin-spa/node_modules/.bin/resolve
generated
vendored
@@ -1 +0,0 @@
|
||||
../resolve/bin/resolve
|
||||
1
web/admin-spa/node_modules/.bin/rimraf
generated
vendored
1
web/admin-spa/node_modules/.bin/rimraf
generated
vendored
@@ -1 +0,0 @@
|
||||
../rimraf/bin.js
|
||||
1
web/admin-spa/node_modules/.bin/rollup
generated
vendored
1
web/admin-spa/node_modules/.bin/rollup
generated
vendored
@@ -1 +0,0 @@
|
||||
../rollup/dist/bin/rollup
|
||||
1
web/admin-spa/node_modules/.bin/semver
generated
vendored
1
web/admin-spa/node_modules/.bin/semver
generated
vendored
@@ -1 +0,0 @@
|
||||
../semver/bin/semver.js
|
||||
1
web/admin-spa/node_modules/.bin/sucrase
generated
vendored
1
web/admin-spa/node_modules/.bin/sucrase
generated
vendored
@@ -1 +0,0 @@
|
||||
../sucrase/bin/sucrase
|
||||
1
web/admin-spa/node_modules/.bin/sucrase-node
generated
vendored
1
web/admin-spa/node_modules/.bin/sucrase-node
generated
vendored
@@ -1 +0,0 @@
|
||||
../sucrase/bin/sucrase-node
|
||||
1
web/admin-spa/node_modules/.bin/tailwind
generated
vendored
1
web/admin-spa/node_modules/.bin/tailwind
generated
vendored
@@ -1 +0,0 @@
|
||||
../tailwindcss/lib/cli.js
|
||||
1
web/admin-spa/node_modules/.bin/tailwindcss
generated
vendored
1
web/admin-spa/node_modules/.bin/tailwindcss
generated
vendored
@@ -1 +0,0 @@
|
||||
../tailwindcss/lib/cli.js
|
||||
1
web/admin-spa/node_modules/.bin/update-browserslist-db
generated
vendored
1
web/admin-spa/node_modules/.bin/update-browserslist-db
generated
vendored
@@ -1 +0,0 @@
|
||||
../update-browserslist-db/cli.js
|
||||
1
web/admin-spa/node_modules/.bin/vite
generated
vendored
1
web/admin-spa/node_modules/.bin/vite
generated
vendored
@@ -1 +0,0 @@
|
||||
../vite/bin/vite.js
|
||||
1
web/admin-spa/node_modules/.bin/vue-demi-fix
generated
vendored
1
web/admin-spa/node_modules/.bin/vue-demi-fix
generated
vendored
@@ -1 +0,0 @@
|
||||
../vue-demi/bin/vue-demi-fix.js
|
||||
1
web/admin-spa/node_modules/.bin/vue-demi-switch
generated
vendored
1
web/admin-spa/node_modules/.bin/vue-demi-switch
generated
vendored
@@ -1 +0,0 @@
|
||||
../vue-demi/bin/vue-demi-switch.js
|
||||
1
web/admin-spa/node_modules/.bin/yaml
generated
vendored
1
web/admin-spa/node_modules/.bin/yaml
generated
vendored
@@ -1 +0,0 @@
|
||||
../yaml/bin.mjs
|
||||
4092
web/admin-spa/node_modules/.package-lock.json
generated
vendored
4092
web/admin-spa/node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load Diff
128
web/admin-spa/node_modules/@alloc/quick-lru/index.d.ts
generated
vendored
128
web/admin-spa/node_modules/@alloc/quick-lru/index.d.ts
generated
vendored
@@ -1,128 +0,0 @@
|
||||
declare namespace QuickLRU {
|
||||
interface Options<KeyType, ValueType> {
|
||||
/**
|
||||
The maximum number of milliseconds an item should remain in the cache.
|
||||
|
||||
@default Infinity
|
||||
|
||||
By default, `maxAge` will be `Infinity`, which means that items will never expire.
|
||||
Lazy expiration upon the next write or read call.
|
||||
|
||||
Individual expiration of an item can be specified by the `set(key, value, maxAge)` method.
|
||||
*/
|
||||
readonly maxAge?: number;
|
||||
|
||||
/**
|
||||
The maximum number of items before evicting the least recently used items.
|
||||
*/
|
||||
readonly maxSize: number;
|
||||
|
||||
/**
|
||||
Called right before an item is evicted from the cache.
|
||||
|
||||
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||
*/
|
||||
onEviction?: (key: KeyType, value: ValueType) => void;
|
||||
}
|
||||
}
|
||||
|
||||
declare class QuickLRU<KeyType, ValueType>
|
||||
implements Iterable<[KeyType, ValueType]> {
|
||||
/**
|
||||
The stored item count.
|
||||
*/
|
||||
readonly size: number;
|
||||
|
||||
/**
|
||||
Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29).
|
||||
|
||||
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||
|
||||
@example
|
||||
```
|
||||
import QuickLRU = require('quick-lru');
|
||||
|
||||
const lru = new QuickLRU({maxSize: 1000});
|
||||
|
||||
lru.set('🦄', '🌈');
|
||||
|
||||
lru.has('🦄');
|
||||
//=> true
|
||||
|
||||
lru.get('🦄');
|
||||
//=> '🌈'
|
||||
```
|
||||
*/
|
||||
constructor(options: QuickLRU.Options<KeyType, ValueType>);
|
||||
|
||||
[Symbol.iterator](): IterableIterator<[KeyType, ValueType]>;
|
||||
|
||||
/**
|
||||
Set an item. Returns the instance.
|
||||
|
||||
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire.
|
||||
|
||||
@returns The list instance.
|
||||
*/
|
||||
set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this;
|
||||
|
||||
/**
|
||||
Get an item.
|
||||
|
||||
@returns The stored item or `undefined`.
|
||||
*/
|
||||
get(key: KeyType): ValueType | undefined;
|
||||
|
||||
/**
|
||||
Check if an item exists.
|
||||
*/
|
||||
has(key: KeyType): boolean;
|
||||
|
||||
/**
|
||||
Get an item without marking it as recently used.
|
||||
|
||||
@returns The stored item or `undefined`.
|
||||
*/
|
||||
peek(key: KeyType): ValueType | undefined;
|
||||
|
||||
/**
|
||||
Delete an item.
|
||||
|
||||
@returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||
*/
|
||||
delete(key: KeyType): boolean;
|
||||
|
||||
/**
|
||||
Delete all items.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||
|
||||
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||
*/
|
||||
resize(maxSize: number): void;
|
||||
|
||||
/**
|
||||
Iterable for all the keys.
|
||||
*/
|
||||
keys(): IterableIterator<KeyType>;
|
||||
|
||||
/**
|
||||
Iterable for all the values.
|
||||
*/
|
||||
values(): IterableIterator<ValueType>;
|
||||
|
||||
/**
|
||||
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||
*/
|
||||
entriesAscending(): IterableIterator<[KeyType, ValueType]>;
|
||||
|
||||
/**
|
||||
Iterable for all entries, starting with the newest (descending in recency).
|
||||
*/
|
||||
entriesDescending(): IterableIterator<[KeyType, ValueType]>;
|
||||
}
|
||||
|
||||
export = QuickLRU;
|
||||
263
web/admin-spa/node_modules/@alloc/quick-lru/index.js
generated
vendored
263
web/admin-spa/node_modules/@alloc/quick-lru/index.js
generated
vendored
@@ -1,263 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
class QuickLRU {
|
||||
constructor(options = {}) {
|
||||
if (!(options.maxSize && options.maxSize > 0)) {
|
||||
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||
}
|
||||
|
||||
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
|
||||
throw new TypeError('`maxAge` must be a number greater than 0');
|
||||
}
|
||||
|
||||
this.maxSize = options.maxSize;
|
||||
this.maxAge = options.maxAge || Infinity;
|
||||
this.onEviction = options.onEviction;
|
||||
this.cache = new Map();
|
||||
this.oldCache = new Map();
|
||||
this._size = 0;
|
||||
}
|
||||
|
||||
_emitEvictions(cache) {
|
||||
if (typeof this.onEviction !== 'function') {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const [key, item] of cache) {
|
||||
this.onEviction(key, item.value);
|
||||
}
|
||||
}
|
||||
|
||||
_deleteIfExpired(key, item) {
|
||||
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
||||
if (typeof this.onEviction === 'function') {
|
||||
this.onEviction(key, item.value);
|
||||
}
|
||||
|
||||
return this.delete(key);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_getOrDeleteIfExpired(key, item) {
|
||||
const deleted = this._deleteIfExpired(key, item);
|
||||
if (deleted === false) {
|
||||
return item.value;
|
||||
}
|
||||
}
|
||||
|
||||
_getItemValue(key, item) {
|
||||
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
||||
}
|
||||
|
||||
_peek(key, cache) {
|
||||
const item = cache.get(key);
|
||||
|
||||
return this._getItemValue(key, item);
|
||||
}
|
||||
|
||||
_set(key, value) {
|
||||
this.cache.set(key, value);
|
||||
this._size++;
|
||||
|
||||
if (this._size >= this.maxSize) {
|
||||
this._size = 0;
|
||||
this._emitEvictions(this.oldCache);
|
||||
this.oldCache = this.cache;
|
||||
this.cache = new Map();
|
||||
}
|
||||
}
|
||||
|
||||
_moveToRecent(key, item) {
|
||||
this.oldCache.delete(key);
|
||||
this._set(key, item);
|
||||
}
|
||||
|
||||
* _entriesAscending() {
|
||||
for (const item of this.oldCache) {
|
||||
const [key, value] = item;
|
||||
if (!this.cache.has(key)) {
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const item of this.cache) {
|
||||
const [key, value] = item;
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get(key) {
|
||||
if (this.cache.has(key)) {
|
||||
const item = this.cache.get(key);
|
||||
|
||||
return this._getItemValue(key, item);
|
||||
}
|
||||
|
||||
if (this.oldCache.has(key)) {
|
||||
const item = this.oldCache.get(key);
|
||||
if (this._deleteIfExpired(key, item) === false) {
|
||||
this._moveToRecent(key, item);
|
||||
return item.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) {
|
||||
if (this.cache.has(key)) {
|
||||
this.cache.set(key, {
|
||||
value,
|
||||
maxAge
|
||||
});
|
||||
} else {
|
||||
this._set(key, {value, expiry: maxAge});
|
||||
}
|
||||
}
|
||||
|
||||
has(key) {
|
||||
if (this.cache.has(key)) {
|
||||
return !this._deleteIfExpired(key, this.cache.get(key));
|
||||
}
|
||||
|
||||
if (this.oldCache.has(key)) {
|
||||
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
peek(key) {
|
||||
if (this.cache.has(key)) {
|
||||
return this._peek(key, this.cache);
|
||||
}
|
||||
|
||||
if (this.oldCache.has(key)) {
|
||||
return this._peek(key, this.oldCache);
|
||||
}
|
||||
}
|
||||
|
||||
delete(key) {
|
||||
const deleted = this.cache.delete(key);
|
||||
if (deleted) {
|
||||
this._size--;
|
||||
}
|
||||
|
||||
return this.oldCache.delete(key) || deleted;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.cache.clear();
|
||||
this.oldCache.clear();
|
||||
this._size = 0;
|
||||
}
|
||||
|
||||
resize(newSize) {
|
||||
if (!(newSize && newSize > 0)) {
|
||||
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||
}
|
||||
|
||||
const items = [...this._entriesAscending()];
|
||||
const removeCount = items.length - newSize;
|
||||
if (removeCount < 0) {
|
||||
this.cache = new Map(items);
|
||||
this.oldCache = new Map();
|
||||
this._size = items.length;
|
||||
} else {
|
||||
if (removeCount > 0) {
|
||||
this._emitEvictions(items.slice(0, removeCount));
|
||||
}
|
||||
|
||||
this.oldCache = new Map(items.slice(removeCount));
|
||||
this.cache = new Map();
|
||||
this._size = 0;
|
||||
}
|
||||
|
||||
this.maxSize = newSize;
|
||||
}
|
||||
|
||||
* keys() {
|
||||
for (const [key] of this) {
|
||||
yield key;
|
||||
}
|
||||
}
|
||||
|
||||
* values() {
|
||||
for (const [, value] of this) {
|
||||
yield value;
|
||||
}
|
||||
}
|
||||
|
||||
* [Symbol.iterator]() {
|
||||
for (const item of this.cache) {
|
||||
const [key, value] = item;
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
|
||||
for (const item of this.oldCache) {
|
||||
const [key, value] = item;
|
||||
if (!this.cache.has(key)) {
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* entriesDescending() {
|
||||
let items = [...this.cache];
|
||||
for (let i = items.length - 1; i >= 0; --i) {
|
||||
const item = items[i];
|
||||
const [key, value] = item;
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
|
||||
items = [...this.oldCache];
|
||||
for (let i = items.length - 1; i >= 0; --i) {
|
||||
const item = items[i];
|
||||
const [key, value] = item;
|
||||
if (!this.cache.has(key)) {
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* entriesAscending() {
|
||||
for (const [key, value] of this._entriesAscending()) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
|
||||
get size() {
|
||||
if (!this._size) {
|
||||
return this.oldCache.size;
|
||||
}
|
||||
|
||||
let oldCacheSize = 0;
|
||||
for (const key of this.oldCache.keys()) {
|
||||
if (!this.cache.has(key)) {
|
||||
oldCacheSize++;
|
||||
}
|
||||
}
|
||||
|
||||
return Math.min(this._size + oldCacheSize, this.maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = QuickLRU;
|
||||
9
web/admin-spa/node_modules/@alloc/quick-lru/license
generated
vendored
9
web/admin-spa/node_modules/@alloc/quick-lru/license
generated
vendored
@@ -1,9 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
43
web/admin-spa/node_modules/@alloc/quick-lru/package.json
generated
vendored
43
web/admin-spa/node_modules/@alloc/quick-lru/package.json
generated
vendored
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"name": "@alloc/quick-lru",
|
||||
"version": "5.2.0",
|
||||
"description": "Simple “Least Recently Used” (LRU) cache",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/quick-lru",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"lru",
|
||||
"quick",
|
||||
"cache",
|
||||
"caching",
|
||||
"least",
|
||||
"recently",
|
||||
"used",
|
||||
"fast",
|
||||
"map",
|
||||
"hash",
|
||||
"buffer"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^2.0.0",
|
||||
"coveralls": "^3.0.3",
|
||||
"nyc": "^15.0.0",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.26.0"
|
||||
}
|
||||
}
|
||||
139
web/admin-spa/node_modules/@alloc/quick-lru/readme.md
generated
vendored
139
web/admin-spa/node_modules/@alloc/quick-lru/readme.md
generated
vendored
@@ -1,139 +0,0 @@
|
||||
# quick-lru [](https://travis-ci.org/sindresorhus/quick-lru) [](https://coveralls.io/github/sindresorhus/quick-lru?branch=master)
|
||||
|
||||
> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29)
|
||||
|
||||
Useful when you need to cache something and limit memory usage.
|
||||
|
||||
Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install quick-lru
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const QuickLRU = require('quick-lru');
|
||||
|
||||
const lru = new QuickLRU({maxSize: 1000});
|
||||
|
||||
lru.set('🦄', '🌈');
|
||||
|
||||
lru.has('🦄');
|
||||
//=> true
|
||||
|
||||
lru.get('🦄');
|
||||
//=> '🌈'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### new QuickLRU(options?)
|
||||
|
||||
Returns a new instance.
|
||||
|
||||
### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
#### maxSize
|
||||
|
||||
*Required*\
|
||||
Type: `number`
|
||||
|
||||
The maximum number of items before evicting the least recently used items.
|
||||
|
||||
#### maxAge
|
||||
|
||||
Type: `number`\
|
||||
Default: `Infinity`
|
||||
|
||||
The maximum number of milliseconds an item should remain in cache.
|
||||
By default maxAge will be Infinity, which means that items will never expire.
|
||||
|
||||
Lazy expiration happens upon the next `write` or `read` call.
|
||||
|
||||
Individual expiration of an item can be specified by the `set(key, value, options)` method.
|
||||
|
||||
#### onEviction
|
||||
|
||||
*Optional*\
|
||||
Type: `(key, value) => void`
|
||||
|
||||
Called right before an item is evicted from the cache.
|
||||
|
||||
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||
|
||||
### Instance
|
||||
|
||||
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||
|
||||
Both `key` and `value` can be of any type.
|
||||
|
||||
#### .set(key, value, options?)
|
||||
|
||||
Set an item. Returns the instance.
|
||||
|
||||
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire.
|
||||
|
||||
#### .get(key)
|
||||
|
||||
Get an item.
|
||||
|
||||
#### .has(key)
|
||||
|
||||
Check if an item exists.
|
||||
|
||||
#### .peek(key)
|
||||
|
||||
Get an item without marking it as recently used.
|
||||
|
||||
#### .delete(key)
|
||||
|
||||
Delete an item.
|
||||
|
||||
Returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||
|
||||
#### .clear()
|
||||
|
||||
Delete all items.
|
||||
|
||||
#### .resize(maxSize)
|
||||
|
||||
Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||
|
||||
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||
|
||||
#### .keys()
|
||||
|
||||
Iterable for all the keys.
|
||||
|
||||
#### .values()
|
||||
|
||||
Iterable for all the values.
|
||||
|
||||
#### .entriesAscending()
|
||||
|
||||
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||
|
||||
#### .entriesDescending()
|
||||
|
||||
Iterable for all entries, starting with the newest (descending in recency).
|
||||
|
||||
#### .size
|
||||
|
||||
The stored item count.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-quick-lru?utm_source=npm-quick-lru&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
21
web/admin-spa/node_modules/@antfu/utils/LICENSE
generated
vendored
21
web/admin-spa/node_modules/@antfu/utils/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Anthony Fu <https://github.com/antfu>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
24
web/admin-spa/node_modules/@antfu/utils/README.md
generated
vendored
24
web/admin-spa/node_modules/@antfu/utils/README.md
generated
vendored
@@ -1,24 +0,0 @@
|
||||
# @antfu/utils
|
||||
|
||||
[](https://www.npmjs.com/package/@antfu/utils)
|
||||
[](https://www.jsdocs.io/package/@antfu/utils)
|
||||
|
||||
Opinionated collection of common JavaScript / TypeScript utils by [@antfu](https://github.com/antfu).
|
||||
|
||||
- Tree-shakable ESM
|
||||
- Fully typed - with TSDocs
|
||||
- Type utilities - `Arrayable<T>`, `ElementOf<T>`, etc.
|
||||
|
||||
> This package is designed to be used as `devDependencies` and bundled into your dist.
|
||||
|
||||
## Sponsors
|
||||
|
||||
<p align="center">
|
||||
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
|
||||
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)
|
||||
844
web/admin-spa/node_modules/@antfu/utils/dist/index.cjs
generated
vendored
844
web/admin-spa/node_modules/@antfu/utils/dist/index.cjs
generated
vendored
@@ -1,844 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
function clamp(n, min, max) {
|
||||
return Math.min(max, Math.max(min, n));
|
||||
}
|
||||
function sum(...args) {
|
||||
return flattenArrayable(args).reduce((a, b) => a + b, 0);
|
||||
}
|
||||
function lerp(min, max, t) {
|
||||
const interpolation = clamp(t, 0, 1);
|
||||
return min + (max - min) * interpolation;
|
||||
}
|
||||
function remap(n, inMin, inMax, outMin, outMax) {
|
||||
const interpolation = (n - inMin) / (inMax - inMin);
|
||||
return lerp(outMin, outMax, interpolation);
|
||||
}
|
||||
|
||||
function toArray(array) {
|
||||
array = array ?? [];
|
||||
return Array.isArray(array) ? array : [array];
|
||||
}
|
||||
function flattenArrayable(array) {
|
||||
return toArray(array).flat(1);
|
||||
}
|
||||
function mergeArrayable(...args) {
|
||||
return args.flatMap((i) => toArray(i));
|
||||
}
|
||||
function partition(array, ...filters) {
|
||||
const result = Array.from({ length: filters.length + 1 }).fill(null).map(() => []);
|
||||
array.forEach((e, idx, arr) => {
|
||||
let i = 0;
|
||||
for (const filter of filters) {
|
||||
if (filter(e, idx, arr)) {
|
||||
result[i].push(e);
|
||||
return;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
result[i].push(e);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function uniq(array) {
|
||||
return Array.from(new Set(array));
|
||||
}
|
||||
function uniqueBy(array, equalFn) {
|
||||
return array.reduce((acc, cur) => {
|
||||
const index = acc.findIndex((item) => equalFn(cur, item));
|
||||
if (index === -1)
|
||||
acc.push(cur);
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
function last(array) {
|
||||
return at(array, -1);
|
||||
}
|
||||
function remove(array, value) {
|
||||
if (!array)
|
||||
return false;
|
||||
const index = array.indexOf(value);
|
||||
if (index >= 0) {
|
||||
array.splice(index, 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function at(array, index) {
|
||||
const len = array.length;
|
||||
if (!len)
|
||||
return void 0;
|
||||
if (index < 0)
|
||||
index += len;
|
||||
return array[index];
|
||||
}
|
||||
function range(...args) {
|
||||
let start, stop, step;
|
||||
if (args.length === 1) {
|
||||
start = 0;
|
||||
step = 1;
|
||||
[stop] = args;
|
||||
} else {
|
||||
[start, stop, step = 1] = args;
|
||||
}
|
||||
const arr = [];
|
||||
let current = start;
|
||||
while (current < stop) {
|
||||
arr.push(current);
|
||||
current += step || 1;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
function move(arr, from, to) {
|
||||
arr.splice(to, 0, arr.splice(from, 1)[0]);
|
||||
return arr;
|
||||
}
|
||||
function clampArrayRange(n, arr) {
|
||||
return clamp(n, 0, arr.length - 1);
|
||||
}
|
||||
function sample(arr, quantity) {
|
||||
return Array.from({ length: quantity }, (_) => arr[Math.round(Math.random() * (arr.length - 1))]);
|
||||
}
|
||||
function shuffle(array) {
|
||||
for (let i = array.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[array[i], array[j]] = [array[j], array[i]];
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
function assert(condition, message) {
|
||||
if (!condition)
|
||||
throw new Error(message);
|
||||
}
|
||||
const toString = (v) => Object.prototype.toString.call(v);
|
||||
function getTypeName(v) {
|
||||
if (v === null)
|
||||
return "null";
|
||||
const type = toString(v).slice(8, -1).toLowerCase();
|
||||
return typeof v === "object" || typeof v === "function" ? type : typeof v;
|
||||
}
|
||||
function noop() {
|
||||
}
|
||||
|
||||
function isDeepEqual(value1, value2) {
|
||||
const type1 = getTypeName(value1);
|
||||
const type2 = getTypeName(value2);
|
||||
if (type1 !== type2)
|
||||
return false;
|
||||
if (type1 === "array") {
|
||||
if (value1.length !== value2.length)
|
||||
return false;
|
||||
return value1.every((item, i) => {
|
||||
return isDeepEqual(item, value2[i]);
|
||||
});
|
||||
}
|
||||
if (type1 === "object") {
|
||||
const keyArr = Object.keys(value1);
|
||||
if (keyArr.length !== Object.keys(value2).length)
|
||||
return false;
|
||||
return keyArr.every((key) => {
|
||||
return isDeepEqual(value1[key], value2[key]);
|
||||
});
|
||||
}
|
||||
return Object.is(value1, value2);
|
||||
}
|
||||
|
||||
function notNullish(v) {
|
||||
return v != null;
|
||||
}
|
||||
function noNull(v) {
|
||||
return v !== null;
|
||||
}
|
||||
function notUndefined(v) {
|
||||
return v !== void 0;
|
||||
}
|
||||
function isTruthy(v) {
|
||||
return Boolean(v);
|
||||
}
|
||||
|
||||
const isDef = (val) => typeof val !== "undefined";
|
||||
const isBoolean = (val) => typeof val === "boolean";
|
||||
const isFunction = (val) => typeof val === "function";
|
||||
const isNumber = (val) => typeof val === "number";
|
||||
const isString = (val) => typeof val === "string";
|
||||
const isObject = (val) => toString(val) === "[object Object]";
|
||||
const isUndefined = (val) => toString(val) === "[object Undefined]";
|
||||
const isNull = (val) => toString(val) === "[object Null]";
|
||||
const isRegExp = (val) => toString(val) === "[object RegExp]";
|
||||
const isDate = (val) => toString(val) === "[object Date]";
|
||||
const isWindow = (val) => typeof window !== "undefined" && toString(val) === "[object Window]";
|
||||
const isBrowser = typeof window !== "undefined";
|
||||
|
||||
function slash(str) {
|
||||
return str.replace(/\\/g, "/");
|
||||
}
|
||||
function ensurePrefix(prefix, str) {
|
||||
if (!str.startsWith(prefix))
|
||||
return prefix + str;
|
||||
return str;
|
||||
}
|
||||
function ensureSuffix(suffix, str) {
|
||||
if (!str.endsWith(suffix))
|
||||
return str + suffix;
|
||||
return str;
|
||||
}
|
||||
function template(str, ...args) {
|
||||
const [firstArg, fallback] = args;
|
||||
if (isObject(firstArg)) {
|
||||
const vars = firstArg;
|
||||
return str.replace(/{([\w\d]+)}/g, (_, key) => vars[key] || ((typeof fallback === "function" ? fallback(key) : fallback) ?? key));
|
||||
} else {
|
||||
return str.replace(/{(\d+)}/g, (_, key) => {
|
||||
const index = Number(key);
|
||||
if (Number.isNaN(index))
|
||||
return key;
|
||||
return args[index];
|
||||
});
|
||||
}
|
||||
}
|
||||
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
||||
function randomStr(size = 16, dict = urlAlphabet) {
|
||||
let id = "";
|
||||
let i = size;
|
||||
const len = dict.length;
|
||||
while (i--)
|
||||
id += dict[Math.random() * len | 0];
|
||||
return id;
|
||||
}
|
||||
function capitalize(str) {
|
||||
return str[0].toUpperCase() + str.slice(1).toLowerCase();
|
||||
}
|
||||
const _reFullWs = /^\s*$/;
|
||||
function unindent(str) {
|
||||
const lines = (typeof str === "string" ? str : str[0]).split("\n");
|
||||
const whitespaceLines = lines.map((line) => _reFullWs.test(line));
|
||||
const commonIndent = lines.reduce((min, line, idx) => {
|
||||
var _a;
|
||||
if (whitespaceLines[idx])
|
||||
return min;
|
||||
const indent = (_a = line.match(/^\s*/)) == null ? void 0 : _a[0].length;
|
||||
return indent === void 0 ? min : Math.min(min, indent);
|
||||
}, Number.POSITIVE_INFINITY);
|
||||
let emptyLinesHead = 0;
|
||||
while (emptyLinesHead < lines.length && whitespaceLines[emptyLinesHead])
|
||||
emptyLinesHead++;
|
||||
let emptyLinesTail = 0;
|
||||
while (emptyLinesTail < lines.length && whitespaceLines[lines.length - emptyLinesTail - 1])
|
||||
emptyLinesTail++;
|
||||
return lines.slice(emptyLinesHead, lines.length - emptyLinesTail).map((line) => line.slice(commonIndent)).join("\n");
|
||||
}
|
||||
|
||||
const timestamp = () => +Date.now();
|
||||
|
||||
function batchInvoke(functions) {
|
||||
functions.forEach((fn) => fn && fn());
|
||||
}
|
||||
function invoke(fn) {
|
||||
return fn();
|
||||
}
|
||||
function tap(value, callback) {
|
||||
callback(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
function objectMap(obj, fn) {
|
||||
return Object.fromEntries(
|
||||
Object.entries(obj).map(([k, v]) => fn(k, v)).filter(notNullish)
|
||||
);
|
||||
}
|
||||
function isKeyOf(obj, k) {
|
||||
return k in obj;
|
||||
}
|
||||
function objectKeys(obj) {
|
||||
return Object.keys(obj);
|
||||
}
|
||||
function objectEntries(obj) {
|
||||
return Object.entries(obj);
|
||||
}
|
||||
function deepMerge(target, ...sources) {
|
||||
if (!sources.length)
|
||||
return target;
|
||||
const source = sources.shift();
|
||||
if (source === void 0)
|
||||
return target;
|
||||
if (isMergableObject(target) && isMergableObject(source)) {
|
||||
objectKeys(source).forEach((key) => {
|
||||
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
||||
return;
|
||||
if (isMergableObject(source[key])) {
|
||||
if (!target[key])
|
||||
target[key] = {};
|
||||
if (isMergableObject(target[key])) {
|
||||
deepMerge(target[key], source[key]);
|
||||
} else {
|
||||
target[key] = source[key];
|
||||
}
|
||||
} else {
|
||||
target[key] = source[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
return deepMerge(target, ...sources);
|
||||
}
|
||||
function deepMergeWithArray(target, ...sources) {
|
||||
if (!sources.length)
|
||||
return target;
|
||||
const source = sources.shift();
|
||||
if (source === void 0)
|
||||
return target;
|
||||
if (Array.isArray(target) && Array.isArray(source))
|
||||
target.push(...source);
|
||||
if (isMergableObject(target) && isMergableObject(source)) {
|
||||
objectKeys(source).forEach((key) => {
|
||||
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
||||
return;
|
||||
if (Array.isArray(source[key])) {
|
||||
if (!target[key])
|
||||
target[key] = [];
|
||||
deepMergeWithArray(target[key], source[key]);
|
||||
} else if (isMergableObject(source[key])) {
|
||||
if (!target[key])
|
||||
target[key] = {};
|
||||
deepMergeWithArray(target[key], source[key]);
|
||||
} else {
|
||||
target[key] = source[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
return deepMergeWithArray(target, ...sources);
|
||||
}
|
||||
function isMergableObject(item) {
|
||||
return isObject(item) && !Array.isArray(item);
|
||||
}
|
||||
function objectPick(obj, keys, omitUndefined = false) {
|
||||
return keys.reduce((n, k) => {
|
||||
if (k in obj) {
|
||||
if (!omitUndefined || obj[k] !== void 0)
|
||||
n[k] = obj[k];
|
||||
}
|
||||
return n;
|
||||
}, {});
|
||||
}
|
||||
function clearUndefined(obj) {
|
||||
Object.keys(obj).forEach((key) => obj[key] === void 0 ? delete obj[key] : {});
|
||||
return obj;
|
||||
}
|
||||
function hasOwnProperty(obj, v) {
|
||||
if (obj == null)
|
||||
return false;
|
||||
return Object.prototype.hasOwnProperty.call(obj, v);
|
||||
}
|
||||
|
||||
function createSingletonPromise(fn) {
|
||||
let _promise;
|
||||
function wrapper() {
|
||||
if (!_promise)
|
||||
_promise = fn();
|
||||
return _promise;
|
||||
}
|
||||
wrapper.reset = async () => {
|
||||
const _prev = _promise;
|
||||
_promise = void 0;
|
||||
if (_prev)
|
||||
await _prev;
|
||||
};
|
||||
return wrapper;
|
||||
}
|
||||
function sleep(ms, callback) {
|
||||
return new Promise(
|
||||
(resolve) => setTimeout(async () => {
|
||||
await (callback == null ? void 0 : callback());
|
||||
resolve();
|
||||
}, ms)
|
||||
);
|
||||
}
|
||||
function createPromiseLock() {
|
||||
const locks = [];
|
||||
return {
|
||||
async run(fn) {
|
||||
const p = fn();
|
||||
locks.push(p);
|
||||
try {
|
||||
return await p;
|
||||
} finally {
|
||||
remove(locks, p);
|
||||
}
|
||||
},
|
||||
async wait() {
|
||||
await Promise.allSettled(locks);
|
||||
},
|
||||
isWaiting() {
|
||||
return Boolean(locks.length);
|
||||
},
|
||||
clear() {
|
||||
locks.length = 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
function createControlledPromise() {
|
||||
let resolve, reject;
|
||||
const promise = new Promise((_resolve, _reject) => {
|
||||
resolve = _resolve;
|
||||
reject = _reject;
|
||||
});
|
||||
promise.resolve = resolve;
|
||||
promise.reject = reject;
|
||||
return promise;
|
||||
}
|
||||
|
||||
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
||||
|
||||
/**
|
||||
* Throttle execution of a function. Especially useful for rate limiting
|
||||
* execution of handlers on events like resize and scroll.
|
||||
*
|
||||
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
|
||||
* are most useful.
|
||||
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
|
||||
* as-is, to `callback` when the throttled-function is executed.
|
||||
* @param {object} [options] - An object to configure options.
|
||||
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
|
||||
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
|
||||
* one final time after the last throttled-function call. (After the throttled-function has not been called for
|
||||
* `delay` milliseconds, the internal counter is reset).
|
||||
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
|
||||
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
|
||||
* callback will never executed if both noLeading = true and noTrailing = true.
|
||||
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
|
||||
* false (at end), schedule `callback` to execute after `delay` ms.
|
||||
*
|
||||
* @returns {Function} A new, throttled, function.
|
||||
*/
|
||||
function throttle (delay, callback, options) {
|
||||
var _ref = options || {},
|
||||
_ref$noTrailing = _ref.noTrailing,
|
||||
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
|
||||
_ref$noLeading = _ref.noLeading,
|
||||
noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
|
||||
_ref$debounceMode = _ref.debounceMode,
|
||||
debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
|
||||
/*
|
||||
* After wrapper has stopped being called, this timeout ensures that
|
||||
* `callback` is executed at the proper times in `throttle` and `end`
|
||||
* debounce modes.
|
||||
*/
|
||||
|
||||
|
||||
var timeoutID;
|
||||
var cancelled = false; // Keep track of the last time `callback` was executed.
|
||||
|
||||
var lastExec = 0; // Function to clear existing timeout
|
||||
|
||||
function clearExistingTimeout() {
|
||||
if (timeoutID) {
|
||||
clearTimeout(timeoutID);
|
||||
}
|
||||
} // Function to cancel next exec
|
||||
|
||||
|
||||
function cancel(options) {
|
||||
var _ref2 = options || {},
|
||||
_ref2$upcomingOnly = _ref2.upcomingOnly,
|
||||
upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
|
||||
|
||||
clearExistingTimeout();
|
||||
cancelled = !upcomingOnly;
|
||||
}
|
||||
/*
|
||||
* The `wrapper` function encapsulates all of the throttling / debouncing
|
||||
* functionality and when executed will limit the rate at which `callback`
|
||||
* is executed.
|
||||
*/
|
||||
|
||||
|
||||
function wrapper() {
|
||||
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
arguments_[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var elapsed = Date.now() - lastExec;
|
||||
|
||||
if (cancelled) {
|
||||
return;
|
||||
} // Execute `callback` and update the `lastExec` timestamp.
|
||||
|
||||
|
||||
function exec() {
|
||||
lastExec = Date.now();
|
||||
callback.apply(self, arguments_);
|
||||
}
|
||||
/*
|
||||
* If `debounceMode` is true (at begin) this is used to clear the flag
|
||||
* to allow future `callback` executions.
|
||||
*/
|
||||
|
||||
|
||||
function clear() {
|
||||
timeoutID = undefined;
|
||||
}
|
||||
|
||||
if (!noLeading && debounceMode && !timeoutID) {
|
||||
/*
|
||||
* Since `wrapper` is being called for the first time and
|
||||
* `debounceMode` is true (at begin), execute `callback`
|
||||
* and noLeading != true.
|
||||
*/
|
||||
exec();
|
||||
}
|
||||
|
||||
clearExistingTimeout();
|
||||
|
||||
if (debounceMode === undefined && elapsed > delay) {
|
||||
if (noLeading) {
|
||||
/*
|
||||
* In throttle mode with noLeading, if `delay` time has
|
||||
* been exceeded, update `lastExec` and schedule `callback`
|
||||
* to execute after `delay` ms.
|
||||
*/
|
||||
lastExec = Date.now();
|
||||
|
||||
if (!noTrailing) {
|
||||
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
|
||||
* `callback`.
|
||||
*/
|
||||
exec();
|
||||
}
|
||||
} else if (noTrailing !== true) {
|
||||
/*
|
||||
* In trailing throttle mode, since `delay` time has not been
|
||||
* exceeded, schedule `callback` to execute `delay` ms after most
|
||||
* recent execution.
|
||||
*
|
||||
* If `debounceMode` is true (at begin), schedule `clear` to execute
|
||||
* after `delay` ms.
|
||||
*
|
||||
* If `debounceMode` is false (at end), schedule `callback` to
|
||||
* execute after `delay` ms.
|
||||
*/
|
||||
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
||||
}
|
||||
}
|
||||
|
||||
wrapper.cancel = cancel; // Return the wrapper function.
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
/* eslint-disable no-undefined */
|
||||
/**
|
||||
* Debounce execution of a function. Debouncing, unlike throttling,
|
||||
* guarantees that a function is only executed a single time, either at the
|
||||
* very beginning of a series of calls, or at the very end.
|
||||
*
|
||||
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
||||
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
|
||||
* to `callback` when the debounced-function is executed.
|
||||
* @param {object} [options] - An object to configure options.
|
||||
* @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
|
||||
* after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
|
||||
* (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
|
||||
*
|
||||
* @returns {Function} A new, debounced function.
|
||||
*/
|
||||
|
||||
function debounce (delay, callback, options) {
|
||||
var _ref = options || {},
|
||||
_ref$atBegin = _ref.atBegin,
|
||||
atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
|
||||
|
||||
return throttle(delay, callback, {
|
||||
debounceMode: atBegin !== false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
How it works:
|
||||
`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.
|
||||
*/
|
||||
|
||||
class Node {
|
||||
value;
|
||||
next;
|
||||
|
||||
constructor(value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Queue {
|
||||
#head;
|
||||
#tail;
|
||||
#size;
|
||||
|
||||
constructor() {
|
||||
this.clear();
|
||||
}
|
||||
|
||||
enqueue(value) {
|
||||
const node = new Node(value);
|
||||
|
||||
if (this.#head) {
|
||||
this.#tail.next = node;
|
||||
this.#tail = node;
|
||||
} else {
|
||||
this.#head = node;
|
||||
this.#tail = node;
|
||||
}
|
||||
|
||||
this.#size++;
|
||||
}
|
||||
|
||||
dequeue() {
|
||||
const current = this.#head;
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.#head = this.#head.next;
|
||||
this.#size--;
|
||||
return current.value;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.#head = undefined;
|
||||
this.#tail = undefined;
|
||||
this.#size = 0;
|
||||
}
|
||||
|
||||
get size() {
|
||||
return this.#size;
|
||||
}
|
||||
|
||||
* [Symbol.iterator]() {
|
||||
let current = this.#head;
|
||||
|
||||
while (current) {
|
||||
yield current.value;
|
||||
current = current.next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const AsyncResource = {
|
||||
bind(fn, _type, thisArg) {
|
||||
return fn.bind(thisArg);
|
||||
},
|
||||
};
|
||||
|
||||
function pLimit(concurrency) {
|
||||
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
||||
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
|
||||
}
|
||||
|
||||
const queue = new Queue();
|
||||
let activeCount = 0;
|
||||
|
||||
const next = () => {
|
||||
activeCount--;
|
||||
|
||||
if (queue.size > 0) {
|
||||
queue.dequeue()();
|
||||
}
|
||||
};
|
||||
|
||||
const run = async (function_, resolve, arguments_) => {
|
||||
activeCount++;
|
||||
|
||||
const result = (async () => function_(...arguments_))();
|
||||
|
||||
resolve(result);
|
||||
|
||||
try {
|
||||
await result;
|
||||
} catch {}
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
const enqueue = (function_, resolve, arguments_) => {
|
||||
queue.enqueue(
|
||||
AsyncResource.bind(run.bind(undefined, function_, resolve, arguments_)),
|
||||
);
|
||||
|
||||
(async () => {
|
||||
// This function needs to wait until the next microtask before comparing
|
||||
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
||||
// when the run function is dequeued and called. The comparison in the if-statement
|
||||
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
||||
await Promise.resolve();
|
||||
|
||||
if (activeCount < concurrency && queue.size > 0) {
|
||||
queue.dequeue()();
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
const generator = (function_, ...arguments_) => new Promise(resolve => {
|
||||
enqueue(function_, resolve, arguments_);
|
||||
});
|
||||
|
||||
Object.defineProperties(generator, {
|
||||
activeCount: {
|
||||
get: () => activeCount,
|
||||
},
|
||||
pendingCount: {
|
||||
get: () => queue.size,
|
||||
},
|
||||
clearQueue: {
|
||||
value() {
|
||||
queue.clear();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return generator;
|
||||
}
|
||||
|
||||
const VOID = Symbol("p-void");
|
||||
class PInstance extends Promise {
|
||||
constructor(items = [], options) {
|
||||
super(() => {
|
||||
});
|
||||
this.items = items;
|
||||
this.options = options;
|
||||
this.promises = /* @__PURE__ */ new Set();
|
||||
}
|
||||
get promise() {
|
||||
var _a;
|
||||
let batch;
|
||||
const items = [...Array.from(this.items), ...Array.from(this.promises)];
|
||||
if ((_a = this.options) == null ? void 0 : _a.concurrency) {
|
||||
const limit = pLimit(this.options.concurrency);
|
||||
batch = Promise.all(items.map((p2) => limit(() => p2)));
|
||||
} else {
|
||||
batch = Promise.all(items);
|
||||
}
|
||||
return batch.then((l) => l.filter((i) => i !== VOID));
|
||||
}
|
||||
add(...args) {
|
||||
args.forEach((i) => {
|
||||
this.promises.add(i);
|
||||
});
|
||||
}
|
||||
map(fn) {
|
||||
return new PInstance(
|
||||
Array.from(this.items).map(async (i, idx) => {
|
||||
const v = await i;
|
||||
if (v === VOID)
|
||||
return VOID;
|
||||
return fn(v, idx);
|
||||
}),
|
||||
this.options
|
||||
);
|
||||
}
|
||||
filter(fn) {
|
||||
return new PInstance(
|
||||
Array.from(this.items).map(async (i, idx) => {
|
||||
const v = await i;
|
||||
const r = await fn(v, idx);
|
||||
if (!r)
|
||||
return VOID;
|
||||
return v;
|
||||
}),
|
||||
this.options
|
||||
);
|
||||
}
|
||||
forEach(fn) {
|
||||
return this.map(fn).then();
|
||||
}
|
||||
reduce(fn, initialValue) {
|
||||
return this.promise.then((array) => array.reduce(fn, initialValue));
|
||||
}
|
||||
clear() {
|
||||
this.promises.clear();
|
||||
}
|
||||
then(fn) {
|
||||
const p2 = this.promise;
|
||||
if (fn)
|
||||
return p2.then(fn);
|
||||
else
|
||||
return p2;
|
||||
}
|
||||
catch(fn) {
|
||||
return this.promise.catch(fn);
|
||||
}
|
||||
finally(fn) {
|
||||
return this.promise.finally(fn);
|
||||
}
|
||||
}
|
||||
function p(items, options) {
|
||||
return new PInstance(items, options);
|
||||
}
|
||||
|
||||
exports.assert = assert;
|
||||
exports.at = at;
|
||||
exports.batchInvoke = batchInvoke;
|
||||
exports.capitalize = capitalize;
|
||||
exports.clamp = clamp;
|
||||
exports.clampArrayRange = clampArrayRange;
|
||||
exports.clearUndefined = clearUndefined;
|
||||
exports.createControlledPromise = createControlledPromise;
|
||||
exports.createPromiseLock = createPromiseLock;
|
||||
exports.createSingletonPromise = createSingletonPromise;
|
||||
exports.debounce = debounce;
|
||||
exports.deepMerge = deepMerge;
|
||||
exports.deepMergeWithArray = deepMergeWithArray;
|
||||
exports.ensurePrefix = ensurePrefix;
|
||||
exports.ensureSuffix = ensureSuffix;
|
||||
exports.flattenArrayable = flattenArrayable;
|
||||
exports.getTypeName = getTypeName;
|
||||
exports.hasOwnProperty = hasOwnProperty;
|
||||
exports.invoke = invoke;
|
||||
exports.isBoolean = isBoolean;
|
||||
exports.isBrowser = isBrowser;
|
||||
exports.isDate = isDate;
|
||||
exports.isDeepEqual = isDeepEqual;
|
||||
exports.isDef = isDef;
|
||||
exports.isFunction = isFunction;
|
||||
exports.isKeyOf = isKeyOf;
|
||||
exports.isNull = isNull;
|
||||
exports.isNumber = isNumber;
|
||||
exports.isObject = isObject;
|
||||
exports.isRegExp = isRegExp;
|
||||
exports.isString = isString;
|
||||
exports.isTruthy = isTruthy;
|
||||
exports.isUndefined = isUndefined;
|
||||
exports.isWindow = isWindow;
|
||||
exports.last = last;
|
||||
exports.lerp = lerp;
|
||||
exports.mergeArrayable = mergeArrayable;
|
||||
exports.move = move;
|
||||
exports.noNull = noNull;
|
||||
exports.noop = noop;
|
||||
exports.notNullish = notNullish;
|
||||
exports.notUndefined = notUndefined;
|
||||
exports.objectEntries = objectEntries;
|
||||
exports.objectKeys = objectKeys;
|
||||
exports.objectMap = objectMap;
|
||||
exports.objectPick = objectPick;
|
||||
exports.p = p;
|
||||
exports.partition = partition;
|
||||
exports.randomStr = randomStr;
|
||||
exports.range = range;
|
||||
exports.remap = remap;
|
||||
exports.remove = remove;
|
||||
exports.sample = sample;
|
||||
exports.shuffle = shuffle;
|
||||
exports.slash = slash;
|
||||
exports.sleep = sleep;
|
||||
exports.sum = sum;
|
||||
exports.tap = tap;
|
||||
exports.template = template;
|
||||
exports.throttle = throttle;
|
||||
exports.timestamp = timestamp;
|
||||
exports.toArray = toArray;
|
||||
exports.toString = toString;
|
||||
exports.unindent = unindent;
|
||||
exports.uniq = uniq;
|
||||
exports.uniqueBy = uniqueBy;
|
||||
614
web/admin-spa/node_modules/@antfu/utils/dist/index.d.cts
generated
vendored
614
web/admin-spa/node_modules/@antfu/utils/dist/index.d.cts
generated
vendored
@@ -1,614 +0,0 @@
|
||||
/**
|
||||
* Promise, or maybe not
|
||||
*/
|
||||
type Awaitable<T> = T | PromiseLike<T>;
|
||||
/**
|
||||
* Null or whatever
|
||||
*/
|
||||
type Nullable<T> = T | null | undefined;
|
||||
/**
|
||||
* Array, or not yet
|
||||
*/
|
||||
type Arrayable<T> = T | Array<T>;
|
||||
/**
|
||||
* Function
|
||||
*/
|
||||
type Fn<T = void> = () => T;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
type Constructor<T = void> = new (...args: any[]) => T;
|
||||
/**
|
||||
* Infers the element type of an array
|
||||
*/
|
||||
type ElementOf<T> = T extends (infer E)[] ? E : never;
|
||||
/**
|
||||
* Defines an intersection type of all union items.
|
||||
*
|
||||
* @param U Union of any types that will be intersected.
|
||||
* @returns U items intersected
|
||||
* @see https://stackoverflow.com/a/50375286/9259330
|
||||
*/
|
||||
type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
/**
|
||||
* Infers the arguments type of a function
|
||||
*/
|
||||
type ArgumentsType<T> = T extends ((...args: infer A) => any) ? A : never;
|
||||
type MergeInsertions<T> = T extends object ? {
|
||||
[K in keyof T]: MergeInsertions<T[K]>;
|
||||
} : T;
|
||||
type DeepMerge<F, S> = MergeInsertions<{
|
||||
[K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Convert `Arrayable<T>` to `Array<T>`
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T>;
|
||||
/**
|
||||
* Convert `Arrayable<T>` to `Array<T>` and flatten it
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function flattenArrayable<T>(array?: Nullable<Arrayable<T | Array<T>>>): Array<T>;
|
||||
/**
|
||||
* Use rest arguments to merge arrays
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function mergeArrayable<T>(...args: Nullable<Arrayable<T>>[]): Array<T>;
|
||||
type PartitionFilter<T> = (i: T, idx: number, arr: readonly T[]) => any;
|
||||
/**
|
||||
* Divide an array into two parts by a filter function
|
||||
*
|
||||
* @category Array
|
||||
* @example const [odd, even] = partition([1, 2, 3, 4], i => i % 2 != 0)
|
||||
*/
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>): [T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>): [T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>): [T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>): [T[], T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>, f5: PartitionFilter<T>): [T[], T[], T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>, f5: PartitionFilter<T>, f6: PartitionFilter<T>): [T[], T[], T[], T[], T[], T[], T[]];
|
||||
/**
|
||||
* Unique an Array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function uniq<T>(array: readonly T[]): T[];
|
||||
/**
|
||||
* Unique an Array by a custom equality function
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function uniqueBy<T>(array: readonly T[], equalFn: (a: any, b: any) => boolean): T[];
|
||||
/**
|
||||
* Get last item
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function last(array: readonly []): undefined;
|
||||
declare function last<T>(array: readonly T[]): T;
|
||||
/**
|
||||
* Remove an item from Array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function remove<T>(array: T[], value: T): boolean;
|
||||
/**
|
||||
* Get nth item of Array. Negative for backward
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function at(array: readonly [], index: number): undefined;
|
||||
declare function at<T>(array: readonly T[], index: number): T;
|
||||
/**
|
||||
* Genrate a range array of numbers. The `stop` is exclusive.
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function range(stop: number): number[];
|
||||
declare function range(start: number, stop: number, step?: number): number[];
|
||||
/**
|
||||
* Move element in an Array
|
||||
*
|
||||
* @category Array
|
||||
* @param arr
|
||||
* @param from
|
||||
* @param to
|
||||
*/
|
||||
declare function move<T>(arr: T[], from: number, to: number): T[];
|
||||
/**
|
||||
* Clamp a number to the index range of an array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function clampArrayRange(n: number, arr: readonly unknown[]): number;
|
||||
/**
|
||||
* Get random item(s) from an array
|
||||
*
|
||||
* @param arr
|
||||
* @param quantity - quantity of random items which will be returned
|
||||
*/
|
||||
declare function sample<T>(arr: T[], quantity: number): T[];
|
||||
/**
|
||||
* Shuffle an array. This function mutates the array.
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function shuffle<T>(array: T[]): T[];
|
||||
|
||||
declare function assert(condition: boolean, message: string): asserts condition;
|
||||
declare const toString: (v: any) => string;
|
||||
declare function getTypeName(v: any): string;
|
||||
declare function noop(): void;
|
||||
|
||||
declare function isDeepEqual(value1: any, value2: any): boolean;
|
||||
|
||||
/**
|
||||
* Type guard to filter out null-ish values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(notNullish)
|
||||
*/
|
||||
declare function notNullish<T>(v: T | null | undefined): v is NonNullable<T>;
|
||||
/**
|
||||
* Type guard to filter out null values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(noNull)
|
||||
*/
|
||||
declare function noNull<T>(v: T | null): v is Exclude<T, null>;
|
||||
/**
|
||||
* Type guard to filter out null-ish values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(notUndefined)
|
||||
*/
|
||||
declare function notUndefined<T>(v: T): v is Exclude<T, undefined>;
|
||||
/**
|
||||
* Type guard to filter out falsy values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(isTruthy)
|
||||
*/
|
||||
declare function isTruthy<T>(v: T): v is NonNullable<T>;
|
||||
|
||||
declare const isDef: <T = any>(val?: T) => val is T;
|
||||
declare const isBoolean: (val: any) => val is boolean;
|
||||
declare const isFunction: <T extends Function>(val: any) => val is T;
|
||||
declare const isNumber: (val: any) => val is number;
|
||||
declare const isString: (val: unknown) => val is string;
|
||||
declare const isObject: (val: any) => val is object;
|
||||
declare const isUndefined: (val: any) => val is undefined;
|
||||
declare const isNull: (val: any) => val is null;
|
||||
declare const isRegExp: (val: any) => val is RegExp;
|
||||
declare const isDate: (val: any) => val is Date;
|
||||
declare const isWindow: (val: any) => boolean;
|
||||
declare const isBrowser: boolean;
|
||||
|
||||
declare function clamp(n: number, min: number, max: number): number;
|
||||
declare function sum(...args: number[] | number[][]): number;
|
||||
/**
|
||||
* Linearly interpolates between `min` and `max` based on `t`
|
||||
*
|
||||
* @category Math
|
||||
* @param min The minimum value
|
||||
* @param max The maximum value
|
||||
* @param t The interpolation value clamped between 0 and 1
|
||||
* @example
|
||||
* ```
|
||||
* const value = lerp(0, 2, 0.5) // value will be 1
|
||||
* ```
|
||||
*/
|
||||
declare function lerp(min: number, max: number, t: number): number;
|
||||
/**
|
||||
* Linearly remaps a clamped value from its source range [`inMin`, `inMax`] to the destination range [`outMin`, `outMax`]
|
||||
*
|
||||
* @category Math
|
||||
* @example
|
||||
* ```
|
||||
* const value = remap(0.5, 0, 1, 200, 400) // value will be 300
|
||||
* ```
|
||||
*/
|
||||
declare function remap(n: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
||||
|
||||
/**
|
||||
* Replace backslash to slash
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function slash(str: string): string;
|
||||
/**
|
||||
* Ensure prefix of a string
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function ensurePrefix(prefix: string, str: string): string;
|
||||
/**
|
||||
* Ensure suffix of a string
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function ensureSuffix(suffix: string, str: string): string;
|
||||
/**
|
||||
* Dead simple template engine, just like Python's `.format()`
|
||||
* Support passing variables as either in index based or object/name based approach
|
||||
* While using object/name based approach, you can pass a fallback value as the third argument
|
||||
*
|
||||
* @category String
|
||||
* @example
|
||||
* ```
|
||||
* const result = template(
|
||||
* 'Hello {0}! My name is {1}.',
|
||||
* 'Inès',
|
||||
* 'Anthony'
|
||||
* ) // Hello Inès! My name is Anthony.
|
||||
* ```
|
||||
*
|
||||
* ```
|
||||
* const result = namedTemplate(
|
||||
* '{greet}! My name is {name}.',
|
||||
* { greet: 'Hello', name: 'Anthony' }
|
||||
* ) // Hello! My name is Anthony.
|
||||
* ```
|
||||
*
|
||||
* const result = namedTemplate(
|
||||
* '{greet}! My name is {name}.',
|
||||
* { greet: 'Hello' }, // name isn't passed hence fallback will be used for name
|
||||
* 'placeholder'
|
||||
* ) // Hello! My name is placeholder.
|
||||
* ```
|
||||
*/
|
||||
declare function template(str: string, object: Record<string | number, any>, fallback?: string | ((key: string) => string)): string;
|
||||
declare function template(str: string, ...args: (string | number | bigint | undefined | null)[]): string;
|
||||
/**
|
||||
* Generate a random string
|
||||
* @category String
|
||||
*/
|
||||
declare function randomStr(size?: number, dict?: string): string;
|
||||
/**
|
||||
* First letter uppercase, other lowercase
|
||||
* @category string
|
||||
* @example
|
||||
* ```
|
||||
* capitalize('hello') => 'Hello'
|
||||
* ```
|
||||
*/
|
||||
declare function capitalize(str: string): string;
|
||||
/**
|
||||
* Remove common leading whitespace from a template string.
|
||||
* Will also remove empty lines at the beginning and end.
|
||||
* @category string
|
||||
* @example
|
||||
* ```ts
|
||||
* const str = unindent`
|
||||
* if (a) {
|
||||
* b()
|
||||
* }
|
||||
* `
|
||||
*/
|
||||
declare function unindent(str: TemplateStringsArray | string): string;
|
||||
|
||||
declare const timestamp: () => number;
|
||||
|
||||
/**
|
||||
* Call every function in an array
|
||||
*/
|
||||
declare function batchInvoke(functions: Nullable<Fn>[]): void;
|
||||
/**
|
||||
* Call the function
|
||||
*/
|
||||
declare function invoke(fn: Fn): void;
|
||||
/**
|
||||
* Pass the value through the callback, and return the value
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* function createUser(name: string): User {
|
||||
* return tap(new User, user => {
|
||||
* user.name = name
|
||||
* })
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
declare function tap<T>(value: T, callback: (value: T) => void): T;
|
||||
|
||||
/**
|
||||
* Map key/value pairs for an object, and construct a new one
|
||||
*
|
||||
*
|
||||
* @category Object
|
||||
*
|
||||
* Transform:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => [k.toString().toUpperCase(), v.toString()])
|
||||
* // { A: '1', B: '2' }
|
||||
* ```
|
||||
*
|
||||
* Swap key/value:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => [v, k])
|
||||
* // { 1: 'a', 2: 'b' }
|
||||
* ```
|
||||
*
|
||||
* Filter keys:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => k === 'a' ? undefined : [k, v])
|
||||
* // { b: 2 }
|
||||
* ```
|
||||
*/
|
||||
declare function objectMap<K extends string, V, NK extends string | number | symbol = K, NV = V>(obj: Record<K, V>, fn: (key: K, value: V) => [NK, NV] | undefined): Record<NK, NV>;
|
||||
/**
|
||||
* Type guard for any key, `k`.
|
||||
* Marks `k` as a key of `T` if `k` is in `obj`.
|
||||
*
|
||||
* @category Object
|
||||
* @param obj object to query for key `k`
|
||||
* @param k key to check existence in `obj`
|
||||
*/
|
||||
declare function isKeyOf<T extends object>(obj: T, k: keyof any): k is keyof T;
|
||||
/**
|
||||
* Strict typed `Object.keys`
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectKeys<T extends object>(obj: T): (`${keyof T & undefined}` | `${keyof T & null}` | `${keyof T & string}` | `${keyof T & number}` | `${keyof T & false}` | `${keyof T & true}`)[];
|
||||
/**
|
||||
* Strict typed `Object.entries`
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectEntries<T extends object>(obj: T): [keyof T, T[keyof T]][];
|
||||
/**
|
||||
* Deep merge
|
||||
*
|
||||
* The first argument is the target object, the rest are the sources.
|
||||
* The target object will be mutated and returned.
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function deepMerge<T extends object = object, S extends object = T>(target: T, ...sources: S[]): DeepMerge<T, S>;
|
||||
/**
|
||||
* Deep merge
|
||||
*
|
||||
* Differs from `deepMerge` in that it merges arrays instead of overriding them.
|
||||
*
|
||||
* The first argument is the target object, the rest are the sources.
|
||||
* The target object will be mutated and returned.
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function deepMergeWithArray<T extends object = object, S extends object = T>(target: T, ...sources: S[]): DeepMerge<T, S>;
|
||||
/**
|
||||
* Create a new subset object by giving keys
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Pick<O, T>;
|
||||
/**
|
||||
* Clear undefined fields from an object. It mutates the object
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function clearUndefined<T extends object>(obj: T): T;
|
||||
/**
|
||||
* Determines whether an object has a property with the specified name
|
||||
*
|
||||
* @see https://eslint.org/docs/rules/no-prototype-builtins
|
||||
* @category Object
|
||||
*/
|
||||
declare function hasOwnProperty<T>(obj: T, v: PropertyKey): boolean;
|
||||
|
||||
interface SingletonPromiseReturn<T> {
|
||||
(): Promise<T>;
|
||||
/**
|
||||
* Reset current staled promise.
|
||||
* Await it to have proper shutdown.
|
||||
*/
|
||||
reset: () => Promise<void>;
|
||||
}
|
||||
/**
|
||||
* Create singleton promise function
|
||||
*
|
||||
* @category Promise
|
||||
*/
|
||||
declare function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromiseReturn<T>;
|
||||
/**
|
||||
* Promised `setTimeout`
|
||||
*
|
||||
* @category Promise
|
||||
*/
|
||||
declare function sleep(ms: number, callback?: Fn<any>): Promise<void>;
|
||||
/**
|
||||
* Create a promise lock
|
||||
*
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* const lock = createPromiseLock()
|
||||
*
|
||||
* lock.run(async () => {
|
||||
* await doSomething()
|
||||
* })
|
||||
*
|
||||
* // in anther context:
|
||||
* await lock.wait() // it will wait all tasking finished
|
||||
* ```
|
||||
*/
|
||||
declare function createPromiseLock(): {
|
||||
run<T = void>(fn: () => Promise<T>): Promise<T>;
|
||||
wait(): Promise<void>;
|
||||
isWaiting(): boolean;
|
||||
clear(): void;
|
||||
};
|
||||
/**
|
||||
* Promise with `resolve` and `reject` methods of itself
|
||||
*/
|
||||
interface ControlledPromise<T = void> extends Promise<T> {
|
||||
resolve: (value: T | PromiseLike<T>) => void;
|
||||
reject: (reason?: any) => void;
|
||||
}
|
||||
/**
|
||||
* Return a Promise with `resolve` and `reject` methods
|
||||
*
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* const promise = createControlledPromise()
|
||||
*
|
||||
* await promise
|
||||
*
|
||||
* // in anther context:
|
||||
* promise.resolve(data)
|
||||
* ```
|
||||
*/
|
||||
declare function createControlledPromise<T>(): ControlledPromise<T>;
|
||||
|
||||
interface CancelOptions {
|
||||
upcomingOnly?: boolean;
|
||||
}
|
||||
|
||||
interface Cancel {
|
||||
cancel: (options?: CancelOptions) => void;
|
||||
}
|
||||
|
||||
interface NoReturn<T extends (...args: any[]) => any> {
|
||||
(...args: Parameters<T>): void;
|
||||
}
|
||||
|
||||
interface ThrottleOptions {
|
||||
noTrailing?: boolean;
|
||||
noLeading?: boolean;
|
||||
debounceMode?: boolean;
|
||||
}
|
||||
|
||||
interface DebounceOptions {
|
||||
atBegin?: boolean;
|
||||
}
|
||||
|
||||
type throttle<T extends (...args: any[]) => any> = NoReturn<T> & Cancel;
|
||||
|
||||
/**
|
||||
* Throttle execution of a function. Especially useful for rate limiting
|
||||
* execution of handlers on events like resize and scroll.
|
||||
*
|
||||
* @param delay
|
||||
* A zero-or-greater delay in milliseconds. For event callbacks, values around
|
||||
* 100 or 250 (or even higher) are most useful.
|
||||
*
|
||||
* @param callback
|
||||
* A function to be executed after delay milliseconds. The `this` context and
|
||||
* all arguments are passed through, as-is, to `callback` when the
|
||||
* throttled-function is executed.
|
||||
*
|
||||
* @param options
|
||||
* An object to configure options.
|
||||
*
|
||||
* @param options.noTrailing
|
||||
* Optional, defaults to false. If noTrailing is true, callback will only execute
|
||||
* every `delay` milliseconds while the throttled-function is being called. If
|
||||
* noTrailing is false or unspecified, callback will be executed one final time
|
||||
* after the last throttled-function call. (After the throttled-function has not
|
||||
* been called for `delay` milliseconds, the internal counter is reset)
|
||||
*
|
||||
* @param options.noLeading
|
||||
* Optional, defaults to false. If noLeading is false, the first throttled-function
|
||||
* call will execute callback immediately. If noLeading is true, the first the
|
||||
* callback execution will be skipped. It should be noted that callback will never
|
||||
* executed if both noLeading = true and noTrailing = true.
|
||||
*
|
||||
* @param options.debounceMode If `debounceMode` is true (at begin), schedule
|
||||
* `callback` to execute after `delay` ms. If `debounceMode` is false (at end),
|
||||
* schedule `callback` to execute after `delay` ms.
|
||||
*
|
||||
* @return
|
||||
* A new, throttled, function.
|
||||
*/
|
||||
declare function throttle<T extends (...args: any[]) => any>(
|
||||
delay: number,
|
||||
callback: T,
|
||||
options?: ThrottleOptions,
|
||||
): throttle<T>;
|
||||
type debounce<T extends (...args: any[]) => any> = NoReturn<T> & Cancel;
|
||||
|
||||
/**
|
||||
* Debounce execution of a function. Debouncing, unlike throttling,
|
||||
* guarantees that a function is only executed a single time, either at the
|
||||
* very beginning of a series of calls, or at the very end.
|
||||
*
|
||||
* @param delay
|
||||
* A zero-or-greater delay in milliseconds. For event callbacks, values around
|
||||
* 100 or 250 (or even higher) are most useful.
|
||||
*
|
||||
* @param callback
|
||||
* A function to be executed after delay milliseconds. The `this` context and
|
||||
* all arguments are passed through, as-is, to `callback` when the
|
||||
* debounced-function is executed.
|
||||
*
|
||||
* @param options
|
||||
* An object to configure options.
|
||||
*
|
||||
* @param options.atBegin
|
||||
* If atBegin is false or unspecified, callback will only be executed `delay`
|
||||
* milliseconds after the last debounced-function call. If atBegin is true,
|
||||
* callback will be executed only at the first debounced-function call. (After
|
||||
* the throttled-function has not been called for `delay` milliseconds, the
|
||||
* internal counter is reset).
|
||||
*
|
||||
* @return
|
||||
* A new, debounced function.
|
||||
*/
|
||||
declare function debounce<T extends (...args: any[]) => any>(
|
||||
delay: number,
|
||||
callback: T,
|
||||
options?: DebounceOptions,
|
||||
): debounce<T>;
|
||||
|
||||
interface POptions {
|
||||
/**
|
||||
* How many promises are resolved at the same time.
|
||||
*/
|
||||
concurrency?: number | undefined;
|
||||
}
|
||||
declare class PInstance<T = any> extends Promise<Awaited<T>[]> {
|
||||
items: Iterable<T>;
|
||||
options?: POptions | undefined;
|
||||
private promises;
|
||||
get promise(): Promise<Awaited<T>[]>;
|
||||
constructor(items?: Iterable<T>, options?: POptions | undefined);
|
||||
add(...args: (T | Promise<T>)[]): void;
|
||||
map<U>(fn: (value: Awaited<T>, index: number) => U): PInstance<Promise<U>>;
|
||||
filter(fn: (value: Awaited<T>, index: number) => boolean | Promise<boolean>): PInstance<Promise<T>>;
|
||||
forEach(fn: (value: Awaited<T>, index: number) => void): Promise<void>;
|
||||
reduce<U>(fn: (previousValue: U, currentValue: Awaited<T>, currentIndex: number, array: Awaited<T>[]) => U, initialValue: U): Promise<U>;
|
||||
clear(): void;
|
||||
then(fn?: () => PromiseLike<any>): Promise<any>;
|
||||
catch(fn?: (err: unknown) => PromiseLike<any>): Promise<any>;
|
||||
finally(fn?: () => void): Promise<Awaited<T>[]>;
|
||||
}
|
||||
/**
|
||||
* Utility for managing multiple promises.
|
||||
*
|
||||
* @see https://github.com/antfu/utils/tree/main/docs/p.md
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* import { p } from '@antfu/utils'
|
||||
*
|
||||
* const items = [1, 2, 3, 4, 5]
|
||||
*
|
||||
* await p(items)
|
||||
* .map(async i => await multiply(i, 3))
|
||||
* .filter(async i => await isEven(i))
|
||||
* // [6, 12]
|
||||
* ```
|
||||
*/
|
||||
declare function p<T = any>(items?: Iterable<T>, options?: POptions): PInstance<T>;
|
||||
|
||||
export { type ArgumentsType, type Arrayable, type Awaitable, type Constructor, type ControlledPromise, type DeepMerge, type ElementOf, type Fn, type MergeInsertions, type Nullable, type PartitionFilter, type SingletonPromiseReturn, type UnionToIntersection, assert, at, batchInvoke, capitalize, clamp, clampArrayRange, clearUndefined, createControlledPromise, createPromiseLock, createSingletonPromise, debounce, deepMerge, deepMergeWithArray, ensurePrefix, ensureSuffix, flattenArrayable, getTypeName, hasOwnProperty, invoke, isBoolean, isBrowser, isDate, isDeepEqual, isDef, isFunction, isKeyOf, isNull, isNumber, isObject, isRegExp, isString, isTruthy, isUndefined, isWindow, last, lerp, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, p, partition, randomStr, range, remap, remove, sample, shuffle, slash, sleep, sum, tap, template, throttle, timestamp, toArray, toString, unindent, uniq, uniqueBy };
|
||||
614
web/admin-spa/node_modules/@antfu/utils/dist/index.d.mts
generated
vendored
614
web/admin-spa/node_modules/@antfu/utils/dist/index.d.mts
generated
vendored
@@ -1,614 +0,0 @@
|
||||
/**
|
||||
* Promise, or maybe not
|
||||
*/
|
||||
type Awaitable<T> = T | PromiseLike<T>;
|
||||
/**
|
||||
* Null or whatever
|
||||
*/
|
||||
type Nullable<T> = T | null | undefined;
|
||||
/**
|
||||
* Array, or not yet
|
||||
*/
|
||||
type Arrayable<T> = T | Array<T>;
|
||||
/**
|
||||
* Function
|
||||
*/
|
||||
type Fn<T = void> = () => T;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
type Constructor<T = void> = new (...args: any[]) => T;
|
||||
/**
|
||||
* Infers the element type of an array
|
||||
*/
|
||||
type ElementOf<T> = T extends (infer E)[] ? E : never;
|
||||
/**
|
||||
* Defines an intersection type of all union items.
|
||||
*
|
||||
* @param U Union of any types that will be intersected.
|
||||
* @returns U items intersected
|
||||
* @see https://stackoverflow.com/a/50375286/9259330
|
||||
*/
|
||||
type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
/**
|
||||
* Infers the arguments type of a function
|
||||
*/
|
||||
type ArgumentsType<T> = T extends ((...args: infer A) => any) ? A : never;
|
||||
type MergeInsertions<T> = T extends object ? {
|
||||
[K in keyof T]: MergeInsertions<T[K]>;
|
||||
} : T;
|
||||
type DeepMerge<F, S> = MergeInsertions<{
|
||||
[K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Convert `Arrayable<T>` to `Array<T>`
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T>;
|
||||
/**
|
||||
* Convert `Arrayable<T>` to `Array<T>` and flatten it
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function flattenArrayable<T>(array?: Nullable<Arrayable<T | Array<T>>>): Array<T>;
|
||||
/**
|
||||
* Use rest arguments to merge arrays
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function mergeArrayable<T>(...args: Nullable<Arrayable<T>>[]): Array<T>;
|
||||
type PartitionFilter<T> = (i: T, idx: number, arr: readonly T[]) => any;
|
||||
/**
|
||||
* Divide an array into two parts by a filter function
|
||||
*
|
||||
* @category Array
|
||||
* @example const [odd, even] = partition([1, 2, 3, 4], i => i % 2 != 0)
|
||||
*/
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>): [T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>): [T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>): [T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>): [T[], T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>, f5: PartitionFilter<T>): [T[], T[], T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>, f5: PartitionFilter<T>, f6: PartitionFilter<T>): [T[], T[], T[], T[], T[], T[], T[]];
|
||||
/**
|
||||
* Unique an Array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function uniq<T>(array: readonly T[]): T[];
|
||||
/**
|
||||
* Unique an Array by a custom equality function
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function uniqueBy<T>(array: readonly T[], equalFn: (a: any, b: any) => boolean): T[];
|
||||
/**
|
||||
* Get last item
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function last(array: readonly []): undefined;
|
||||
declare function last<T>(array: readonly T[]): T;
|
||||
/**
|
||||
* Remove an item from Array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function remove<T>(array: T[], value: T): boolean;
|
||||
/**
|
||||
* Get nth item of Array. Negative for backward
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function at(array: readonly [], index: number): undefined;
|
||||
declare function at<T>(array: readonly T[], index: number): T;
|
||||
/**
|
||||
* Genrate a range array of numbers. The `stop` is exclusive.
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function range(stop: number): number[];
|
||||
declare function range(start: number, stop: number, step?: number): number[];
|
||||
/**
|
||||
* Move element in an Array
|
||||
*
|
||||
* @category Array
|
||||
* @param arr
|
||||
* @param from
|
||||
* @param to
|
||||
*/
|
||||
declare function move<T>(arr: T[], from: number, to: number): T[];
|
||||
/**
|
||||
* Clamp a number to the index range of an array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function clampArrayRange(n: number, arr: readonly unknown[]): number;
|
||||
/**
|
||||
* Get random item(s) from an array
|
||||
*
|
||||
* @param arr
|
||||
* @param quantity - quantity of random items which will be returned
|
||||
*/
|
||||
declare function sample<T>(arr: T[], quantity: number): T[];
|
||||
/**
|
||||
* Shuffle an array. This function mutates the array.
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function shuffle<T>(array: T[]): T[];
|
||||
|
||||
declare function assert(condition: boolean, message: string): asserts condition;
|
||||
declare const toString: (v: any) => string;
|
||||
declare function getTypeName(v: any): string;
|
||||
declare function noop(): void;
|
||||
|
||||
declare function isDeepEqual(value1: any, value2: any): boolean;
|
||||
|
||||
/**
|
||||
* Type guard to filter out null-ish values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(notNullish)
|
||||
*/
|
||||
declare function notNullish<T>(v: T | null | undefined): v is NonNullable<T>;
|
||||
/**
|
||||
* Type guard to filter out null values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(noNull)
|
||||
*/
|
||||
declare function noNull<T>(v: T | null): v is Exclude<T, null>;
|
||||
/**
|
||||
* Type guard to filter out null-ish values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(notUndefined)
|
||||
*/
|
||||
declare function notUndefined<T>(v: T): v is Exclude<T, undefined>;
|
||||
/**
|
||||
* Type guard to filter out falsy values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(isTruthy)
|
||||
*/
|
||||
declare function isTruthy<T>(v: T): v is NonNullable<T>;
|
||||
|
||||
declare const isDef: <T = any>(val?: T) => val is T;
|
||||
declare const isBoolean: (val: any) => val is boolean;
|
||||
declare const isFunction: <T extends Function>(val: any) => val is T;
|
||||
declare const isNumber: (val: any) => val is number;
|
||||
declare const isString: (val: unknown) => val is string;
|
||||
declare const isObject: (val: any) => val is object;
|
||||
declare const isUndefined: (val: any) => val is undefined;
|
||||
declare const isNull: (val: any) => val is null;
|
||||
declare const isRegExp: (val: any) => val is RegExp;
|
||||
declare const isDate: (val: any) => val is Date;
|
||||
declare const isWindow: (val: any) => boolean;
|
||||
declare const isBrowser: boolean;
|
||||
|
||||
declare function clamp(n: number, min: number, max: number): number;
|
||||
declare function sum(...args: number[] | number[][]): number;
|
||||
/**
|
||||
* Linearly interpolates between `min` and `max` based on `t`
|
||||
*
|
||||
* @category Math
|
||||
* @param min The minimum value
|
||||
* @param max The maximum value
|
||||
* @param t The interpolation value clamped between 0 and 1
|
||||
* @example
|
||||
* ```
|
||||
* const value = lerp(0, 2, 0.5) // value will be 1
|
||||
* ```
|
||||
*/
|
||||
declare function lerp(min: number, max: number, t: number): number;
|
||||
/**
|
||||
* Linearly remaps a clamped value from its source range [`inMin`, `inMax`] to the destination range [`outMin`, `outMax`]
|
||||
*
|
||||
* @category Math
|
||||
* @example
|
||||
* ```
|
||||
* const value = remap(0.5, 0, 1, 200, 400) // value will be 300
|
||||
* ```
|
||||
*/
|
||||
declare function remap(n: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
||||
|
||||
/**
|
||||
* Replace backslash to slash
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function slash(str: string): string;
|
||||
/**
|
||||
* Ensure prefix of a string
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function ensurePrefix(prefix: string, str: string): string;
|
||||
/**
|
||||
* Ensure suffix of a string
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function ensureSuffix(suffix: string, str: string): string;
|
||||
/**
|
||||
* Dead simple template engine, just like Python's `.format()`
|
||||
* Support passing variables as either in index based or object/name based approach
|
||||
* While using object/name based approach, you can pass a fallback value as the third argument
|
||||
*
|
||||
* @category String
|
||||
* @example
|
||||
* ```
|
||||
* const result = template(
|
||||
* 'Hello {0}! My name is {1}.',
|
||||
* 'Inès',
|
||||
* 'Anthony'
|
||||
* ) // Hello Inès! My name is Anthony.
|
||||
* ```
|
||||
*
|
||||
* ```
|
||||
* const result = namedTemplate(
|
||||
* '{greet}! My name is {name}.',
|
||||
* { greet: 'Hello', name: 'Anthony' }
|
||||
* ) // Hello! My name is Anthony.
|
||||
* ```
|
||||
*
|
||||
* const result = namedTemplate(
|
||||
* '{greet}! My name is {name}.',
|
||||
* { greet: 'Hello' }, // name isn't passed hence fallback will be used for name
|
||||
* 'placeholder'
|
||||
* ) // Hello! My name is placeholder.
|
||||
* ```
|
||||
*/
|
||||
declare function template(str: string, object: Record<string | number, any>, fallback?: string | ((key: string) => string)): string;
|
||||
declare function template(str: string, ...args: (string | number | bigint | undefined | null)[]): string;
|
||||
/**
|
||||
* Generate a random string
|
||||
* @category String
|
||||
*/
|
||||
declare function randomStr(size?: number, dict?: string): string;
|
||||
/**
|
||||
* First letter uppercase, other lowercase
|
||||
* @category string
|
||||
* @example
|
||||
* ```
|
||||
* capitalize('hello') => 'Hello'
|
||||
* ```
|
||||
*/
|
||||
declare function capitalize(str: string): string;
|
||||
/**
|
||||
* Remove common leading whitespace from a template string.
|
||||
* Will also remove empty lines at the beginning and end.
|
||||
* @category string
|
||||
* @example
|
||||
* ```ts
|
||||
* const str = unindent`
|
||||
* if (a) {
|
||||
* b()
|
||||
* }
|
||||
* `
|
||||
*/
|
||||
declare function unindent(str: TemplateStringsArray | string): string;
|
||||
|
||||
declare const timestamp: () => number;
|
||||
|
||||
/**
|
||||
* Call every function in an array
|
||||
*/
|
||||
declare function batchInvoke(functions: Nullable<Fn>[]): void;
|
||||
/**
|
||||
* Call the function
|
||||
*/
|
||||
declare function invoke(fn: Fn): void;
|
||||
/**
|
||||
* Pass the value through the callback, and return the value
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* function createUser(name: string): User {
|
||||
* return tap(new User, user => {
|
||||
* user.name = name
|
||||
* })
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
declare function tap<T>(value: T, callback: (value: T) => void): T;
|
||||
|
||||
/**
|
||||
* Map key/value pairs for an object, and construct a new one
|
||||
*
|
||||
*
|
||||
* @category Object
|
||||
*
|
||||
* Transform:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => [k.toString().toUpperCase(), v.toString()])
|
||||
* // { A: '1', B: '2' }
|
||||
* ```
|
||||
*
|
||||
* Swap key/value:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => [v, k])
|
||||
* // { 1: 'a', 2: 'b' }
|
||||
* ```
|
||||
*
|
||||
* Filter keys:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => k === 'a' ? undefined : [k, v])
|
||||
* // { b: 2 }
|
||||
* ```
|
||||
*/
|
||||
declare function objectMap<K extends string, V, NK extends string | number | symbol = K, NV = V>(obj: Record<K, V>, fn: (key: K, value: V) => [NK, NV] | undefined): Record<NK, NV>;
|
||||
/**
|
||||
* Type guard for any key, `k`.
|
||||
* Marks `k` as a key of `T` if `k` is in `obj`.
|
||||
*
|
||||
* @category Object
|
||||
* @param obj object to query for key `k`
|
||||
* @param k key to check existence in `obj`
|
||||
*/
|
||||
declare function isKeyOf<T extends object>(obj: T, k: keyof any): k is keyof T;
|
||||
/**
|
||||
* Strict typed `Object.keys`
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectKeys<T extends object>(obj: T): (`${keyof T & undefined}` | `${keyof T & null}` | `${keyof T & string}` | `${keyof T & number}` | `${keyof T & false}` | `${keyof T & true}`)[];
|
||||
/**
|
||||
* Strict typed `Object.entries`
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectEntries<T extends object>(obj: T): [keyof T, T[keyof T]][];
|
||||
/**
|
||||
* Deep merge
|
||||
*
|
||||
* The first argument is the target object, the rest are the sources.
|
||||
* The target object will be mutated and returned.
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function deepMerge<T extends object = object, S extends object = T>(target: T, ...sources: S[]): DeepMerge<T, S>;
|
||||
/**
|
||||
* Deep merge
|
||||
*
|
||||
* Differs from `deepMerge` in that it merges arrays instead of overriding them.
|
||||
*
|
||||
* The first argument is the target object, the rest are the sources.
|
||||
* The target object will be mutated and returned.
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function deepMergeWithArray<T extends object = object, S extends object = T>(target: T, ...sources: S[]): DeepMerge<T, S>;
|
||||
/**
|
||||
* Create a new subset object by giving keys
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Pick<O, T>;
|
||||
/**
|
||||
* Clear undefined fields from an object. It mutates the object
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function clearUndefined<T extends object>(obj: T): T;
|
||||
/**
|
||||
* Determines whether an object has a property with the specified name
|
||||
*
|
||||
* @see https://eslint.org/docs/rules/no-prototype-builtins
|
||||
* @category Object
|
||||
*/
|
||||
declare function hasOwnProperty<T>(obj: T, v: PropertyKey): boolean;
|
||||
|
||||
interface SingletonPromiseReturn<T> {
|
||||
(): Promise<T>;
|
||||
/**
|
||||
* Reset current staled promise.
|
||||
* Await it to have proper shutdown.
|
||||
*/
|
||||
reset: () => Promise<void>;
|
||||
}
|
||||
/**
|
||||
* Create singleton promise function
|
||||
*
|
||||
* @category Promise
|
||||
*/
|
||||
declare function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromiseReturn<T>;
|
||||
/**
|
||||
* Promised `setTimeout`
|
||||
*
|
||||
* @category Promise
|
||||
*/
|
||||
declare function sleep(ms: number, callback?: Fn<any>): Promise<void>;
|
||||
/**
|
||||
* Create a promise lock
|
||||
*
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* const lock = createPromiseLock()
|
||||
*
|
||||
* lock.run(async () => {
|
||||
* await doSomething()
|
||||
* })
|
||||
*
|
||||
* // in anther context:
|
||||
* await lock.wait() // it will wait all tasking finished
|
||||
* ```
|
||||
*/
|
||||
declare function createPromiseLock(): {
|
||||
run<T = void>(fn: () => Promise<T>): Promise<T>;
|
||||
wait(): Promise<void>;
|
||||
isWaiting(): boolean;
|
||||
clear(): void;
|
||||
};
|
||||
/**
|
||||
* Promise with `resolve` and `reject` methods of itself
|
||||
*/
|
||||
interface ControlledPromise<T = void> extends Promise<T> {
|
||||
resolve: (value: T | PromiseLike<T>) => void;
|
||||
reject: (reason?: any) => void;
|
||||
}
|
||||
/**
|
||||
* Return a Promise with `resolve` and `reject` methods
|
||||
*
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* const promise = createControlledPromise()
|
||||
*
|
||||
* await promise
|
||||
*
|
||||
* // in anther context:
|
||||
* promise.resolve(data)
|
||||
* ```
|
||||
*/
|
||||
declare function createControlledPromise<T>(): ControlledPromise<T>;
|
||||
|
||||
interface CancelOptions {
|
||||
upcomingOnly?: boolean;
|
||||
}
|
||||
|
||||
interface Cancel {
|
||||
cancel: (options?: CancelOptions) => void;
|
||||
}
|
||||
|
||||
interface NoReturn<T extends (...args: any[]) => any> {
|
||||
(...args: Parameters<T>): void;
|
||||
}
|
||||
|
||||
interface ThrottleOptions {
|
||||
noTrailing?: boolean;
|
||||
noLeading?: boolean;
|
||||
debounceMode?: boolean;
|
||||
}
|
||||
|
||||
interface DebounceOptions {
|
||||
atBegin?: boolean;
|
||||
}
|
||||
|
||||
type throttle<T extends (...args: any[]) => any> = NoReturn<T> & Cancel;
|
||||
|
||||
/**
|
||||
* Throttle execution of a function. Especially useful for rate limiting
|
||||
* execution of handlers on events like resize and scroll.
|
||||
*
|
||||
* @param delay
|
||||
* A zero-or-greater delay in milliseconds. For event callbacks, values around
|
||||
* 100 or 250 (or even higher) are most useful.
|
||||
*
|
||||
* @param callback
|
||||
* A function to be executed after delay milliseconds. The `this` context and
|
||||
* all arguments are passed through, as-is, to `callback` when the
|
||||
* throttled-function is executed.
|
||||
*
|
||||
* @param options
|
||||
* An object to configure options.
|
||||
*
|
||||
* @param options.noTrailing
|
||||
* Optional, defaults to false. If noTrailing is true, callback will only execute
|
||||
* every `delay` milliseconds while the throttled-function is being called. If
|
||||
* noTrailing is false or unspecified, callback will be executed one final time
|
||||
* after the last throttled-function call. (After the throttled-function has not
|
||||
* been called for `delay` milliseconds, the internal counter is reset)
|
||||
*
|
||||
* @param options.noLeading
|
||||
* Optional, defaults to false. If noLeading is false, the first throttled-function
|
||||
* call will execute callback immediately. If noLeading is true, the first the
|
||||
* callback execution will be skipped. It should be noted that callback will never
|
||||
* executed if both noLeading = true and noTrailing = true.
|
||||
*
|
||||
* @param options.debounceMode If `debounceMode` is true (at begin), schedule
|
||||
* `callback` to execute after `delay` ms. If `debounceMode` is false (at end),
|
||||
* schedule `callback` to execute after `delay` ms.
|
||||
*
|
||||
* @return
|
||||
* A new, throttled, function.
|
||||
*/
|
||||
declare function throttle<T extends (...args: any[]) => any>(
|
||||
delay: number,
|
||||
callback: T,
|
||||
options?: ThrottleOptions,
|
||||
): throttle<T>;
|
||||
type debounce<T extends (...args: any[]) => any> = NoReturn<T> & Cancel;
|
||||
|
||||
/**
|
||||
* Debounce execution of a function. Debouncing, unlike throttling,
|
||||
* guarantees that a function is only executed a single time, either at the
|
||||
* very beginning of a series of calls, or at the very end.
|
||||
*
|
||||
* @param delay
|
||||
* A zero-or-greater delay in milliseconds. For event callbacks, values around
|
||||
* 100 or 250 (or even higher) are most useful.
|
||||
*
|
||||
* @param callback
|
||||
* A function to be executed after delay milliseconds. The `this` context and
|
||||
* all arguments are passed through, as-is, to `callback` when the
|
||||
* debounced-function is executed.
|
||||
*
|
||||
* @param options
|
||||
* An object to configure options.
|
||||
*
|
||||
* @param options.atBegin
|
||||
* If atBegin is false or unspecified, callback will only be executed `delay`
|
||||
* milliseconds after the last debounced-function call. If atBegin is true,
|
||||
* callback will be executed only at the first debounced-function call. (After
|
||||
* the throttled-function has not been called for `delay` milliseconds, the
|
||||
* internal counter is reset).
|
||||
*
|
||||
* @return
|
||||
* A new, debounced function.
|
||||
*/
|
||||
declare function debounce<T extends (...args: any[]) => any>(
|
||||
delay: number,
|
||||
callback: T,
|
||||
options?: DebounceOptions,
|
||||
): debounce<T>;
|
||||
|
||||
interface POptions {
|
||||
/**
|
||||
* How many promises are resolved at the same time.
|
||||
*/
|
||||
concurrency?: number | undefined;
|
||||
}
|
||||
declare class PInstance<T = any> extends Promise<Awaited<T>[]> {
|
||||
items: Iterable<T>;
|
||||
options?: POptions | undefined;
|
||||
private promises;
|
||||
get promise(): Promise<Awaited<T>[]>;
|
||||
constructor(items?: Iterable<T>, options?: POptions | undefined);
|
||||
add(...args: (T | Promise<T>)[]): void;
|
||||
map<U>(fn: (value: Awaited<T>, index: number) => U): PInstance<Promise<U>>;
|
||||
filter(fn: (value: Awaited<T>, index: number) => boolean | Promise<boolean>): PInstance<Promise<T>>;
|
||||
forEach(fn: (value: Awaited<T>, index: number) => void): Promise<void>;
|
||||
reduce<U>(fn: (previousValue: U, currentValue: Awaited<T>, currentIndex: number, array: Awaited<T>[]) => U, initialValue: U): Promise<U>;
|
||||
clear(): void;
|
||||
then(fn?: () => PromiseLike<any>): Promise<any>;
|
||||
catch(fn?: (err: unknown) => PromiseLike<any>): Promise<any>;
|
||||
finally(fn?: () => void): Promise<Awaited<T>[]>;
|
||||
}
|
||||
/**
|
||||
* Utility for managing multiple promises.
|
||||
*
|
||||
* @see https://github.com/antfu/utils/tree/main/docs/p.md
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* import { p } from '@antfu/utils'
|
||||
*
|
||||
* const items = [1, 2, 3, 4, 5]
|
||||
*
|
||||
* await p(items)
|
||||
* .map(async i => await multiply(i, 3))
|
||||
* .filter(async i => await isEven(i))
|
||||
* // [6, 12]
|
||||
* ```
|
||||
*/
|
||||
declare function p<T = any>(items?: Iterable<T>, options?: POptions): PInstance<T>;
|
||||
|
||||
export { type ArgumentsType, type Arrayable, type Awaitable, type Constructor, type ControlledPromise, type DeepMerge, type ElementOf, type Fn, type MergeInsertions, type Nullable, type PartitionFilter, type SingletonPromiseReturn, type UnionToIntersection, assert, at, batchInvoke, capitalize, clamp, clampArrayRange, clearUndefined, createControlledPromise, createPromiseLock, createSingletonPromise, debounce, deepMerge, deepMergeWithArray, ensurePrefix, ensureSuffix, flattenArrayable, getTypeName, hasOwnProperty, invoke, isBoolean, isBrowser, isDate, isDeepEqual, isDef, isFunction, isKeyOf, isNull, isNumber, isObject, isRegExp, isString, isTruthy, isUndefined, isWindow, last, lerp, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, p, partition, randomStr, range, remap, remove, sample, shuffle, slash, sleep, sum, tap, template, throttle, timestamp, toArray, toString, unindent, uniq, uniqueBy };
|
||||
614
web/admin-spa/node_modules/@antfu/utils/dist/index.d.ts
generated
vendored
614
web/admin-spa/node_modules/@antfu/utils/dist/index.d.ts
generated
vendored
@@ -1,614 +0,0 @@
|
||||
/**
|
||||
* Promise, or maybe not
|
||||
*/
|
||||
type Awaitable<T> = T | PromiseLike<T>;
|
||||
/**
|
||||
* Null or whatever
|
||||
*/
|
||||
type Nullable<T> = T | null | undefined;
|
||||
/**
|
||||
* Array, or not yet
|
||||
*/
|
||||
type Arrayable<T> = T | Array<T>;
|
||||
/**
|
||||
* Function
|
||||
*/
|
||||
type Fn<T = void> = () => T;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
type Constructor<T = void> = new (...args: any[]) => T;
|
||||
/**
|
||||
* Infers the element type of an array
|
||||
*/
|
||||
type ElementOf<T> = T extends (infer E)[] ? E : never;
|
||||
/**
|
||||
* Defines an intersection type of all union items.
|
||||
*
|
||||
* @param U Union of any types that will be intersected.
|
||||
* @returns U items intersected
|
||||
* @see https://stackoverflow.com/a/50375286/9259330
|
||||
*/
|
||||
type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
/**
|
||||
* Infers the arguments type of a function
|
||||
*/
|
||||
type ArgumentsType<T> = T extends ((...args: infer A) => any) ? A : never;
|
||||
type MergeInsertions<T> = T extends object ? {
|
||||
[K in keyof T]: MergeInsertions<T[K]>;
|
||||
} : T;
|
||||
type DeepMerge<F, S> = MergeInsertions<{
|
||||
[K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Convert `Arrayable<T>` to `Array<T>`
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T>;
|
||||
/**
|
||||
* Convert `Arrayable<T>` to `Array<T>` and flatten it
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function flattenArrayable<T>(array?: Nullable<Arrayable<T | Array<T>>>): Array<T>;
|
||||
/**
|
||||
* Use rest arguments to merge arrays
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function mergeArrayable<T>(...args: Nullable<Arrayable<T>>[]): Array<T>;
|
||||
type PartitionFilter<T> = (i: T, idx: number, arr: readonly T[]) => any;
|
||||
/**
|
||||
* Divide an array into two parts by a filter function
|
||||
*
|
||||
* @category Array
|
||||
* @example const [odd, even] = partition([1, 2, 3, 4], i => i % 2 != 0)
|
||||
*/
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>): [T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>): [T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>): [T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>): [T[], T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>, f5: PartitionFilter<T>): [T[], T[], T[], T[], T[], T[]];
|
||||
declare function partition<T>(array: readonly T[], f1: PartitionFilter<T>, f2: PartitionFilter<T>, f3: PartitionFilter<T>, f4: PartitionFilter<T>, f5: PartitionFilter<T>, f6: PartitionFilter<T>): [T[], T[], T[], T[], T[], T[], T[]];
|
||||
/**
|
||||
* Unique an Array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function uniq<T>(array: readonly T[]): T[];
|
||||
/**
|
||||
* Unique an Array by a custom equality function
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function uniqueBy<T>(array: readonly T[], equalFn: (a: any, b: any) => boolean): T[];
|
||||
/**
|
||||
* Get last item
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function last(array: readonly []): undefined;
|
||||
declare function last<T>(array: readonly T[]): T;
|
||||
/**
|
||||
* Remove an item from Array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function remove<T>(array: T[], value: T): boolean;
|
||||
/**
|
||||
* Get nth item of Array. Negative for backward
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function at(array: readonly [], index: number): undefined;
|
||||
declare function at<T>(array: readonly T[], index: number): T;
|
||||
/**
|
||||
* Genrate a range array of numbers. The `stop` is exclusive.
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function range(stop: number): number[];
|
||||
declare function range(start: number, stop: number, step?: number): number[];
|
||||
/**
|
||||
* Move element in an Array
|
||||
*
|
||||
* @category Array
|
||||
* @param arr
|
||||
* @param from
|
||||
* @param to
|
||||
*/
|
||||
declare function move<T>(arr: T[], from: number, to: number): T[];
|
||||
/**
|
||||
* Clamp a number to the index range of an array
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function clampArrayRange(n: number, arr: readonly unknown[]): number;
|
||||
/**
|
||||
* Get random item(s) from an array
|
||||
*
|
||||
* @param arr
|
||||
* @param quantity - quantity of random items which will be returned
|
||||
*/
|
||||
declare function sample<T>(arr: T[], quantity: number): T[];
|
||||
/**
|
||||
* Shuffle an array. This function mutates the array.
|
||||
*
|
||||
* @category Array
|
||||
*/
|
||||
declare function shuffle<T>(array: T[]): T[];
|
||||
|
||||
declare function assert(condition: boolean, message: string): asserts condition;
|
||||
declare const toString: (v: any) => string;
|
||||
declare function getTypeName(v: any): string;
|
||||
declare function noop(): void;
|
||||
|
||||
declare function isDeepEqual(value1: any, value2: any): boolean;
|
||||
|
||||
/**
|
||||
* Type guard to filter out null-ish values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(notNullish)
|
||||
*/
|
||||
declare function notNullish<T>(v: T | null | undefined): v is NonNullable<T>;
|
||||
/**
|
||||
* Type guard to filter out null values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(noNull)
|
||||
*/
|
||||
declare function noNull<T>(v: T | null): v is Exclude<T, null>;
|
||||
/**
|
||||
* Type guard to filter out null-ish values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(notUndefined)
|
||||
*/
|
||||
declare function notUndefined<T>(v: T): v is Exclude<T, undefined>;
|
||||
/**
|
||||
* Type guard to filter out falsy values
|
||||
*
|
||||
* @category Guards
|
||||
* @example array.filter(isTruthy)
|
||||
*/
|
||||
declare function isTruthy<T>(v: T): v is NonNullable<T>;
|
||||
|
||||
declare const isDef: <T = any>(val?: T) => val is T;
|
||||
declare const isBoolean: (val: any) => val is boolean;
|
||||
declare const isFunction: <T extends Function>(val: any) => val is T;
|
||||
declare const isNumber: (val: any) => val is number;
|
||||
declare const isString: (val: unknown) => val is string;
|
||||
declare const isObject: (val: any) => val is object;
|
||||
declare const isUndefined: (val: any) => val is undefined;
|
||||
declare const isNull: (val: any) => val is null;
|
||||
declare const isRegExp: (val: any) => val is RegExp;
|
||||
declare const isDate: (val: any) => val is Date;
|
||||
declare const isWindow: (val: any) => boolean;
|
||||
declare const isBrowser: boolean;
|
||||
|
||||
declare function clamp(n: number, min: number, max: number): number;
|
||||
declare function sum(...args: number[] | number[][]): number;
|
||||
/**
|
||||
* Linearly interpolates between `min` and `max` based on `t`
|
||||
*
|
||||
* @category Math
|
||||
* @param min The minimum value
|
||||
* @param max The maximum value
|
||||
* @param t The interpolation value clamped between 0 and 1
|
||||
* @example
|
||||
* ```
|
||||
* const value = lerp(0, 2, 0.5) // value will be 1
|
||||
* ```
|
||||
*/
|
||||
declare function lerp(min: number, max: number, t: number): number;
|
||||
/**
|
||||
* Linearly remaps a clamped value from its source range [`inMin`, `inMax`] to the destination range [`outMin`, `outMax`]
|
||||
*
|
||||
* @category Math
|
||||
* @example
|
||||
* ```
|
||||
* const value = remap(0.5, 0, 1, 200, 400) // value will be 300
|
||||
* ```
|
||||
*/
|
||||
declare function remap(n: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
||||
|
||||
/**
|
||||
* Replace backslash to slash
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function slash(str: string): string;
|
||||
/**
|
||||
* Ensure prefix of a string
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function ensurePrefix(prefix: string, str: string): string;
|
||||
/**
|
||||
* Ensure suffix of a string
|
||||
*
|
||||
* @category String
|
||||
*/
|
||||
declare function ensureSuffix(suffix: string, str: string): string;
|
||||
/**
|
||||
* Dead simple template engine, just like Python's `.format()`
|
||||
* Support passing variables as either in index based or object/name based approach
|
||||
* While using object/name based approach, you can pass a fallback value as the third argument
|
||||
*
|
||||
* @category String
|
||||
* @example
|
||||
* ```
|
||||
* const result = template(
|
||||
* 'Hello {0}! My name is {1}.',
|
||||
* 'Inès',
|
||||
* 'Anthony'
|
||||
* ) // Hello Inès! My name is Anthony.
|
||||
* ```
|
||||
*
|
||||
* ```
|
||||
* const result = namedTemplate(
|
||||
* '{greet}! My name is {name}.',
|
||||
* { greet: 'Hello', name: 'Anthony' }
|
||||
* ) // Hello! My name is Anthony.
|
||||
* ```
|
||||
*
|
||||
* const result = namedTemplate(
|
||||
* '{greet}! My name is {name}.',
|
||||
* { greet: 'Hello' }, // name isn't passed hence fallback will be used for name
|
||||
* 'placeholder'
|
||||
* ) // Hello! My name is placeholder.
|
||||
* ```
|
||||
*/
|
||||
declare function template(str: string, object: Record<string | number, any>, fallback?: string | ((key: string) => string)): string;
|
||||
declare function template(str: string, ...args: (string | number | bigint | undefined | null)[]): string;
|
||||
/**
|
||||
* Generate a random string
|
||||
* @category String
|
||||
*/
|
||||
declare function randomStr(size?: number, dict?: string): string;
|
||||
/**
|
||||
* First letter uppercase, other lowercase
|
||||
* @category string
|
||||
* @example
|
||||
* ```
|
||||
* capitalize('hello') => 'Hello'
|
||||
* ```
|
||||
*/
|
||||
declare function capitalize(str: string): string;
|
||||
/**
|
||||
* Remove common leading whitespace from a template string.
|
||||
* Will also remove empty lines at the beginning and end.
|
||||
* @category string
|
||||
* @example
|
||||
* ```ts
|
||||
* const str = unindent`
|
||||
* if (a) {
|
||||
* b()
|
||||
* }
|
||||
* `
|
||||
*/
|
||||
declare function unindent(str: TemplateStringsArray | string): string;
|
||||
|
||||
declare const timestamp: () => number;
|
||||
|
||||
/**
|
||||
* Call every function in an array
|
||||
*/
|
||||
declare function batchInvoke(functions: Nullable<Fn>[]): void;
|
||||
/**
|
||||
* Call the function
|
||||
*/
|
||||
declare function invoke(fn: Fn): void;
|
||||
/**
|
||||
* Pass the value through the callback, and return the value
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* function createUser(name: string): User {
|
||||
* return tap(new User, user => {
|
||||
* user.name = name
|
||||
* })
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
declare function tap<T>(value: T, callback: (value: T) => void): T;
|
||||
|
||||
/**
|
||||
* Map key/value pairs for an object, and construct a new one
|
||||
*
|
||||
*
|
||||
* @category Object
|
||||
*
|
||||
* Transform:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => [k.toString().toUpperCase(), v.toString()])
|
||||
* // { A: '1', B: '2' }
|
||||
* ```
|
||||
*
|
||||
* Swap key/value:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => [v, k])
|
||||
* // { 1: 'a', 2: 'b' }
|
||||
* ```
|
||||
*
|
||||
* Filter keys:
|
||||
* @example
|
||||
* ```
|
||||
* objectMap({ a: 1, b: 2 }, (k, v) => k === 'a' ? undefined : [k, v])
|
||||
* // { b: 2 }
|
||||
* ```
|
||||
*/
|
||||
declare function objectMap<K extends string, V, NK extends string | number | symbol = K, NV = V>(obj: Record<K, V>, fn: (key: K, value: V) => [NK, NV] | undefined): Record<NK, NV>;
|
||||
/**
|
||||
* Type guard for any key, `k`.
|
||||
* Marks `k` as a key of `T` if `k` is in `obj`.
|
||||
*
|
||||
* @category Object
|
||||
* @param obj object to query for key `k`
|
||||
* @param k key to check existence in `obj`
|
||||
*/
|
||||
declare function isKeyOf<T extends object>(obj: T, k: keyof any): k is keyof T;
|
||||
/**
|
||||
* Strict typed `Object.keys`
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectKeys<T extends object>(obj: T): (`${keyof T & undefined}` | `${keyof T & null}` | `${keyof T & string}` | `${keyof T & number}` | `${keyof T & false}` | `${keyof T & true}`)[];
|
||||
/**
|
||||
* Strict typed `Object.entries`
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectEntries<T extends object>(obj: T): [keyof T, T[keyof T]][];
|
||||
/**
|
||||
* Deep merge
|
||||
*
|
||||
* The first argument is the target object, the rest are the sources.
|
||||
* The target object will be mutated and returned.
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function deepMerge<T extends object = object, S extends object = T>(target: T, ...sources: S[]): DeepMerge<T, S>;
|
||||
/**
|
||||
* Deep merge
|
||||
*
|
||||
* Differs from `deepMerge` in that it merges arrays instead of overriding them.
|
||||
*
|
||||
* The first argument is the target object, the rest are the sources.
|
||||
* The target object will be mutated and returned.
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function deepMergeWithArray<T extends object = object, S extends object = T>(target: T, ...sources: S[]): DeepMerge<T, S>;
|
||||
/**
|
||||
* Create a new subset object by giving keys
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Pick<O, T>;
|
||||
/**
|
||||
* Clear undefined fields from an object. It mutates the object
|
||||
*
|
||||
* @category Object
|
||||
*/
|
||||
declare function clearUndefined<T extends object>(obj: T): T;
|
||||
/**
|
||||
* Determines whether an object has a property with the specified name
|
||||
*
|
||||
* @see https://eslint.org/docs/rules/no-prototype-builtins
|
||||
* @category Object
|
||||
*/
|
||||
declare function hasOwnProperty<T>(obj: T, v: PropertyKey): boolean;
|
||||
|
||||
interface SingletonPromiseReturn<T> {
|
||||
(): Promise<T>;
|
||||
/**
|
||||
* Reset current staled promise.
|
||||
* Await it to have proper shutdown.
|
||||
*/
|
||||
reset: () => Promise<void>;
|
||||
}
|
||||
/**
|
||||
* Create singleton promise function
|
||||
*
|
||||
* @category Promise
|
||||
*/
|
||||
declare function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromiseReturn<T>;
|
||||
/**
|
||||
* Promised `setTimeout`
|
||||
*
|
||||
* @category Promise
|
||||
*/
|
||||
declare function sleep(ms: number, callback?: Fn<any>): Promise<void>;
|
||||
/**
|
||||
* Create a promise lock
|
||||
*
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* const lock = createPromiseLock()
|
||||
*
|
||||
* lock.run(async () => {
|
||||
* await doSomething()
|
||||
* })
|
||||
*
|
||||
* // in anther context:
|
||||
* await lock.wait() // it will wait all tasking finished
|
||||
* ```
|
||||
*/
|
||||
declare function createPromiseLock(): {
|
||||
run<T = void>(fn: () => Promise<T>): Promise<T>;
|
||||
wait(): Promise<void>;
|
||||
isWaiting(): boolean;
|
||||
clear(): void;
|
||||
};
|
||||
/**
|
||||
* Promise with `resolve` and `reject` methods of itself
|
||||
*/
|
||||
interface ControlledPromise<T = void> extends Promise<T> {
|
||||
resolve: (value: T | PromiseLike<T>) => void;
|
||||
reject: (reason?: any) => void;
|
||||
}
|
||||
/**
|
||||
* Return a Promise with `resolve` and `reject` methods
|
||||
*
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* const promise = createControlledPromise()
|
||||
*
|
||||
* await promise
|
||||
*
|
||||
* // in anther context:
|
||||
* promise.resolve(data)
|
||||
* ```
|
||||
*/
|
||||
declare function createControlledPromise<T>(): ControlledPromise<T>;
|
||||
|
||||
interface CancelOptions {
|
||||
upcomingOnly?: boolean;
|
||||
}
|
||||
|
||||
interface Cancel {
|
||||
cancel: (options?: CancelOptions) => void;
|
||||
}
|
||||
|
||||
interface NoReturn<T extends (...args: any[]) => any> {
|
||||
(...args: Parameters<T>): void;
|
||||
}
|
||||
|
||||
interface ThrottleOptions {
|
||||
noTrailing?: boolean;
|
||||
noLeading?: boolean;
|
||||
debounceMode?: boolean;
|
||||
}
|
||||
|
||||
interface DebounceOptions {
|
||||
atBegin?: boolean;
|
||||
}
|
||||
|
||||
type throttle<T extends (...args: any[]) => any> = NoReturn<T> & Cancel;
|
||||
|
||||
/**
|
||||
* Throttle execution of a function. Especially useful for rate limiting
|
||||
* execution of handlers on events like resize and scroll.
|
||||
*
|
||||
* @param delay
|
||||
* A zero-or-greater delay in milliseconds. For event callbacks, values around
|
||||
* 100 or 250 (or even higher) are most useful.
|
||||
*
|
||||
* @param callback
|
||||
* A function to be executed after delay milliseconds. The `this` context and
|
||||
* all arguments are passed through, as-is, to `callback` when the
|
||||
* throttled-function is executed.
|
||||
*
|
||||
* @param options
|
||||
* An object to configure options.
|
||||
*
|
||||
* @param options.noTrailing
|
||||
* Optional, defaults to false. If noTrailing is true, callback will only execute
|
||||
* every `delay` milliseconds while the throttled-function is being called. If
|
||||
* noTrailing is false or unspecified, callback will be executed one final time
|
||||
* after the last throttled-function call. (After the throttled-function has not
|
||||
* been called for `delay` milliseconds, the internal counter is reset)
|
||||
*
|
||||
* @param options.noLeading
|
||||
* Optional, defaults to false. If noLeading is false, the first throttled-function
|
||||
* call will execute callback immediately. If noLeading is true, the first the
|
||||
* callback execution will be skipped. It should be noted that callback will never
|
||||
* executed if both noLeading = true and noTrailing = true.
|
||||
*
|
||||
* @param options.debounceMode If `debounceMode` is true (at begin), schedule
|
||||
* `callback` to execute after `delay` ms. If `debounceMode` is false (at end),
|
||||
* schedule `callback` to execute after `delay` ms.
|
||||
*
|
||||
* @return
|
||||
* A new, throttled, function.
|
||||
*/
|
||||
declare function throttle<T extends (...args: any[]) => any>(
|
||||
delay: number,
|
||||
callback: T,
|
||||
options?: ThrottleOptions,
|
||||
): throttle<T>;
|
||||
type debounce<T extends (...args: any[]) => any> = NoReturn<T> & Cancel;
|
||||
|
||||
/**
|
||||
* Debounce execution of a function. Debouncing, unlike throttling,
|
||||
* guarantees that a function is only executed a single time, either at the
|
||||
* very beginning of a series of calls, or at the very end.
|
||||
*
|
||||
* @param delay
|
||||
* A zero-or-greater delay in milliseconds. For event callbacks, values around
|
||||
* 100 or 250 (or even higher) are most useful.
|
||||
*
|
||||
* @param callback
|
||||
* A function to be executed after delay milliseconds. The `this` context and
|
||||
* all arguments are passed through, as-is, to `callback` when the
|
||||
* debounced-function is executed.
|
||||
*
|
||||
* @param options
|
||||
* An object to configure options.
|
||||
*
|
||||
* @param options.atBegin
|
||||
* If atBegin is false or unspecified, callback will only be executed `delay`
|
||||
* milliseconds after the last debounced-function call. If atBegin is true,
|
||||
* callback will be executed only at the first debounced-function call. (After
|
||||
* the throttled-function has not been called for `delay` milliseconds, the
|
||||
* internal counter is reset).
|
||||
*
|
||||
* @return
|
||||
* A new, debounced function.
|
||||
*/
|
||||
declare function debounce<T extends (...args: any[]) => any>(
|
||||
delay: number,
|
||||
callback: T,
|
||||
options?: DebounceOptions,
|
||||
): debounce<T>;
|
||||
|
||||
interface POptions {
|
||||
/**
|
||||
* How many promises are resolved at the same time.
|
||||
*/
|
||||
concurrency?: number | undefined;
|
||||
}
|
||||
declare class PInstance<T = any> extends Promise<Awaited<T>[]> {
|
||||
items: Iterable<T>;
|
||||
options?: POptions | undefined;
|
||||
private promises;
|
||||
get promise(): Promise<Awaited<T>[]>;
|
||||
constructor(items?: Iterable<T>, options?: POptions | undefined);
|
||||
add(...args: (T | Promise<T>)[]): void;
|
||||
map<U>(fn: (value: Awaited<T>, index: number) => U): PInstance<Promise<U>>;
|
||||
filter(fn: (value: Awaited<T>, index: number) => boolean | Promise<boolean>): PInstance<Promise<T>>;
|
||||
forEach(fn: (value: Awaited<T>, index: number) => void): Promise<void>;
|
||||
reduce<U>(fn: (previousValue: U, currentValue: Awaited<T>, currentIndex: number, array: Awaited<T>[]) => U, initialValue: U): Promise<U>;
|
||||
clear(): void;
|
||||
then(fn?: () => PromiseLike<any>): Promise<any>;
|
||||
catch(fn?: (err: unknown) => PromiseLike<any>): Promise<any>;
|
||||
finally(fn?: () => void): Promise<Awaited<T>[]>;
|
||||
}
|
||||
/**
|
||||
* Utility for managing multiple promises.
|
||||
*
|
||||
* @see https://github.com/antfu/utils/tree/main/docs/p.md
|
||||
* @category Promise
|
||||
* @example
|
||||
* ```
|
||||
* import { p } from '@antfu/utils'
|
||||
*
|
||||
* const items = [1, 2, 3, 4, 5]
|
||||
*
|
||||
* await p(items)
|
||||
* .map(async i => await multiply(i, 3))
|
||||
* .filter(async i => await isEven(i))
|
||||
* // [6, 12]
|
||||
* ```
|
||||
*/
|
||||
declare function p<T = any>(items?: Iterable<T>, options?: POptions): PInstance<T>;
|
||||
|
||||
export { type ArgumentsType, type Arrayable, type Awaitable, type Constructor, type ControlledPromise, type DeepMerge, type ElementOf, type Fn, type MergeInsertions, type Nullable, type PartitionFilter, type SingletonPromiseReturn, type UnionToIntersection, assert, at, batchInvoke, capitalize, clamp, clampArrayRange, clearUndefined, createControlledPromise, createPromiseLock, createSingletonPromise, debounce, deepMerge, deepMergeWithArray, ensurePrefix, ensureSuffix, flattenArrayable, getTypeName, hasOwnProperty, invoke, isBoolean, isBrowser, isDate, isDeepEqual, isDef, isFunction, isKeyOf, isNull, isNumber, isObject, isRegExp, isString, isTruthy, isUndefined, isWindow, last, lerp, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, p, partition, randomStr, range, remap, remove, sample, shuffle, slash, sleep, sum, tap, template, throttle, timestamp, toArray, toString, unindent, uniq, uniqueBy };
|
||||
777
web/admin-spa/node_modules/@antfu/utils/dist/index.mjs
generated
vendored
777
web/admin-spa/node_modules/@antfu/utils/dist/index.mjs
generated
vendored
@@ -1,777 +0,0 @@
|
||||
function clamp(n, min, max) {
|
||||
return Math.min(max, Math.max(min, n));
|
||||
}
|
||||
function sum(...args) {
|
||||
return flattenArrayable(args).reduce((a, b) => a + b, 0);
|
||||
}
|
||||
function lerp(min, max, t) {
|
||||
const interpolation = clamp(t, 0, 1);
|
||||
return min + (max - min) * interpolation;
|
||||
}
|
||||
function remap(n, inMin, inMax, outMin, outMax) {
|
||||
const interpolation = (n - inMin) / (inMax - inMin);
|
||||
return lerp(outMin, outMax, interpolation);
|
||||
}
|
||||
|
||||
function toArray(array) {
|
||||
array = array ?? [];
|
||||
return Array.isArray(array) ? array : [array];
|
||||
}
|
||||
function flattenArrayable(array) {
|
||||
return toArray(array).flat(1);
|
||||
}
|
||||
function mergeArrayable(...args) {
|
||||
return args.flatMap((i) => toArray(i));
|
||||
}
|
||||
function partition(array, ...filters) {
|
||||
const result = Array.from({ length: filters.length + 1 }).fill(null).map(() => []);
|
||||
array.forEach((e, idx, arr) => {
|
||||
let i = 0;
|
||||
for (const filter of filters) {
|
||||
if (filter(e, idx, arr)) {
|
||||
result[i].push(e);
|
||||
return;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
result[i].push(e);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function uniq(array) {
|
||||
return Array.from(new Set(array));
|
||||
}
|
||||
function uniqueBy(array, equalFn) {
|
||||
return array.reduce((acc, cur) => {
|
||||
const index = acc.findIndex((item) => equalFn(cur, item));
|
||||
if (index === -1)
|
||||
acc.push(cur);
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
function last(array) {
|
||||
return at(array, -1);
|
||||
}
|
||||
function remove(array, value) {
|
||||
if (!array)
|
||||
return false;
|
||||
const index = array.indexOf(value);
|
||||
if (index >= 0) {
|
||||
array.splice(index, 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function at(array, index) {
|
||||
const len = array.length;
|
||||
if (!len)
|
||||
return void 0;
|
||||
if (index < 0)
|
||||
index += len;
|
||||
return array[index];
|
||||
}
|
||||
function range(...args) {
|
||||
let start, stop, step;
|
||||
if (args.length === 1) {
|
||||
start = 0;
|
||||
step = 1;
|
||||
[stop] = args;
|
||||
} else {
|
||||
[start, stop, step = 1] = args;
|
||||
}
|
||||
const arr = [];
|
||||
let current = start;
|
||||
while (current < stop) {
|
||||
arr.push(current);
|
||||
current += step || 1;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
function move(arr, from, to) {
|
||||
arr.splice(to, 0, arr.splice(from, 1)[0]);
|
||||
return arr;
|
||||
}
|
||||
function clampArrayRange(n, arr) {
|
||||
return clamp(n, 0, arr.length - 1);
|
||||
}
|
||||
function sample(arr, quantity) {
|
||||
return Array.from({ length: quantity }, (_) => arr[Math.round(Math.random() * (arr.length - 1))]);
|
||||
}
|
||||
function shuffle(array) {
|
||||
for (let i = array.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[array[i], array[j]] = [array[j], array[i]];
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
function assert(condition, message) {
|
||||
if (!condition)
|
||||
throw new Error(message);
|
||||
}
|
||||
const toString = (v) => Object.prototype.toString.call(v);
|
||||
function getTypeName(v) {
|
||||
if (v === null)
|
||||
return "null";
|
||||
const type = toString(v).slice(8, -1).toLowerCase();
|
||||
return typeof v === "object" || typeof v === "function" ? type : typeof v;
|
||||
}
|
||||
function noop() {
|
||||
}
|
||||
|
||||
function isDeepEqual(value1, value2) {
|
||||
const type1 = getTypeName(value1);
|
||||
const type2 = getTypeName(value2);
|
||||
if (type1 !== type2)
|
||||
return false;
|
||||
if (type1 === "array") {
|
||||
if (value1.length !== value2.length)
|
||||
return false;
|
||||
return value1.every((item, i) => {
|
||||
return isDeepEqual(item, value2[i]);
|
||||
});
|
||||
}
|
||||
if (type1 === "object") {
|
||||
const keyArr = Object.keys(value1);
|
||||
if (keyArr.length !== Object.keys(value2).length)
|
||||
return false;
|
||||
return keyArr.every((key) => {
|
||||
return isDeepEqual(value1[key], value2[key]);
|
||||
});
|
||||
}
|
||||
return Object.is(value1, value2);
|
||||
}
|
||||
|
||||
function notNullish(v) {
|
||||
return v != null;
|
||||
}
|
||||
function noNull(v) {
|
||||
return v !== null;
|
||||
}
|
||||
function notUndefined(v) {
|
||||
return v !== void 0;
|
||||
}
|
||||
function isTruthy(v) {
|
||||
return Boolean(v);
|
||||
}
|
||||
|
||||
const isDef = (val) => typeof val !== "undefined";
|
||||
const isBoolean = (val) => typeof val === "boolean";
|
||||
const isFunction = (val) => typeof val === "function";
|
||||
const isNumber = (val) => typeof val === "number";
|
||||
const isString = (val) => typeof val === "string";
|
||||
const isObject = (val) => toString(val) === "[object Object]";
|
||||
const isUndefined = (val) => toString(val) === "[object Undefined]";
|
||||
const isNull = (val) => toString(val) === "[object Null]";
|
||||
const isRegExp = (val) => toString(val) === "[object RegExp]";
|
||||
const isDate = (val) => toString(val) === "[object Date]";
|
||||
const isWindow = (val) => typeof window !== "undefined" && toString(val) === "[object Window]";
|
||||
const isBrowser = typeof window !== "undefined";
|
||||
|
||||
function slash(str) {
|
||||
return str.replace(/\\/g, "/");
|
||||
}
|
||||
function ensurePrefix(prefix, str) {
|
||||
if (!str.startsWith(prefix))
|
||||
return prefix + str;
|
||||
return str;
|
||||
}
|
||||
function ensureSuffix(suffix, str) {
|
||||
if (!str.endsWith(suffix))
|
||||
return str + suffix;
|
||||
return str;
|
||||
}
|
||||
function template(str, ...args) {
|
||||
const [firstArg, fallback] = args;
|
||||
if (isObject(firstArg)) {
|
||||
const vars = firstArg;
|
||||
return str.replace(/{([\w\d]+)}/g, (_, key) => vars[key] || ((typeof fallback === "function" ? fallback(key) : fallback) ?? key));
|
||||
} else {
|
||||
return str.replace(/{(\d+)}/g, (_, key) => {
|
||||
const index = Number(key);
|
||||
if (Number.isNaN(index))
|
||||
return key;
|
||||
return args[index];
|
||||
});
|
||||
}
|
||||
}
|
||||
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
||||
function randomStr(size = 16, dict = urlAlphabet) {
|
||||
let id = "";
|
||||
let i = size;
|
||||
const len = dict.length;
|
||||
while (i--)
|
||||
id += dict[Math.random() * len | 0];
|
||||
return id;
|
||||
}
|
||||
function capitalize(str) {
|
||||
return str[0].toUpperCase() + str.slice(1).toLowerCase();
|
||||
}
|
||||
const _reFullWs = /^\s*$/;
|
||||
function unindent(str) {
|
||||
const lines = (typeof str === "string" ? str : str[0]).split("\n");
|
||||
const whitespaceLines = lines.map((line) => _reFullWs.test(line));
|
||||
const commonIndent = lines.reduce((min, line, idx) => {
|
||||
var _a;
|
||||
if (whitespaceLines[idx])
|
||||
return min;
|
||||
const indent = (_a = line.match(/^\s*/)) == null ? void 0 : _a[0].length;
|
||||
return indent === void 0 ? min : Math.min(min, indent);
|
||||
}, Number.POSITIVE_INFINITY);
|
||||
let emptyLinesHead = 0;
|
||||
while (emptyLinesHead < lines.length && whitespaceLines[emptyLinesHead])
|
||||
emptyLinesHead++;
|
||||
let emptyLinesTail = 0;
|
||||
while (emptyLinesTail < lines.length && whitespaceLines[lines.length - emptyLinesTail - 1])
|
||||
emptyLinesTail++;
|
||||
return lines.slice(emptyLinesHead, lines.length - emptyLinesTail).map((line) => line.slice(commonIndent)).join("\n");
|
||||
}
|
||||
|
||||
const timestamp = () => +Date.now();
|
||||
|
||||
function batchInvoke(functions) {
|
||||
functions.forEach((fn) => fn && fn());
|
||||
}
|
||||
function invoke(fn) {
|
||||
return fn();
|
||||
}
|
||||
function tap(value, callback) {
|
||||
callback(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
function objectMap(obj, fn) {
|
||||
return Object.fromEntries(
|
||||
Object.entries(obj).map(([k, v]) => fn(k, v)).filter(notNullish)
|
||||
);
|
||||
}
|
||||
function isKeyOf(obj, k) {
|
||||
return k in obj;
|
||||
}
|
||||
function objectKeys(obj) {
|
||||
return Object.keys(obj);
|
||||
}
|
||||
function objectEntries(obj) {
|
||||
return Object.entries(obj);
|
||||
}
|
||||
function deepMerge(target, ...sources) {
|
||||
if (!sources.length)
|
||||
return target;
|
||||
const source = sources.shift();
|
||||
if (source === void 0)
|
||||
return target;
|
||||
if (isMergableObject(target) && isMergableObject(source)) {
|
||||
objectKeys(source).forEach((key) => {
|
||||
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
||||
return;
|
||||
if (isMergableObject(source[key])) {
|
||||
if (!target[key])
|
||||
target[key] = {};
|
||||
if (isMergableObject(target[key])) {
|
||||
deepMerge(target[key], source[key]);
|
||||
} else {
|
||||
target[key] = source[key];
|
||||
}
|
||||
} else {
|
||||
target[key] = source[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
return deepMerge(target, ...sources);
|
||||
}
|
||||
function deepMergeWithArray(target, ...sources) {
|
||||
if (!sources.length)
|
||||
return target;
|
||||
const source = sources.shift();
|
||||
if (source === void 0)
|
||||
return target;
|
||||
if (Array.isArray(target) && Array.isArray(source))
|
||||
target.push(...source);
|
||||
if (isMergableObject(target) && isMergableObject(source)) {
|
||||
objectKeys(source).forEach((key) => {
|
||||
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
||||
return;
|
||||
if (Array.isArray(source[key])) {
|
||||
if (!target[key])
|
||||
target[key] = [];
|
||||
deepMergeWithArray(target[key], source[key]);
|
||||
} else if (isMergableObject(source[key])) {
|
||||
if (!target[key])
|
||||
target[key] = {};
|
||||
deepMergeWithArray(target[key], source[key]);
|
||||
} else {
|
||||
target[key] = source[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
return deepMergeWithArray(target, ...sources);
|
||||
}
|
||||
function isMergableObject(item) {
|
||||
return isObject(item) && !Array.isArray(item);
|
||||
}
|
||||
function objectPick(obj, keys, omitUndefined = false) {
|
||||
return keys.reduce((n, k) => {
|
||||
if (k in obj) {
|
||||
if (!omitUndefined || obj[k] !== void 0)
|
||||
n[k] = obj[k];
|
||||
}
|
||||
return n;
|
||||
}, {});
|
||||
}
|
||||
function clearUndefined(obj) {
|
||||
Object.keys(obj).forEach((key) => obj[key] === void 0 ? delete obj[key] : {});
|
||||
return obj;
|
||||
}
|
||||
function hasOwnProperty(obj, v) {
|
||||
if (obj == null)
|
||||
return false;
|
||||
return Object.prototype.hasOwnProperty.call(obj, v);
|
||||
}
|
||||
|
||||
function createSingletonPromise(fn) {
|
||||
let _promise;
|
||||
function wrapper() {
|
||||
if (!_promise)
|
||||
_promise = fn();
|
||||
return _promise;
|
||||
}
|
||||
wrapper.reset = async () => {
|
||||
const _prev = _promise;
|
||||
_promise = void 0;
|
||||
if (_prev)
|
||||
await _prev;
|
||||
};
|
||||
return wrapper;
|
||||
}
|
||||
function sleep(ms, callback) {
|
||||
return new Promise(
|
||||
(resolve) => setTimeout(async () => {
|
||||
await (callback == null ? void 0 : callback());
|
||||
resolve();
|
||||
}, ms)
|
||||
);
|
||||
}
|
||||
function createPromiseLock() {
|
||||
const locks = [];
|
||||
return {
|
||||
async run(fn) {
|
||||
const p = fn();
|
||||
locks.push(p);
|
||||
try {
|
||||
return await p;
|
||||
} finally {
|
||||
remove(locks, p);
|
||||
}
|
||||
},
|
||||
async wait() {
|
||||
await Promise.allSettled(locks);
|
||||
},
|
||||
isWaiting() {
|
||||
return Boolean(locks.length);
|
||||
},
|
||||
clear() {
|
||||
locks.length = 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
function createControlledPromise() {
|
||||
let resolve, reject;
|
||||
const promise = new Promise((_resolve, _reject) => {
|
||||
resolve = _resolve;
|
||||
reject = _reject;
|
||||
});
|
||||
promise.resolve = resolve;
|
||||
promise.reject = reject;
|
||||
return promise;
|
||||
}
|
||||
|
||||
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
||||
|
||||
/**
|
||||
* Throttle execution of a function. Especially useful for rate limiting
|
||||
* execution of handlers on events like resize and scroll.
|
||||
*
|
||||
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
|
||||
* are most useful.
|
||||
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
|
||||
* as-is, to `callback` when the throttled-function is executed.
|
||||
* @param {object} [options] - An object to configure options.
|
||||
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
|
||||
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
|
||||
* one final time after the last throttled-function call. (After the throttled-function has not been called for
|
||||
* `delay` milliseconds, the internal counter is reset).
|
||||
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
|
||||
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
|
||||
* callback will never executed if both noLeading = true and noTrailing = true.
|
||||
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
|
||||
* false (at end), schedule `callback` to execute after `delay` ms.
|
||||
*
|
||||
* @returns {Function} A new, throttled, function.
|
||||
*/
|
||||
function throttle (delay, callback, options) {
|
||||
var _ref = options || {},
|
||||
_ref$noTrailing = _ref.noTrailing,
|
||||
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
|
||||
_ref$noLeading = _ref.noLeading,
|
||||
noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
|
||||
_ref$debounceMode = _ref.debounceMode,
|
||||
debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
|
||||
/*
|
||||
* After wrapper has stopped being called, this timeout ensures that
|
||||
* `callback` is executed at the proper times in `throttle` and `end`
|
||||
* debounce modes.
|
||||
*/
|
||||
|
||||
|
||||
var timeoutID;
|
||||
var cancelled = false; // Keep track of the last time `callback` was executed.
|
||||
|
||||
var lastExec = 0; // Function to clear existing timeout
|
||||
|
||||
function clearExistingTimeout() {
|
||||
if (timeoutID) {
|
||||
clearTimeout(timeoutID);
|
||||
}
|
||||
} // Function to cancel next exec
|
||||
|
||||
|
||||
function cancel(options) {
|
||||
var _ref2 = options || {},
|
||||
_ref2$upcomingOnly = _ref2.upcomingOnly,
|
||||
upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
|
||||
|
||||
clearExistingTimeout();
|
||||
cancelled = !upcomingOnly;
|
||||
}
|
||||
/*
|
||||
* The `wrapper` function encapsulates all of the throttling / debouncing
|
||||
* functionality and when executed will limit the rate at which `callback`
|
||||
* is executed.
|
||||
*/
|
||||
|
||||
|
||||
function wrapper() {
|
||||
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
arguments_[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var elapsed = Date.now() - lastExec;
|
||||
|
||||
if (cancelled) {
|
||||
return;
|
||||
} // Execute `callback` and update the `lastExec` timestamp.
|
||||
|
||||
|
||||
function exec() {
|
||||
lastExec = Date.now();
|
||||
callback.apply(self, arguments_);
|
||||
}
|
||||
/*
|
||||
* If `debounceMode` is true (at begin) this is used to clear the flag
|
||||
* to allow future `callback` executions.
|
||||
*/
|
||||
|
||||
|
||||
function clear() {
|
||||
timeoutID = undefined;
|
||||
}
|
||||
|
||||
if (!noLeading && debounceMode && !timeoutID) {
|
||||
/*
|
||||
* Since `wrapper` is being called for the first time and
|
||||
* `debounceMode` is true (at begin), execute `callback`
|
||||
* and noLeading != true.
|
||||
*/
|
||||
exec();
|
||||
}
|
||||
|
||||
clearExistingTimeout();
|
||||
|
||||
if (debounceMode === undefined && elapsed > delay) {
|
||||
if (noLeading) {
|
||||
/*
|
||||
* In throttle mode with noLeading, if `delay` time has
|
||||
* been exceeded, update `lastExec` and schedule `callback`
|
||||
* to execute after `delay` ms.
|
||||
*/
|
||||
lastExec = Date.now();
|
||||
|
||||
if (!noTrailing) {
|
||||
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
|
||||
* `callback`.
|
||||
*/
|
||||
exec();
|
||||
}
|
||||
} else if (noTrailing !== true) {
|
||||
/*
|
||||
* In trailing throttle mode, since `delay` time has not been
|
||||
* exceeded, schedule `callback` to execute `delay` ms after most
|
||||
* recent execution.
|
||||
*
|
||||
* If `debounceMode` is true (at begin), schedule `clear` to execute
|
||||
* after `delay` ms.
|
||||
*
|
||||
* If `debounceMode` is false (at end), schedule `callback` to
|
||||
* execute after `delay` ms.
|
||||
*/
|
||||
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
||||
}
|
||||
}
|
||||
|
||||
wrapper.cancel = cancel; // Return the wrapper function.
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
/* eslint-disable no-undefined */
|
||||
/**
|
||||
* Debounce execution of a function. Debouncing, unlike throttling,
|
||||
* guarantees that a function is only executed a single time, either at the
|
||||
* very beginning of a series of calls, or at the very end.
|
||||
*
|
||||
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
||||
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
|
||||
* to `callback` when the debounced-function is executed.
|
||||
* @param {object} [options] - An object to configure options.
|
||||
* @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
|
||||
* after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
|
||||
* (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
|
||||
*
|
||||
* @returns {Function} A new, debounced function.
|
||||
*/
|
||||
|
||||
function debounce (delay, callback, options) {
|
||||
var _ref = options || {},
|
||||
_ref$atBegin = _ref.atBegin,
|
||||
atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
|
||||
|
||||
return throttle(delay, callback, {
|
||||
debounceMode: atBegin !== false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
How it works:
|
||||
`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.
|
||||
*/
|
||||
|
||||
class Node {
|
||||
value;
|
||||
next;
|
||||
|
||||
constructor(value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Queue {
|
||||
#head;
|
||||
#tail;
|
||||
#size;
|
||||
|
||||
constructor() {
|
||||
this.clear();
|
||||
}
|
||||
|
||||
enqueue(value) {
|
||||
const node = new Node(value);
|
||||
|
||||
if (this.#head) {
|
||||
this.#tail.next = node;
|
||||
this.#tail = node;
|
||||
} else {
|
||||
this.#head = node;
|
||||
this.#tail = node;
|
||||
}
|
||||
|
||||
this.#size++;
|
||||
}
|
||||
|
||||
dequeue() {
|
||||
const current = this.#head;
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.#head = this.#head.next;
|
||||
this.#size--;
|
||||
return current.value;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.#head = undefined;
|
||||
this.#tail = undefined;
|
||||
this.#size = 0;
|
||||
}
|
||||
|
||||
get size() {
|
||||
return this.#size;
|
||||
}
|
||||
|
||||
* [Symbol.iterator]() {
|
||||
let current = this.#head;
|
||||
|
||||
while (current) {
|
||||
yield current.value;
|
||||
current = current.next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const AsyncResource = {
|
||||
bind(fn, _type, thisArg) {
|
||||
return fn.bind(thisArg);
|
||||
},
|
||||
};
|
||||
|
||||
function pLimit(concurrency) {
|
||||
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
||||
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
|
||||
}
|
||||
|
||||
const queue = new Queue();
|
||||
let activeCount = 0;
|
||||
|
||||
const next = () => {
|
||||
activeCount--;
|
||||
|
||||
if (queue.size > 0) {
|
||||
queue.dequeue()();
|
||||
}
|
||||
};
|
||||
|
||||
const run = async (function_, resolve, arguments_) => {
|
||||
activeCount++;
|
||||
|
||||
const result = (async () => function_(...arguments_))();
|
||||
|
||||
resolve(result);
|
||||
|
||||
try {
|
||||
await result;
|
||||
} catch {}
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
const enqueue = (function_, resolve, arguments_) => {
|
||||
queue.enqueue(
|
||||
AsyncResource.bind(run.bind(undefined, function_, resolve, arguments_)),
|
||||
);
|
||||
|
||||
(async () => {
|
||||
// This function needs to wait until the next microtask before comparing
|
||||
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
||||
// when the run function is dequeued and called. The comparison in the if-statement
|
||||
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
||||
await Promise.resolve();
|
||||
|
||||
if (activeCount < concurrency && queue.size > 0) {
|
||||
queue.dequeue()();
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
const generator = (function_, ...arguments_) => new Promise(resolve => {
|
||||
enqueue(function_, resolve, arguments_);
|
||||
});
|
||||
|
||||
Object.defineProperties(generator, {
|
||||
activeCount: {
|
||||
get: () => activeCount,
|
||||
},
|
||||
pendingCount: {
|
||||
get: () => queue.size,
|
||||
},
|
||||
clearQueue: {
|
||||
value() {
|
||||
queue.clear();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return generator;
|
||||
}
|
||||
|
||||
const VOID = Symbol("p-void");
|
||||
class PInstance extends Promise {
|
||||
constructor(items = [], options) {
|
||||
super(() => {
|
||||
});
|
||||
this.items = items;
|
||||
this.options = options;
|
||||
this.promises = /* @__PURE__ */ new Set();
|
||||
}
|
||||
get promise() {
|
||||
var _a;
|
||||
let batch;
|
||||
const items = [...Array.from(this.items), ...Array.from(this.promises)];
|
||||
if ((_a = this.options) == null ? void 0 : _a.concurrency) {
|
||||
const limit = pLimit(this.options.concurrency);
|
||||
batch = Promise.all(items.map((p2) => limit(() => p2)));
|
||||
} else {
|
||||
batch = Promise.all(items);
|
||||
}
|
||||
return batch.then((l) => l.filter((i) => i !== VOID));
|
||||
}
|
||||
add(...args) {
|
||||
args.forEach((i) => {
|
||||
this.promises.add(i);
|
||||
});
|
||||
}
|
||||
map(fn) {
|
||||
return new PInstance(
|
||||
Array.from(this.items).map(async (i, idx) => {
|
||||
const v = await i;
|
||||
if (v === VOID)
|
||||
return VOID;
|
||||
return fn(v, idx);
|
||||
}),
|
||||
this.options
|
||||
);
|
||||
}
|
||||
filter(fn) {
|
||||
return new PInstance(
|
||||
Array.from(this.items).map(async (i, idx) => {
|
||||
const v = await i;
|
||||
const r = await fn(v, idx);
|
||||
if (!r)
|
||||
return VOID;
|
||||
return v;
|
||||
}),
|
||||
this.options
|
||||
);
|
||||
}
|
||||
forEach(fn) {
|
||||
return this.map(fn).then();
|
||||
}
|
||||
reduce(fn, initialValue) {
|
||||
return this.promise.then((array) => array.reduce(fn, initialValue));
|
||||
}
|
||||
clear() {
|
||||
this.promises.clear();
|
||||
}
|
||||
then(fn) {
|
||||
const p2 = this.promise;
|
||||
if (fn)
|
||||
return p2.then(fn);
|
||||
else
|
||||
return p2;
|
||||
}
|
||||
catch(fn) {
|
||||
return this.promise.catch(fn);
|
||||
}
|
||||
finally(fn) {
|
||||
return this.promise.finally(fn);
|
||||
}
|
||||
}
|
||||
function p(items, options) {
|
||||
return new PInstance(items, options);
|
||||
}
|
||||
|
||||
export { assert, at, batchInvoke, capitalize, clamp, clampArrayRange, clearUndefined, createControlledPromise, createPromiseLock, createSingletonPromise, debounce, deepMerge, deepMergeWithArray, ensurePrefix, ensureSuffix, flattenArrayable, getTypeName, hasOwnProperty, invoke, isBoolean, isBrowser, isDate, isDeepEqual, isDef, isFunction, isKeyOf, isNull, isNumber, isObject, isRegExp, isString, isTruthy, isUndefined, isWindow, last, lerp, mergeArrayable, move, noNull, noop, notNullish, notUndefined, objectEntries, objectKeys, objectMap, objectPick, p, partition, randomStr, range, remap, remove, sample, shuffle, slash, sleep, sum, tap, template, throttle, timestamp, toArray, toString, unindent, uniq, uniqueBy };
|
||||
67
web/admin-spa/node_modules/@antfu/utils/package.json
generated
vendored
67
web/admin-spa/node_modules/@antfu/utils/package.json
generated
vendored
@@ -1,67 +0,0 @@
|
||||
{
|
||||
"name": "@antfu/utils",
|
||||
"type": "module",
|
||||
"version": "0.7.10",
|
||||
"packageManager": "pnpm@9.1.0",
|
||||
"description": "Opinionated collection of common JavaScript / TypeScript utils by @antfu",
|
||||
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
||||
"license": "MIT",
|
||||
"funding": "https://github.com/sponsors/antfu",
|
||||
"homepage": "https://github.com/antfu/utils#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/antfu/utils.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/antfu/utils/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"utils"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"main": "dist/index.cjs",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "nr build --watch",
|
||||
"lint": "eslint .",
|
||||
"lint-fix": "nr lint --fix",
|
||||
"prepublishOnly": "npm run build",
|
||||
"release": "bumpp --commit --push --tag && npm publish",
|
||||
"start": "esno src/index.ts",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^2.16.3",
|
||||
"@antfu/ni": "^0.21.12",
|
||||
"@rollup/plugin-alias": "^5.1.0",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/node": "^20.12.10",
|
||||
"@types/throttle-debounce": "^5.0.2",
|
||||
"bumpp": "^9.4.1",
|
||||
"eslint": "npm:eslint-ts-patch@8.55.0-1",
|
||||
"eslint-ts-patch": "8.55.0-1",
|
||||
"esno": "^4.7.0",
|
||||
"p-limit": "^5.0.0",
|
||||
"rollup": "^4.17.2",
|
||||
"rollup-plugin-dts": "^6.1.0",
|
||||
"rollup-plugin-esbuild": "^6.1.1",
|
||||
"throttle-debounce": "5.0.0",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^5.2.11",
|
||||
"vitest": "^1.6.0"
|
||||
}
|
||||
}
|
||||
22
web/admin-spa/node_modules/@babel/helper-string-parser/LICENSE
generated
vendored
22
web/admin-spa/node_modules/@babel/helper-string-parser/LICENSE
generated
vendored
@@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
19
web/admin-spa/node_modules/@babel/helper-string-parser/README.md
generated
vendored
19
web/admin-spa/node_modules/@babel/helper-string-parser/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
# @babel/helper-string-parser
|
||||
|
||||
> A utility package to parse strings
|
||||
|
||||
See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-string-parser
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-string-parser
|
||||
```
|
||||
295
web/admin-spa/node_modules/@babel/helper-string-parser/lib/index.js
generated
vendored
295
web/admin-spa/node_modules/@babel/helper-string-parser/lib/index.js
generated
vendored
@@ -1,295 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.readCodePoint = readCodePoint;
|
||||
exports.readInt = readInt;
|
||||
exports.readStringContents = readStringContents;
|
||||
var _isDigit = function isDigit(code) {
|
||||
return code >= 48 && code <= 57;
|
||||
};
|
||||
const forbiddenNumericSeparatorSiblings = {
|
||||
decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
|
||||
hex: new Set([46, 88, 95, 120])
|
||||
};
|
||||
const isAllowedNumericSeparatorSibling = {
|
||||
bin: ch => ch === 48 || ch === 49,
|
||||
oct: ch => ch >= 48 && ch <= 55,
|
||||
dec: ch => ch >= 48 && ch <= 57,
|
||||
hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
|
||||
};
|
||||
function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
||||
const initialPos = pos;
|
||||
const initialLineStart = lineStart;
|
||||
const initialCurLine = curLine;
|
||||
let out = "";
|
||||
let firstInvalidLoc = null;
|
||||
let chunkStart = pos;
|
||||
const {
|
||||
length
|
||||
} = input;
|
||||
for (;;) {
|
||||
if (pos >= length) {
|
||||
errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
||||
out += input.slice(chunkStart, pos);
|
||||
break;
|
||||
}
|
||||
const ch = input.charCodeAt(pos);
|
||||
if (isStringEnd(type, ch, input, pos)) {
|
||||
out += input.slice(chunkStart, pos);
|
||||
break;
|
||||
}
|
||||
if (ch === 92) {
|
||||
out += input.slice(chunkStart, pos);
|
||||
const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
|
||||
if (res.ch === null && !firstInvalidLoc) {
|
||||
firstInvalidLoc = {
|
||||
pos,
|
||||
lineStart,
|
||||
curLine
|
||||
};
|
||||
} else {
|
||||
out += res.ch;
|
||||
}
|
||||
({
|
||||
pos,
|
||||
lineStart,
|
||||
curLine
|
||||
} = res);
|
||||
chunkStart = pos;
|
||||
} else if (ch === 8232 || ch === 8233) {
|
||||
++pos;
|
||||
++curLine;
|
||||
lineStart = pos;
|
||||
} else if (ch === 10 || ch === 13) {
|
||||
if (type === "template") {
|
||||
out += input.slice(chunkStart, pos) + "\n";
|
||||
++pos;
|
||||
if (ch === 13 && input.charCodeAt(pos) === 10) {
|
||||
++pos;
|
||||
}
|
||||
++curLine;
|
||||
chunkStart = lineStart = pos;
|
||||
} else {
|
||||
errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
||||
}
|
||||
} else {
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
return {
|
||||
pos,
|
||||
str: out,
|
||||
firstInvalidLoc,
|
||||
lineStart,
|
||||
curLine,
|
||||
containsInvalid: !!firstInvalidLoc
|
||||
};
|
||||
}
|
||||
function isStringEnd(type, ch, input, pos) {
|
||||
if (type === "template") {
|
||||
return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
|
||||
}
|
||||
return ch === (type === "double" ? 34 : 39);
|
||||
}
|
||||
function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
||||
const throwOnInvalid = !inTemplate;
|
||||
pos++;
|
||||
const res = ch => ({
|
||||
pos,
|
||||
ch,
|
||||
lineStart,
|
||||
curLine
|
||||
});
|
||||
const ch = input.charCodeAt(pos++);
|
||||
switch (ch) {
|
||||
case 110:
|
||||
return res("\n");
|
||||
case 114:
|
||||
return res("\r");
|
||||
case 120:
|
||||
{
|
||||
let code;
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
|
||||
return res(code === null ? null : String.fromCharCode(code));
|
||||
}
|
||||
case 117:
|
||||
{
|
||||
let code;
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
|
||||
return res(code === null ? null : String.fromCodePoint(code));
|
||||
}
|
||||
case 116:
|
||||
return res("\t");
|
||||
case 98:
|
||||
return res("\b");
|
||||
case 118:
|
||||
return res("\u000b");
|
||||
case 102:
|
||||
return res("\f");
|
||||
case 13:
|
||||
if (input.charCodeAt(pos) === 10) {
|
||||
++pos;
|
||||
}
|
||||
case 10:
|
||||
lineStart = pos;
|
||||
++curLine;
|
||||
case 8232:
|
||||
case 8233:
|
||||
return res("");
|
||||
case 56:
|
||||
case 57:
|
||||
if (inTemplate) {
|
||||
return res(null);
|
||||
} else {
|
||||
errors.strictNumericEscape(pos - 1, lineStart, curLine);
|
||||
}
|
||||
default:
|
||||
if (ch >= 48 && ch <= 55) {
|
||||
const startPos = pos - 1;
|
||||
const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
|
||||
let octalStr = match[0];
|
||||
let octal = parseInt(octalStr, 8);
|
||||
if (octal > 255) {
|
||||
octalStr = octalStr.slice(0, -1);
|
||||
octal = parseInt(octalStr, 8);
|
||||
}
|
||||
pos += octalStr.length - 1;
|
||||
const next = input.charCodeAt(pos);
|
||||
if (octalStr !== "0" || next === 56 || next === 57) {
|
||||
if (inTemplate) {
|
||||
return res(null);
|
||||
} else {
|
||||
errors.strictNumericEscape(startPos, lineStart, curLine);
|
||||
}
|
||||
}
|
||||
return res(String.fromCharCode(octal));
|
||||
}
|
||||
return res(String.fromCharCode(ch));
|
||||
}
|
||||
}
|
||||
function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
|
||||
const initialPos = pos;
|
||||
let n;
|
||||
({
|
||||
n,
|
||||
pos
|
||||
} = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
|
||||
if (n === null) {
|
||||
if (throwOnInvalid) {
|
||||
errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
||||
} else {
|
||||
pos = initialPos - 1;
|
||||
}
|
||||
}
|
||||
return {
|
||||
code: n,
|
||||
pos
|
||||
};
|
||||
}
|
||||
function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
|
||||
const start = pos;
|
||||
const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
|
||||
const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
|
||||
let invalid = false;
|
||||
let total = 0;
|
||||
for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
|
||||
const code = input.charCodeAt(pos);
|
||||
let val;
|
||||
if (code === 95 && allowNumSeparator !== "bail") {
|
||||
const prev = input.charCodeAt(pos - 1);
|
||||
const next = input.charCodeAt(pos + 1);
|
||||
if (!allowNumSeparator) {
|
||||
if (bailOnError) return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
|
||||
} else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
|
||||
if (bailOnError) return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
errors.unexpectedNumericSeparator(pos, lineStart, curLine);
|
||||
}
|
||||
++pos;
|
||||
continue;
|
||||
}
|
||||
if (code >= 97) {
|
||||
val = code - 97 + 10;
|
||||
} else if (code >= 65) {
|
||||
val = code - 65 + 10;
|
||||
} else if (_isDigit(code)) {
|
||||
val = code - 48;
|
||||
} else {
|
||||
val = Infinity;
|
||||
}
|
||||
if (val >= radix) {
|
||||
if (val <= 9 && bailOnError) {
|
||||
return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
} else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
|
||||
val = 0;
|
||||
} else if (forceLen) {
|
||||
val = 0;
|
||||
invalid = true;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
++pos;
|
||||
total = total * radix + val;
|
||||
}
|
||||
if (pos === start || len != null && pos - start !== len || invalid) {
|
||||
return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
}
|
||||
return {
|
||||
n: total,
|
||||
pos
|
||||
};
|
||||
}
|
||||
function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
||||
const ch = input.charCodeAt(pos);
|
||||
let code;
|
||||
if (ch === 123) {
|
||||
++pos;
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
|
||||
++pos;
|
||||
if (code !== null && code > 0x10ffff) {
|
||||
if (throwOnInvalid) {
|
||||
errors.invalidCodePoint(pos, lineStart, curLine);
|
||||
} else {
|
||||
return {
|
||||
code: null,
|
||||
pos
|
||||
};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
||||
}
|
||||
return {
|
||||
code,
|
||||
pos
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
web/admin-spa/node_modules/@babel/helper-string-parser/lib/index.js.map
generated
vendored
1
web/admin-spa/node_modules/@babel/helper-string-parser/lib/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
31
web/admin-spa/node_modules/@babel/helper-string-parser/package.json
generated
vendored
31
web/admin-spa/node_modules/@babel/helper-string-parser/package.json
generated
vendored
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "@babel/helper-string-parser",
|
||||
"version": "7.27.1",
|
||||
"description": "A utility package to parse strings",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-string-parser"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-string-parser",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"devDependencies": {
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
22
web/admin-spa/node_modules/@babel/helper-validator-identifier/LICENSE
generated
vendored
22
web/admin-spa/node_modules/@babel/helper-validator-identifier/LICENSE
generated
vendored
@@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
19
web/admin-spa/node_modules/@babel/helper-validator-identifier/README.md
generated
vendored
19
web/admin-spa/node_modules/@babel/helper-validator-identifier/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
# @babel/helper-validator-identifier
|
||||
|
||||
> Validate identifier/keywords name
|
||||
|
||||
See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/babel-helper-validator-identifier) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-validator-identifier
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-validator-identifier
|
||||
```
|
||||
70
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/identifier.js
generated
vendored
70
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/identifier.js
generated
vendored
@@ -1,70 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isIdentifierChar = isIdentifierChar;
|
||||
exports.isIdentifierName = isIdentifierName;
|
||||
exports.isIdentifierStart = isIdentifierStart;
|
||||
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
||||
let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";
|
||||
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
||||
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
||||
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
||||
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
||||
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
||||
function isInAstralSet(code, set) {
|
||||
let pos = 0x10000;
|
||||
for (let i = 0, length = set.length; i < length; i += 2) {
|
||||
pos += set[i];
|
||||
if (pos > code) return false;
|
||||
pos += set[i + 1];
|
||||
if (pos >= code) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isIdentifierStart(code) {
|
||||
if (code < 65) return code === 36;
|
||||
if (code <= 90) return true;
|
||||
if (code < 97) return code === 95;
|
||||
if (code <= 122) return true;
|
||||
if (code <= 0xffff) {
|
||||
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
||||
}
|
||||
return isInAstralSet(code, astralIdentifierStartCodes);
|
||||
}
|
||||
function isIdentifierChar(code) {
|
||||
if (code < 48) return code === 36;
|
||||
if (code < 58) return true;
|
||||
if (code < 65) return false;
|
||||
if (code <= 90) return true;
|
||||
if (code < 97) return code === 95;
|
||||
if (code <= 122) return true;
|
||||
if (code <= 0xffff) {
|
||||
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
|
||||
}
|
||||
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
||||
}
|
||||
function isIdentifierName(name) {
|
||||
let isFirst = true;
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
let cp = name.charCodeAt(i);
|
||||
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
|
||||
const trail = name.charCodeAt(++i);
|
||||
if ((trail & 0xfc00) === 0xdc00) {
|
||||
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
|
||||
}
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
if (!isIdentifierStart(cp)) {
|
||||
return false;
|
||||
}
|
||||
} else if (!isIdentifierChar(cp)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return !isFirst;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=identifier.js.map
|
||||
1
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
generated
vendored
1
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
generated
vendored
File diff suppressed because one or more lines are too long
57
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/index.js
generated
vendored
57
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/index.js
generated
vendored
@@ -1,57 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierChar", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _identifier.isIdentifierChar;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierName", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _identifier.isIdentifierName;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierStart", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _identifier.isIdentifierStart;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isKeyword", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isKeyword;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isStrictBindOnlyReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isStrictBindReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isStrictReservedWord;
|
||||
}
|
||||
});
|
||||
var _identifier = require("./identifier.js");
|
||||
var _keyword = require("./keyword.js");
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/index.js.map
generated
vendored
1
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/index.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier.ts\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}
|
||||
35
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/keyword.js
generated
vendored
35
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/keyword.js
generated
vendored
@@ -1,35 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isKeyword = isKeyword;
|
||||
exports.isReservedWord = isReservedWord;
|
||||
exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
||||
exports.isStrictBindReservedWord = isStrictBindReservedWord;
|
||||
exports.isStrictReservedWord = isStrictReservedWord;
|
||||
const reservedWords = {
|
||||
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
||||
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
||||
strictBind: ["eval", "arguments"]
|
||||
};
|
||||
const keywords = new Set(reservedWords.keyword);
|
||||
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
||||
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
||||
function isReservedWord(word, inModule) {
|
||||
return inModule && word === "await" || word === "enum";
|
||||
}
|
||||
function isStrictReservedWord(word, inModule) {
|
||||
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
||||
}
|
||||
function isStrictBindOnlyReservedWord(word) {
|
||||
return reservedWordsStrictBindSet.has(word);
|
||||
}
|
||||
function isStrictBindReservedWord(word, inModule) {
|
||||
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
||||
}
|
||||
function isKeyword(word) {
|
||||
return keywords.has(word);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=keyword.js.map
|
||||
1
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map
generated
vendored
1
web/admin-spa/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,CACT;EACDC,MAAM,EAAE,CACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,CACR;EACDC,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW;AAClC,CAAC;AACD,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAACL,aAAa,CAACC,OAAO,CAAC;AAC/C,MAAMK,sBAAsB,GAAG,IAAID,GAAG,CAACL,aAAa,CAACE,MAAM,CAAC;AAC5D,MAAMK,0BAA0B,GAAG,IAAIF,GAAG,CAACL,aAAa,CAACG,UAAU,CAAC;AAK7D,SAASK,cAAcA,CAACC,IAAY,EAAEC,QAAiB,EAAW;EACvE,OAAQA,QAAQ,IAAID,IAAI,KAAK,OAAO,IAAKA,IAAI,KAAK,MAAM;AAC1D;AAOO,SAASE,oBAAoBA,CAACF,IAAY,EAAEC,QAAiB,EAAW;EAC7E,OAAOF,cAAc,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIJ,sBAAsB,CAACM,GAAG,CAACH,IAAI,CAAC;AAC3E;AAMO,SAASI,4BAA4BA,CAACJ,IAAY,EAAW;EAClE,OAAOF,0BAA0B,CAACK,GAAG,CAACH,IAAI,CAAC;AAC7C;AAOO,SAASK,wBAAwBA,CACtCL,IAAY,EACZC,QAAiB,EACR;EACT,OACEC,oBAAoB,CAACF,IAAI,EAAEC,QAAQ,CAAC,IAAIG,4BAA4B,CAACJ,IAAI,CAAC;AAE9E;AAEO,SAASM,SAASA,CAACN,IAAY,EAAW;EAC/C,OAAOL,QAAQ,CAACQ,GAAG,CAACH,IAAI,CAAC;AAC3B","ignoreList":[]}
|
||||
31
web/admin-spa/node_modules/@babel/helper-validator-identifier/package.json
generated
vendored
31
web/admin-spa/node_modules/@babel/helper-validator-identifier/package.json
generated
vendored
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "@babel/helper-validator-identifier",
|
||||
"version": "7.27.1",
|
||||
"description": "Validate identifier/keywords name",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-validator-identifier"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@unicode/unicode-16.0.0": "^1.0.0",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"type": "commonjs"
|
||||
}
|
||||
1073
web/admin-spa/node_modules/@babel/parser/CHANGELOG.md
generated
vendored
1073
web/admin-spa/node_modules/@babel/parser/CHANGELOG.md
generated
vendored
File diff suppressed because it is too large
Load Diff
19
web/admin-spa/node_modules/@babel/parser/LICENSE
generated
vendored
19
web/admin-spa/node_modules/@babel/parser/LICENSE
generated
vendored
@@ -1,19 +0,0 @@
|
||||
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
19
web/admin-spa/node_modules/@babel/parser/README.md
generated
vendored
19
web/admin-spa/node_modules/@babel/parser/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
# @babel/parser
|
||||
|
||||
> A JavaScript parser
|
||||
|
||||
See our website [@babel/parser](https://babeljs.io/docs/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/parser
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/parser --dev
|
||||
```
|
||||
15
web/admin-spa/node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
15
web/admin-spa/node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable no-var, unicorn/prefer-node-protocol */
|
||||
|
||||
var parser = require("..");
|
||||
var fs = require("fs");
|
||||
|
||||
var filename = process.argv[2];
|
||||
if (!filename) {
|
||||
console.error("no filename specified");
|
||||
} else {
|
||||
var file = fs.readFileSync(filename, "utf8");
|
||||
var ast = parser.parse(file);
|
||||
|
||||
console.log(JSON.stringify(ast, null, " "));
|
||||
}
|
||||
14586
web/admin-spa/node_modules/@babel/parser/lib/index.js
generated
vendored
14586
web/admin-spa/node_modules/@babel/parser/lib/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
1
web/admin-spa/node_modules/@babel/parser/lib/index.js.map
generated
vendored
1
web/admin-spa/node_modules/@babel/parser/lib/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
50
web/admin-spa/node_modules/@babel/parser/package.json
generated
vendored
50
web/admin-spa/node_modules/@babel/parser/package.json
generated
vendored
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.28.0",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"javascript",
|
||||
"parser",
|
||||
"tc39",
|
||||
"ecmascript",
|
||||
"@babel/parser"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-parser"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"types": "./typings/babel-parser.d.ts",
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"typings/babel-parser.d.ts",
|
||||
"index.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"# dependencies": "This package doesn't actually have runtime dependencies. @babel/types is only needed for type definitions.",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.28.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.27.1",
|
||||
"@babel/helper-check-duplicate-nodes": "^7.27.1",
|
||||
"@babel/helper-fixtures": "^7.28.0",
|
||||
"@babel/helper-string-parser": "^7.27.1",
|
||||
"@babel/helper-validator-identifier": "^7.27.1",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"bin": "./bin/babel-parser.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
239
web/admin-spa/node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
239
web/admin-spa/node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
@@ -1,239 +0,0 @@
|
||||
// This file is auto-generated! Do not modify it directly.
|
||||
// Run `yarn gulp bundle-dts` to re-generate it.
|
||||
/* eslint-disable @typescript-eslint/consistent-type-imports, @typescript-eslint/no-redundant-type-constituents */
|
||||
import { File, Expression } from '@babel/types';
|
||||
|
||||
type BABEL_8_BREAKING = false;
|
||||
type IF_BABEL_7<V> = false extends BABEL_8_BREAKING ? V : never;
|
||||
|
||||
type Plugin$1 =
|
||||
| "asyncDoExpressions"
|
||||
| IF_BABEL_7<"asyncGenerators">
|
||||
| IF_BABEL_7<"bigInt">
|
||||
| IF_BABEL_7<"classPrivateMethods">
|
||||
| IF_BABEL_7<"classPrivateProperties">
|
||||
| IF_BABEL_7<"classProperties">
|
||||
| IF_BABEL_7<"classStaticBlock">
|
||||
| IF_BABEL_7<"decimal">
|
||||
| "decorators-legacy"
|
||||
| "deferredImportEvaluation"
|
||||
| "decoratorAutoAccessors"
|
||||
| "destructuringPrivate"
|
||||
| "deprecatedImportAssert"
|
||||
| "doExpressions"
|
||||
| IF_BABEL_7<"dynamicImport">
|
||||
| IF_BABEL_7<"explicitResourceManagement">
|
||||
| "exportDefaultFrom"
|
||||
| IF_BABEL_7<"exportNamespaceFrom">
|
||||
| "flow"
|
||||
| "flowComments"
|
||||
| "functionBind"
|
||||
| "functionSent"
|
||||
| "importMeta"
|
||||
| "jsx"
|
||||
| IF_BABEL_7<"jsonStrings">
|
||||
| IF_BABEL_7<"logicalAssignment">
|
||||
| IF_BABEL_7<"importAssertions">
|
||||
| IF_BABEL_7<"importReflection">
|
||||
| "moduleBlocks"
|
||||
| IF_BABEL_7<"moduleStringNames">
|
||||
| IF_BABEL_7<"nullishCoalescingOperator">
|
||||
| IF_BABEL_7<"numericSeparator">
|
||||
| IF_BABEL_7<"objectRestSpread">
|
||||
| IF_BABEL_7<"optionalCatchBinding">
|
||||
| IF_BABEL_7<"optionalChaining">
|
||||
| "partialApplication"
|
||||
| "placeholders"
|
||||
| IF_BABEL_7<"privateIn">
|
||||
| IF_BABEL_7<"regexpUnicodeSets">
|
||||
| "sourcePhaseImports"
|
||||
| "throwExpressions"
|
||||
| IF_BABEL_7<"topLevelAwait">
|
||||
| "v8intrinsic"
|
||||
| ParserPluginWithOptions[0];
|
||||
|
||||
type ParserPluginWithOptions =
|
||||
| ["decorators", DecoratorsPluginOptions]
|
||||
| ["discardBinding", { syntaxType: "void" }]
|
||||
| ["estree", { classFeatures?: boolean }]
|
||||
| IF_BABEL_7<["importAttributes", { deprecatedAssertSyntax: boolean }]>
|
||||
| IF_BABEL_7<["moduleAttributes", { version: "may-2020" }]>
|
||||
| ["optionalChainingAssign", { version: "2023-07" }]
|
||||
| ["pipelineOperator", PipelineOperatorPluginOptions]
|
||||
| ["recordAndTuple", RecordAndTuplePluginOptions]
|
||||
| ["flow", FlowPluginOptions]
|
||||
| ["typescript", TypeScriptPluginOptions];
|
||||
|
||||
type PluginConfig = Plugin$1 | ParserPluginWithOptions;
|
||||
|
||||
interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
allowCallParenthesized?: boolean;
|
||||
}
|
||||
|
||||
interface PipelineOperatorPluginOptions {
|
||||
proposal: BABEL_8_BREAKING extends false
|
||||
? "minimal" | "fsharp" | "hack" | "smart"
|
||||
: "fsharp" | "hack";
|
||||
topicToken?: "%" | "#" | "@@" | "^^" | "^";
|
||||
}
|
||||
|
||||
interface RecordAndTuplePluginOptions {
|
||||
syntaxType: "bar" | "hash";
|
||||
}
|
||||
|
||||
type FlowPluginOptions = BABEL_8_BREAKING extends true
|
||||
? {
|
||||
all?: boolean;
|
||||
enums?: boolean;
|
||||
}
|
||||
: {
|
||||
all?: boolean;
|
||||
};
|
||||
|
||||
interface TypeScriptPluginOptions {
|
||||
dts?: boolean;
|
||||
disallowAmbiguousJSXLike?: boolean;
|
||||
}
|
||||
|
||||
type Plugin = PluginConfig;
|
||||
|
||||
type SourceType = "script" | "commonjs" | "module" | "unambiguous";
|
||||
interface Options {
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
/**
|
||||
* By default, await use is not allowed outside of an async function.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowAwaitOutsideFunction?: boolean;
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
/**
|
||||
* By default, new.target use is not allowed outside of a function or class.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowNewTargetOutsideFunction?: boolean;
|
||||
allowSuperOutsideMethod?: boolean;
|
||||
/**
|
||||
* By default, exported identifiers must refer to a declared variable.
|
||||
* Set this to true to allow export statements to reference undeclared variables.
|
||||
*/
|
||||
allowUndeclaredExports?: boolean;
|
||||
/**
|
||||
* By default, yield use is not allowed outside of a generator function.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowYieldOutsideFunction?: boolean;
|
||||
/**
|
||||
* By default, Babel parser JavaScript code according to Annex B syntax.
|
||||
* Set this to `false` to disable such behavior.
|
||||
*/
|
||||
annexB?: boolean;
|
||||
/**
|
||||
* By default, Babel attaches comments to adjacent AST nodes.
|
||||
* When this option is set to false, comments are not attached.
|
||||
* It can provide up to 30% performance improvement when the input code has many comments.
|
||||
* @babel/eslint-parser will set it for you.
|
||||
* It is not recommended to use attachComment: false with Babel transform,
|
||||
* as doing so removes all the comments in output code, and renders annotations such as
|
||||
* /* istanbul ignore next *\/ nonfunctional.
|
||||
*/
|
||||
attachComment?: boolean;
|
||||
/**
|
||||
* By default, Babel always throws an error when it finds some invalid code.
|
||||
* When this option is set to true, it will store the parsing error and
|
||||
* try to continue parsing the invalid input file.
|
||||
*/
|
||||
errorRecovery?: boolean;
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in.
|
||||
* Can be one of "script", "commonjs", "module", or "unambiguous". Defaults to "script".
|
||||
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
|
||||
* of ES6 import or export statements.
|
||||
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
||||
*
|
||||
* Use "commonjs" to parse code that is intended to be run in a CommonJS environment such as Node.js.
|
||||
*/
|
||||
sourceType?: SourceType;
|
||||
/**
|
||||
* Correlate output AST nodes with their source filename.
|
||||
* Useful when generating code and source maps from the ASTs of multiple input files.
|
||||
*/
|
||||
sourceFilename?: string;
|
||||
/**
|
||||
* By default, all source indexes start from 0.
|
||||
* You can provide a start index to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startIndex?: number;
|
||||
/**
|
||||
* By default, the first line of code parsed is treated as line 1.
|
||||
* You can provide a line number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startLine?: number;
|
||||
/**
|
||||
* By default, the parsed code is treated as if it starts from line 1, column 0.
|
||||
* You can provide a column number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startColumn?: number;
|
||||
/**
|
||||
* Array containing the plugins that you want to enable.
|
||||
*/
|
||||
plugins?: Plugin[];
|
||||
/**
|
||||
* Should the parser work in strict mode.
|
||||
* Defaults to true if sourceType === 'module'. Otherwise, false.
|
||||
*/
|
||||
strictMode?: boolean;
|
||||
/**
|
||||
* Adds a ranges property to each node: [node.start, node.end]
|
||||
*/
|
||||
ranges?: boolean;
|
||||
/**
|
||||
* Adds all parsed tokens to a tokens property on the File node.
|
||||
*/
|
||||
tokens?: boolean;
|
||||
/**
|
||||
* By default, the parser adds information about parentheses by setting
|
||||
* `extra.parenthesized` to `true` as needed.
|
||||
* When this option is `true` the parser creates `ParenthesizedExpression`
|
||||
* AST nodes instead of using the `extra` property.
|
||||
*/
|
||||
createParenthesizedExpressions?: boolean;
|
||||
/**
|
||||
* The default is false in Babel 7 and true in Babel 8
|
||||
* Set this to true to parse it as an `ImportExpression` node.
|
||||
* Otherwise `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.
|
||||
*/
|
||||
createImportExpressions?: boolean;
|
||||
}
|
||||
|
||||
type ParserOptions = Partial<Options>;
|
||||
interface ParseError {
|
||||
code: string;
|
||||
reasonCode: string;
|
||||
}
|
||||
type ParseResult<Result extends File | Expression = File> = Result & {
|
||||
errors: null | ParseError[];
|
||||
};
|
||||
/**
|
||||
* Parse the provided code as an entire ECMAScript program.
|
||||
*/
|
||||
declare function parse(input: string, options?: ParserOptions): ParseResult<File>;
|
||||
declare function parseExpression(input: string, options?: ParserOptions): ParseResult<Expression>;
|
||||
|
||||
declare const tokTypes: {
|
||||
// todo(flow->ts) real token type
|
||||
[name: string]: any;
|
||||
};
|
||||
|
||||
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
|
||||
22
web/admin-spa/node_modules/@babel/types/LICENSE
generated
vendored
22
web/admin-spa/node_modules/@babel/types/LICENSE
generated
vendored
@@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
19
web/admin-spa/node_modules/@babel/types/README.md
generated
vendored
19
web/admin-spa/node_modules/@babel/types/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
# @babel/types
|
||||
|
||||
> Babel Types is a Lodash-esque utility library for AST nodes
|
||||
|
||||
See our website [@babel/types](https://babeljs.io/docs/babel-types) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/types
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/types --dev
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user