reykit 1.0.169 → 1.0.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -49932,11 +49932,20 @@ const fk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49932
49932
  function dk() {
49933
49933
  document.documentElement.classList.add("debug");
49934
49934
  }
49935
- const pk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49935
+ function pk(a) {
49936
+ try {
49937
+ const i = new URL(a);
49938
+ return i.protocol === "http:" || i.protocol === "https:";
49939
+ } catch {
49940
+ return !1;
49941
+ }
49942
+ }
49943
+ const mk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49936
49944
  __proto__: null,
49937
- debugCss: dk
49945
+ debugCss: dk,
49946
+ isUrl: pk
49938
49947
  }, Symbol.toStringTag, { value: "Module" }));
49939
- class mk {
49948
+ class hk {
49940
49949
  /**
49941
49950
  * Build instance.
49942
49951
  *
@@ -50037,9 +50046,9 @@ function A4(a, i) {
50037
50046
  const u = a instanceof Blob ? window.URL.createObjectURL(a) : a, d = document.createElement("a");
50038
50047
  d.download = i, d.href = u, d.style.display = "none", document.body.appendChild(d), d.click(), d.remove(), a instanceof Blob && URL.revokeObjectURL(u);
50039
50048
  }
50040
- const hk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50049
+ const gk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50041
50050
  __proto__: null,
50042
- Storager: mk,
50051
+ Storager: hk,
50043
50052
  downloadFile: A4,
50044
50053
  openFile: M4
50045
50054
  }, Symbol.toStringTag, { value: "Module" }));
@@ -50047,15 +50056,15 @@ async function cR(a, i) {
50047
50056
  const u = i && i.width, d = (i && i.margin) ?? 0;
50048
50057
  return await Uj.toDataURL(a, { width: u, margin: d });
50049
50058
  }
50050
- async function gk(a, i) {
50059
+ async function vk(a, i) {
50051
50060
  const u = await cR(a, i), m = await (await fetch(u)).blob();
50052
50061
  return M4(m), u;
50053
50062
  }
50054
- async function vk(a, i) {
50063
+ async function yk(a, i) {
50055
50064
  const u = await cR(a, i), d = (i && i.fileName) ?? "qrcode.png", g = await (await fetch(u)).blob();
50056
50065
  return A4(g, d), u;
50057
50066
  }
50058
- async function yk(a, i, u) {
50067
+ async function bk(a, i, u) {
50059
50068
  const d = await cR(a, u);
50060
50069
  if (typeof i == "string") {
50061
50070
  const m = document.getElementById(i);
@@ -50064,14 +50073,14 @@ async function yk(a, i, u) {
50064
50073
  }
50065
50074
  return i.setAttribute("src", d), d;
50066
50075
  }
50067
- const bk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50076
+ const xk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50068
50077
  __proto__: null,
50069
- downloadQrcode: vk,
50078
+ downloadQrcode: yk,
50070
50079
  getQrcode: cR,
50071
- openQrcode: gk,
50072
- setQrcode: yk
50080
+ openQrcode: vk,
50081
+ setQrcode: bk
50073
50082
  }, Symbol.toStringTag, { value: "Module" }));
50074
- async function xk(a, i) {
50083
+ async function Sk(a, i) {
50075
50084
  let {
50076
50085
  params: u,
50077
50086
  body: d,
@@ -50106,48 +50115,48 @@ async function xk(a, i) {
50106
50115
  }
50107
50116
  return C;
50108
50117
  }
50109
- const Sk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50118
+ const Ek = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50110
50119
  __proto__: null,
50111
- request: xk
50112
- }, Symbol.toStringTag, { value: "Module" })), Ek = /^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, Rk = /^https?:\/\/[^\s/$.?#].[^\s]*$/, Tk = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/, Ck = /^1[3-9]\d{9}$/, Ok = /^[\u4e00-\u9fa5]+$/, wk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50120
+ request: Sk
50121
+ }, Symbol.toStringTag, { value: "Module" })), Rk = /^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, Tk = /^https?:\/\/[^\s/$.?#].[^\s]*$/, Ck = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/, Ok = /^1[3-9]\d{9}$/, wk = /^[\u4e00-\u9fa5]+$/, Nk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50113
50122
  __proto__: null,
50114
- PATTERN_CN: Ok,
50115
- PATTERN_EMAIL: Tk,
50116
- PATTERN_IP: Ek,
50117
- PATTERN_PHONE: Ck,
50118
- PATTERN_URL: Rk
50123
+ PATTERN_CN: wk,
50124
+ PATTERN_EMAIL: Ck,
50125
+ PATTERN_IP: Rk,
50126
+ PATTERN_PHONE: Ok,
50127
+ PATTERN_URL: Tk
50119
50128
  }, Symbol.toStringTag, { value: "Module" }));
50120
- function Nk() {
50129
+ function Mk() {
50121
50130
  const a = /* @__PURE__ */ new Date();
50122
50131
  return a.getFullYear() + "-" + String(a.getMonth() + 1).padStart(2, "0") + "-" + String(a.getDate()).padStart(2, "0") + "T" + String(a.getHours()).padStart(2, "0") + ":" + String(a.getMinutes()).padStart(2, "0");
50123
50132
  }
50124
- const Mk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50133
+ const Ak = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50125
50134
  __proto__: null,
50126
- datetimeLocal: Nk
50127
- }, Symbol.toStringTag, { value: "Module" })), Xk = {
50135
+ datetimeLocal: Mk
50136
+ }, Symbol.toStringTag, { value: "Module" })), Qk = {
50128
50137
  component: fk,
50129
50138
  ui: C4,
50130
- base: pk,
50139
+ base: mk,
50131
50140
  data: lk,
50132
- image: bk,
50133
- net: Sk,
50134
- re: wk,
50141
+ image: xk,
50142
+ net: Ek,
50143
+ re: Nk,
50135
50144
  react: Xj,
50136
- time: Mk,
50145
+ time: Ak,
50137
50146
  twc: C6,
50138
- window: hk
50147
+ window: gk
50139
50148
  };
50140
50149
  export {
50141
- pk as base,
50150
+ mk as base,
50142
50151
  fk as component,
50143
50152
  lk as data,
50144
- Xk as default,
50145
- bk as image,
50146
- Sk as net,
50147
- wk as re,
50153
+ Qk as default,
50154
+ xk as image,
50155
+ Ek as net,
50156
+ Nk as re,
50148
50157
  Xj as react,
50149
- Mk as time,
50158
+ Ak as time,
50150
50159
  C6 as twc,
50151
50160
  C4 as ui,
50152
- hk as window
50161
+ gk as window
50153
50162
  };
@@ -13,3 +13,10 @@ export type KeyByValue<T, V> = {
13
13
  * Start debug CSS style, need to import 'reykit/debug' CSS style first.
14
14
  */
15
15
  export declare function debugCss(): void;
16
+ /**
17
+ * Judge whether value is a URL.
18
+ *
19
+ * @param value - Value.
20
+ * @returns Judgement result.
21
+ */
22
+ export declare function isUrl(value: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.169",
3
+ "version": "1.0.170",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [