@uglifruits/utils 0.1.0
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 +209 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/install.d.ts +19 -0
- package/package.json +30 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
|
|
2
|
+
var e = typeof global == "object" && global && global.Object === Object && global, t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")(), r = n.Symbol, i = Object.prototype, a = i.hasOwnProperty, o = i.toString, s = r ? r.toStringTag : void 0;
|
|
3
|
+
function c(e) {
|
|
4
|
+
var t = a.call(e, s), n = e[s];
|
|
5
|
+
try {
|
|
6
|
+
e[s] = void 0;
|
|
7
|
+
var r = !0;
|
|
8
|
+
} catch {}
|
|
9
|
+
var i = o.call(e);
|
|
10
|
+
return r && (t ? e[s] = n : delete e[s]), i;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js
|
|
14
|
+
var l = Object.prototype.toString;
|
|
15
|
+
function u(e) {
|
|
16
|
+
return l.call(e);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js
|
|
20
|
+
var d = "[object Null]", f = "[object Undefined]", p = r ? r.toStringTag : void 0;
|
|
21
|
+
function m(e) {
|
|
22
|
+
return e == null ? e === void 0 ? f : d : p && p in Object(e) ? c(e) : u(e);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js
|
|
26
|
+
function h(e) {
|
|
27
|
+
return typeof e == "object" && !!e;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.js
|
|
31
|
+
var g = Array.isArray;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
|
|
34
|
+
function _(e) {
|
|
35
|
+
var t = typeof e;
|
|
36
|
+
return e != null && (t == "object" || t == "function");
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.js
|
|
40
|
+
function v(e) {
|
|
41
|
+
return e;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js
|
|
45
|
+
var y = "[object AsyncFunction]", b = "[object Function]", ee = "[object GeneratorFunction]", te = "[object Proxy]";
|
|
46
|
+
function ne(e) {
|
|
47
|
+
if (!_(e)) return !1;
|
|
48
|
+
var t = m(e);
|
|
49
|
+
return t == b || t == ee || t == y || t == te;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js
|
|
53
|
+
function re(e, t) {
|
|
54
|
+
for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1;);
|
|
55
|
+
return e;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js
|
|
59
|
+
var ie = 9007199254740991, ae = /^(?:0|[1-9]\d*)$/;
|
|
60
|
+
function oe(e, t) {
|
|
61
|
+
var n = typeof e;
|
|
62
|
+
return t ??= ie, !!t && (n == "number" || n != "symbol" && ae.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isLength.js
|
|
66
|
+
var se = 9007199254740991;
|
|
67
|
+
function x(e) {
|
|
68
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= se;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js
|
|
72
|
+
function S(e) {
|
|
73
|
+
return e != null && x(e.length) && !ne(e);
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js
|
|
77
|
+
var C = Object.prototype;
|
|
78
|
+
function w(e) {
|
|
79
|
+
var t = e && e.constructor;
|
|
80
|
+
return e === (typeof t == "function" && t.prototype || C);
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js
|
|
84
|
+
function T(e, t) {
|
|
85
|
+
for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
|
|
86
|
+
return r;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js
|
|
90
|
+
var E = "[object Arguments]";
|
|
91
|
+
function D(e) {
|
|
92
|
+
return h(e) && m(e) == E;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js
|
|
96
|
+
var O = Object.prototype, k = O.hasOwnProperty, A = O.propertyIsEnumerable, j = D(function() {
|
|
97
|
+
return arguments;
|
|
98
|
+
}()) ? D : function(e) {
|
|
99
|
+
return h(e) && k.call(e, "callee") && !A.call(e, "callee");
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js
|
|
103
|
+
function M() {
|
|
104
|
+
return !1;
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js
|
|
108
|
+
var N = typeof exports == "object" && exports && !exports.nodeType && exports, P = N && typeof module == "object" && module && !module.nodeType && module, F = P && P.exports === N ? n.Buffer : void 0, I = (F ? F.isBuffer : void 0) || M, L = "[object Arguments]", R = "[object Array]", z = "[object Boolean]", B = "[object Date]", V = "[object Error]", H = "[object Function]", U = "[object Map]", W = "[object Number]", G = "[object Object]", K = "[object RegExp]", ce = "[object Set]", le = "[object String]", ue = "[object WeakMap]", de = "[object ArrayBuffer]", fe = "[object DataView]", pe = "[object Float32Array]", me = "[object Float64Array]", he = "[object Int8Array]", ge = "[object Int16Array]", _e = "[object Int32Array]", ve = "[object Uint8Array]", ye = "[object Uint8ClampedArray]", be = "[object Uint16Array]", xe = "[object Uint32Array]", q = {};
|
|
109
|
+
q[pe] = q[me] = q[he] = q[ge] = q[_e] = q[ve] = q[ye] = q[be] = q[xe] = !0, q[L] = q[R] = q[de] = q[z] = q[fe] = q[B] = q[V] = q[H] = q[U] = q[W] = q[G] = q[K] = q[ce] = q[le] = q[ue] = !1;
|
|
110
|
+
function Se(e) {
|
|
111
|
+
return h(e) && x(e.length) && !!q[m(e)];
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js
|
|
115
|
+
function Ce(e) {
|
|
116
|
+
return function(t) {
|
|
117
|
+
return e(t);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js
|
|
122
|
+
var J = typeof exports == "object" && exports && !exports.nodeType && exports, Y = J && typeof module == "object" && module && !module.nodeType && module, X = Y && Y.exports === J && e.process, Z = function() {
|
|
123
|
+
try {
|
|
124
|
+
return Y && Y.require && Y.require("util").types || X && X.binding && X.binding("util");
|
|
125
|
+
} catch {}
|
|
126
|
+
}(), Q = Z && Z.isTypedArray, we = Q ? Ce(Q) : Se, Te = Object.prototype.hasOwnProperty;
|
|
127
|
+
function Ee(e, t) {
|
|
128
|
+
var n = g(e), r = !n && j(e), i = !n && !r && I(e), a = !n && !r && !i && we(e), o = n || r || i || a, s = o ? T(e.length, String) : [], c = s.length;
|
|
129
|
+
for (var l in e) (t || Te.call(e, l)) && !(o && (l == "length" || i && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || oe(l, c))) && s.push(l);
|
|
130
|
+
return s;
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js
|
|
134
|
+
function De(e, t) {
|
|
135
|
+
return function(n) {
|
|
136
|
+
return e(t(n));
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js
|
|
141
|
+
var $ = De(Object.keys, Object), Oe = Object.prototype.hasOwnProperty;
|
|
142
|
+
function ke(e) {
|
|
143
|
+
if (!w(e)) return $(e);
|
|
144
|
+
var t = [];
|
|
145
|
+
for (var n in Object(e)) Oe.call(e, n) && n != "constructor" && t.push(n);
|
|
146
|
+
return t;
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keys.js
|
|
150
|
+
function Ae(e) {
|
|
151
|
+
return S(e) ? Ee(e) : ke(e);
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js
|
|
155
|
+
function je(e) {
|
|
156
|
+
return function(t, n, r) {
|
|
157
|
+
for (var i = -1, a = Object(t), o = r(t), s = o.length; s--;) {
|
|
158
|
+
var c = o[e ? s : ++i];
|
|
159
|
+
if (n(a[c], c, a) === !1) break;
|
|
160
|
+
}
|
|
161
|
+
return t;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js
|
|
166
|
+
var Me = je();
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js
|
|
169
|
+
function Ne(e, t) {
|
|
170
|
+
return e && Me(e, t, Ae);
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js
|
|
174
|
+
function Pe(e, t) {
|
|
175
|
+
return function(n, r) {
|
|
176
|
+
if (n == null) return n;
|
|
177
|
+
if (!S(n)) return e(n, r);
|
|
178
|
+
for (var i = n.length, a = t ? i : -1, o = Object(n); (t ? a-- : ++a < i) && r(o[a], a, o) !== !1;);
|
|
179
|
+
return n;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js
|
|
184
|
+
var Fe = Pe(Ne);
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castFunction.js
|
|
187
|
+
function Ie(e) {
|
|
188
|
+
return typeof e == "function" ? e : v;
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forEach.js
|
|
192
|
+
function Le(e, t) {
|
|
193
|
+
return (g(e) ? re : Fe)(e, Ie(t));
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region install.ts
|
|
197
|
+
function Re(e) {
|
|
198
|
+
return e.install = (t) => {
|
|
199
|
+
let n = e.name;
|
|
200
|
+
t.component(n, e);
|
|
201
|
+
}, e;
|
|
202
|
+
}
|
|
203
|
+
function ze(e) {
|
|
204
|
+
return (t) => {
|
|
205
|
+
Le(e, (e) => t.use(e));
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
export { Re as attachInstall, ze as createInstaller };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './install';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { App, Plugin } from 'vue';
|
|
2
|
+
type SFCWithInstall<T> = T & {
|
|
3
|
+
install: (app: App) => void;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* 为单个组件绑上install方法,使其既能作为组件使用,也能作为插件注册
|
|
7
|
+
*
|
|
8
|
+
* @param component 原始组件,用泛型保留其原始类型
|
|
9
|
+
* @returns 带有install方法的组件
|
|
10
|
+
*/
|
|
11
|
+
export declare function attachInstall<T>(component: T): SFCWithInstall<T>;
|
|
12
|
+
/**
|
|
13
|
+
* 将多个增强为Vue Plugin的Vue自定义组件合并成一个总插件
|
|
14
|
+
*
|
|
15
|
+
* @param componentPlugs - 已经过withInstall处理、带install方法的组件数组
|
|
16
|
+
* @returns 一个总插件,安装时会依次注册所有传入的组件
|
|
17
|
+
*/
|
|
18
|
+
export declare function createInstaller(componentPlugs: Plugin[]): (app: App) => void;
|
|
19
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uglifruits/utils",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "./dist/types/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"description": "Utils for Uglifruits UI",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"utils",
|
|
19
|
+
"helpful",
|
|
20
|
+
"refined"
|
|
21
|
+
],
|
|
22
|
+
"author": "xylanny",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite build --config vite.config.ts --watch",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"coverage": "vitest run --coverage",
|
|
28
|
+
"build": "vite build --config vite.config.ts"
|
|
29
|
+
}
|
|
30
|
+
}
|