@fangzhongya/vue-archive 0.0.66 → 0.0.68
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/node/index.cjs +19 -19
- package/dist/node/index.js +19 -19
- package/dist/packages/utils/common.cjs +1 -1
- package/dist/packages/utils/common.js +72 -73
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -1244,26 +1244,26 @@ function getComponentsArr(urls, v, comRaw, com) {
|
|
|
1244
1244
|
let zv = v.dir.substring(0, v.dir.indexOf(dk)) + key.substring(z);
|
|
1245
1245
|
const reg = new RegExp("^" + v.dir);
|
|
1246
1246
|
let k = zv.replace(reg, "");
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
value.
|
|
1250
|
-
value.
|
|
1251
|
-
value
|
|
1252
|
-
value.value = k;
|
|
1253
|
-
value.dir = v.dir;
|
|
1254
|
-
value.cwd = v.cwd;
|
|
1255
|
-
value.suffix = getSuffix2(key);
|
|
1256
|
-
value.tdir = tdir;
|
|
1257
|
-
value.key = key;
|
|
1258
|
-
value.raw = "";
|
|
1259
|
-
value.getRaw = getRawValue(comRaw, key);
|
|
1260
|
-
props2.push(value);
|
|
1247
|
+
let value = getUrlName(k, v, urls, key, tdir);
|
|
1248
|
+
if (value) {
|
|
1249
|
+
value.component = com[value.key];
|
|
1250
|
+
value.getRaw = getRawValue(comRaw, value.key);
|
|
1251
|
+
arr.push(value);
|
|
1261
1252
|
} else {
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1253
|
+
if (v.comprops && isComprops("/" + k, v.comprops) || v.curprops && isCurprops("/" + k, v.curprops)) {
|
|
1254
|
+
let value2 = {};
|
|
1255
|
+
value2.url = zv;
|
|
1256
|
+
value2.comprops = v.comprops;
|
|
1257
|
+
value2.curprops = v.curprops;
|
|
1258
|
+
value2.value = k;
|
|
1259
|
+
value2.dir = v.dir;
|
|
1260
|
+
value2.cwd = v.cwd;
|
|
1261
|
+
value2.suffix = getSuffix2(key);
|
|
1262
|
+
value2.tdir = tdir;
|
|
1263
|
+
value2.key = key;
|
|
1264
|
+
value2.raw = "";
|
|
1265
|
+
value2.getRaw = getRawValue(comRaw, key);
|
|
1266
|
+
props2.push(value2);
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
});
|
package/dist/node/index.js
CHANGED
|
@@ -1229,26 +1229,26 @@ function getComponentsArr(urls, v, comRaw, com) {
|
|
|
1229
1229
|
let zv = v.dir.substring(0, v.dir.indexOf(dk)) + key.substring(z);
|
|
1230
1230
|
const reg = new RegExp("^" + v.dir);
|
|
1231
1231
|
let k = zv.replace(reg, "");
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
value.
|
|
1235
|
-
value.
|
|
1236
|
-
value
|
|
1237
|
-
value.value = k;
|
|
1238
|
-
value.dir = v.dir;
|
|
1239
|
-
value.cwd = v.cwd;
|
|
1240
|
-
value.suffix = getSuffix2(key);
|
|
1241
|
-
value.tdir = tdir;
|
|
1242
|
-
value.key = key;
|
|
1243
|
-
value.raw = "";
|
|
1244
|
-
value.getRaw = getRawValue(comRaw, key);
|
|
1245
|
-
props2.push(value);
|
|
1232
|
+
let value = getUrlName(k, v, urls, key, tdir);
|
|
1233
|
+
if (value) {
|
|
1234
|
+
value.component = com[value.key];
|
|
1235
|
+
value.getRaw = getRawValue(comRaw, value.key);
|
|
1236
|
+
arr.push(value);
|
|
1246
1237
|
} else {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1238
|
+
if (v.comprops && isComprops("/" + k, v.comprops) || v.curprops && isCurprops("/" + k, v.curprops)) {
|
|
1239
|
+
let value2 = {};
|
|
1240
|
+
value2.url = zv;
|
|
1241
|
+
value2.comprops = v.comprops;
|
|
1242
|
+
value2.curprops = v.curprops;
|
|
1243
|
+
value2.value = k;
|
|
1244
|
+
value2.dir = v.dir;
|
|
1245
|
+
value2.cwd = v.cwd;
|
|
1246
|
+
value2.suffix = getSuffix2(key);
|
|
1247
|
+
value2.tdir = tdir;
|
|
1248
|
+
value2.key = key;
|
|
1249
|
+
value2.raw = "";
|
|
1250
|
+
value2.getRaw = getRawValue(comRaw, key);
|
|
1251
|
+
props2.push(value2);
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./storage.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const N=require("@fangzhongya/utils/name/humpToLine"),R=require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");require("@fangzhongya/utils/basic/string/firstUpper");const w=require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const g=require("@fangzhongya/utils/judge/matchsStart"),q=require("@fangzhongya/utils/judge/matchsEnd"),$=["vue","js","ts"];function O(t){let e=N.humpToLine(t.name),r=[];return t.alias&&r.push(t.alias+"-"+e),r}function T(t,e,r){const s=g.matchsStart(t,e);return s&&r&&r.length>0?!g.matchsStart(t,r):s}function U(t,e,r){const s=q.matchsEnd(t,e);return s&&r&&r.length>0?!q.matchsEnd(t,r):s}function v(t,e,r){e.lastIndex=0;const s=e.exec(t);if(!s)return!1;const i=s.index;return t.substring(0,i).endsWith(r)}function z(t,e){e.lastIndex=0;const r=e.exec(t);if(!r)return"";const s=r.index;return t.substring(0,s)}function I(t){const e=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`${e(t)}$`)}function m(t,e){if(e&&e.length>0)for(const r of e)if(typeof r=="string"){if(t.endsWith(r)){const s=t.replace(I(r),"");if(s){const i=new RegExp("^.*/([^/]+)$");let n=s.match(i);if(n)return n[1]}}}else{const s=z(t,r);if(s){const i=new RegExp("^.*/([^/]+)$");let n=s.match(i);if(n)return n[1]}}return""}function d(t,e,r){const s=e.dir.replace(/^\.\/|((\.\.\/)+)/,"/");let i=t.indexOf(s),n=e.dir.substring(0,e.dir.indexOf(s))+t.substring(i),a="";if(e.getNameValue)a=e.getNameValue(t,e);else{const u=e.matchextss;u?a=m(t,[u]):a=m(t,e.matchexts)}if(a){let u={suffix:w.getSuffix(t),name:R.lineToLargeHump(a),value:a,adir:"",alias:e.alias,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0,url:n,comprops:e.comprops,curprops:e.curprops,dir:e.dir,cwd:e.cwd,tdir:r,key:t};return u.aliasNames=O(u),u}}function K(t,e,r){for(const s of e){const i="/"+s;if(r&&r.length>0){for(const n of r)if(typeof n=="string"){if(t.endsWith(i+n))return!0}else if(v(t,n,i))return!0}else if(t.includes(s))return!0}return!1}function M(t,e,r,s){const i=[],n=s.matchextss;return n&&i.push(n),t.filter(a=>K(a,[e],i))[0]||""}function E(t,e,r,s,i){if(T(t,e.matchs,e.nomatchs)){let n=!1;if(e.isMatch?n=e.isMatch(t,"",[],e):n=U(t,e.matchexts,e.nomatchexts),n){const a=e.getMatchs,u=m(s,e.matchexts);if(a){const l=a(r,u,"component",e);return d(l,e,i)}else if(e.matchextss){const f=M([s],u,"component",e)||M(r,u,"component",e);if(f)return d(f,e,i)}else return d(s,e,i)}}}function L(t){S.setSession("aside.key",t)}function V(){return S.getSession("aside.key")}function W(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function b(t,e){if(e)for(let r=0;r<e.length;r++){const s=e[r];if(typeof s=="string"){if(t.includes(s))return!0}else if(s.test(t))return!0}return!1}function A(t,e){if(e)for(let r=0;r<e.length;r++){const s=e[r];if(typeof s=="string"){if(t.endsWith(s))return!0}else if(s.test(t))return!0}return!1}function D(t,e,r,s){const i=[],n=[],a=W(e.dir);return t.forEach(u=>{const l=e.dir.replace(/^\.\/|((\.\.\/)+)/,"/");let f=u.indexOf(l),x=e.dir.substring(0,e.dir.indexOf(l))+u.substring(f);const C=new RegExp("^"+e.dir);let p=x.replace(C,""),o=E(p,e,t,u,a);if(o)o.component=s[o.key],o.getRaw=h(r,o.key),n.push(o);else if(e.comprops&&b("/"+p,e.comprops)||e.curprops&&A("/"+p,e.curprops)){let c={};c.url=x,c.comprops=e.comprops,c.curprops=e.curprops,c.value=p,c.dir=e.dir,c.cwd=e.cwd,c.suffix=w.getSuffix(u),c.tdir=a,c.key=u,c.raw="",c.getRaw=h(r,u),i.push(c)}}),{props:i,components:n}}function h(t,e){return typeof t=="function"?t:t?t[e]:null}exports.defaultExtensions=$;exports.getAsideKey=V;exports.getComponentsArr=D;exports.getRawValue=h;exports.getUrlName=E;exports.isComprops=b;exports.isCurprops=A;exports.setAsideKey=L;
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { getSession as
|
|
1
|
+
import { getSession as S, setSession as $ } from "./storage.js";
|
|
2
2
|
import "@fangzhongya/utils/basic/object/mergeObject";
|
|
3
3
|
import "@fangzhongya/utils/basic/array/toggleArray";
|
|
4
|
-
import { humpToLine as
|
|
5
|
-
import { lineToLargeHump as
|
|
4
|
+
import { humpToLine as N } from "@fangzhongya/utils/name/humpToLine";
|
|
5
|
+
import { lineToLargeHump as R } from "@fangzhongya/utils/name/lineToLargeHump";
|
|
6
6
|
import "@fangzhongya/utils/basic/string/appearNum";
|
|
7
7
|
import "@fangzhongya/utils/basic/string/firstLower";
|
|
8
8
|
import "@fangzhongya/utils/basic/array/duplicateRemoval";
|
|
9
9
|
import "@fangzhongya/utils/basic/array/asyncMergeArray";
|
|
10
10
|
import "@fangzhongya/utils/basic/string/firstUpper";
|
|
11
|
-
import { getSuffix as
|
|
11
|
+
import { getSuffix as b } from "@fangzhongya/utils/urls/getSuffix";
|
|
12
12
|
import "@fangzhongya/utils/basic/array/replaceAfter";
|
|
13
|
-
import { matchsStart as
|
|
14
|
-
import { matchsEnd as
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
let e =
|
|
13
|
+
import { matchsStart as x } from "@fangzhongya/utils/judge/matchsStart";
|
|
14
|
+
import { matchsEnd as g } from "@fangzhongya/utils/judge/matchsEnd";
|
|
15
|
+
const Z = ["vue", "js", "ts"];
|
|
16
|
+
function O(t) {
|
|
17
|
+
let e = N(t.name), r = [];
|
|
18
18
|
return t.alias && r.push(t.alias + "-" + e), r;
|
|
19
19
|
}
|
|
20
|
-
function O(t, e, r) {
|
|
21
|
-
const s = h(t, e);
|
|
22
|
-
return s && r && r.length > 0 ? !h(t, r) : s;
|
|
23
|
-
}
|
|
24
20
|
function U(t, e, r) {
|
|
25
21
|
const s = x(t, e);
|
|
26
22
|
return s && r && r.length > 0 ? !x(t, r) : s;
|
|
27
23
|
}
|
|
28
24
|
function v(t, e, r) {
|
|
25
|
+
const s = g(t, e);
|
|
26
|
+
return s && r && r.length > 0 ? !g(t, r) : s;
|
|
27
|
+
}
|
|
28
|
+
function z(t, e, r) {
|
|
29
29
|
e.lastIndex = 0;
|
|
30
30
|
const s = e.exec(t);
|
|
31
31
|
if (!s) return !1;
|
|
32
32
|
const i = s.index;
|
|
33
33
|
return t.substring(0, i).endsWith(r);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function A(t, e) {
|
|
36
36
|
e.lastIndex = 0;
|
|
37
37
|
const r = e.exec(t);
|
|
38
38
|
if (!r) return "";
|
|
39
39
|
const s = r.index;
|
|
40
40
|
return t.substring(0, s);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function C(t) {
|
|
43
43
|
const e = (r) => r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
44
44
|
return new RegExp(`${e(t)}$`);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function d(t, e) {
|
|
47
47
|
if (e && e.length > 0)
|
|
48
48
|
for (const r of e)
|
|
49
49
|
if (typeof r == "string") {
|
|
50
50
|
if (t.endsWith(r)) {
|
|
51
|
-
const s = t.replace(
|
|
51
|
+
const s = t.replace(C(r), "");
|
|
52
52
|
if (s) {
|
|
53
53
|
const i = new RegExp("^.*/([^/]+)$");
|
|
54
54
|
let n = s.match(i);
|
|
@@ -57,7 +57,7 @@ function m(t, e) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
} else {
|
|
60
|
-
const s =
|
|
60
|
+
const s = A(t, r);
|
|
61
61
|
if (s) {
|
|
62
62
|
const i = new RegExp("^.*/([^/]+)$");
|
|
63
63
|
let n = s.match(i);
|
|
@@ -67,20 +67,20 @@ function m(t, e) {
|
|
|
67
67
|
}
|
|
68
68
|
return "";
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function m(t, e, r) {
|
|
71
71
|
const s = e.dir.replace(/^\.\/|((\.\.\/)+)/, "/");
|
|
72
|
-
let i = t.indexOf(s), n = e.dir.substring(0, e.dir.indexOf(s)) + t.substring(i),
|
|
72
|
+
let i = t.indexOf(s), n = e.dir.substring(0, e.dir.indexOf(s)) + t.substring(i), o = "";
|
|
73
73
|
if (e.getNameValue)
|
|
74
|
-
|
|
74
|
+
o = e.getNameValue(t, e);
|
|
75
75
|
else {
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const u = e.matchextss;
|
|
77
|
+
u ? o = d(t, [u]) : o = d(t, e.matchexts);
|
|
78
78
|
}
|
|
79
|
-
if (
|
|
80
|
-
let
|
|
81
|
-
suffix:
|
|
82
|
-
name:
|
|
83
|
-
value:
|
|
79
|
+
if (o) {
|
|
80
|
+
let u = {
|
|
81
|
+
suffix: b(t),
|
|
82
|
+
name: R(o),
|
|
83
|
+
value: o,
|
|
84
84
|
adir: "",
|
|
85
85
|
alias: e.alias,
|
|
86
86
|
aliasNames: [],
|
|
@@ -96,10 +96,10 @@ function p(t, e, r) {
|
|
|
96
96
|
tdir: r,
|
|
97
97
|
key: t
|
|
98
98
|
};
|
|
99
|
-
return
|
|
99
|
+
return u.aliasNames = O(u), u;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function I(t, e, r) {
|
|
103
103
|
for (const s of e) {
|
|
104
104
|
const i = "/" + s;
|
|
105
105
|
if (r && r.length > 0) {
|
|
@@ -107,45 +107,45 @@ function C(t, e, r) {
|
|
|
107
107
|
if (typeof n == "string") {
|
|
108
108
|
if (t.endsWith(i + n))
|
|
109
109
|
return !0;
|
|
110
|
-
} else if (
|
|
110
|
+
} else if (z(t, n, i))
|
|
111
111
|
return !0;
|
|
112
112
|
} else if (t.includes(s))
|
|
113
113
|
return !0;
|
|
114
114
|
}
|
|
115
115
|
return !1;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function M(t, e, r, s) {
|
|
118
118
|
const i = [], n = s.matchextss;
|
|
119
|
-
return n && i.push(n), t.filter((
|
|
119
|
+
return n && i.push(n), t.filter((o) => I(o, [e], i))[0] || "";
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
if (
|
|
121
|
+
function W(t, e, r, s, i) {
|
|
122
|
+
if (U(t, e.matchs, e.nomatchs)) {
|
|
123
123
|
let n = !1;
|
|
124
|
-
if (e.isMatch ? n = e.isMatch(t, "", [], e) : n =
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
return
|
|
124
|
+
if (e.isMatch ? n = e.isMatch(t, "", [], e) : n = v(t, e.matchexts, e.nomatchexts), n) {
|
|
125
|
+
const o = e.getMatchs, u = d(s, e.matchexts);
|
|
126
|
+
if (o) {
|
|
127
|
+
const f = o(r, u, "component", e);
|
|
128
|
+
return m(f, e, i);
|
|
129
129
|
} else if (e.matchextss) {
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
return
|
|
130
|
+
const c = M([s], u, "component", e) || M(r, u, "component", e);
|
|
131
|
+
if (c)
|
|
132
|
+
return m(c, e, i);
|
|
133
133
|
} else
|
|
134
|
-
return
|
|
134
|
+
return m(s, e, i);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
138
|
+
function y(t) {
|
|
139
|
+
$("aside.key", t);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
141
|
+
function k() {
|
|
142
|
+
return S("aside.key");
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function D(t) {
|
|
145
145
|
let e = t.match(/\/([^\/]+)\/$/);
|
|
146
146
|
return e && e.length > 1 ? e[1] : "";
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function T(t, e) {
|
|
149
149
|
if (e)
|
|
150
150
|
for (let r = 0; r < e.length; r++) {
|
|
151
151
|
const s = e[r];
|
|
@@ -157,7 +157,7 @@ function D(t, e) {
|
|
|
157
157
|
}
|
|
158
158
|
return !1;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function V(t, e) {
|
|
161
161
|
if (e)
|
|
162
162
|
for (let r = 0; r < e.length; r++) {
|
|
163
163
|
const s = e[r];
|
|
@@ -169,35 +169,34 @@ function T(t, e) {
|
|
|
169
169
|
}
|
|
170
170
|
return !1;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
const i = [], n = [],
|
|
174
|
-
return t.forEach((
|
|
175
|
-
const
|
|
176
|
-
let
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
u && (u.component = s[u.key], u.getRaw = M(r, u.key), n.push(u));
|
|
172
|
+
function ee(t, e, r, s) {
|
|
173
|
+
const i = [], n = [], o = D(e.dir);
|
|
174
|
+
return t.forEach((u) => {
|
|
175
|
+
const f = e.dir.replace(/^\.\/|((\.\.\/)+)/, "/");
|
|
176
|
+
let c = u.indexOf(f), h = e.dir.substring(0, e.dir.indexOf(f)) + u.substring(c);
|
|
177
|
+
const E = new RegExp("^" + e.dir);
|
|
178
|
+
let p = h.replace(E, ""), l = W(p, e, t, u, o);
|
|
179
|
+
if (l)
|
|
180
|
+
l.component = s[l.key], l.getRaw = w(r, l.key), n.push(l);
|
|
181
|
+
else if (e.comprops && T("/" + p, e.comprops) || e.curprops && V("/" + p, e.curprops)) {
|
|
182
|
+
let a = {};
|
|
183
|
+
a.url = h, a.comprops = e.comprops, a.curprops = e.curprops, a.value = p, a.dir = e.dir, a.cwd = e.cwd, a.suffix = b(u), a.tdir = o, a.key = u, a.raw = "", a.getRaw = w(r, u), i.push(a);
|
|
185
184
|
}
|
|
186
185
|
}), {
|
|
187
186
|
props: i,
|
|
188
187
|
components: n
|
|
189
188
|
};
|
|
190
189
|
}
|
|
191
|
-
function
|
|
190
|
+
function w(t, e) {
|
|
192
191
|
return typeof t == "function" ? t : t ? t[e] : null;
|
|
193
192
|
}
|
|
194
193
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
194
|
+
Z as defaultExtensions,
|
|
195
|
+
k as getAsideKey,
|
|
196
|
+
ee as getComponentsArr,
|
|
197
|
+
w as getRawValue,
|
|
198
|
+
W as getUrlName,
|
|
199
|
+
T as isComprops,
|
|
200
|
+
V as isCurprops,
|
|
201
|
+
y as setAsideKey
|
|
203
202
|
};
|