@fangzhongya/vue-components 0.1.29 → 0.1.30

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.
Files changed (61) hide show
  1. package/dist/archive.cjs +190 -340
  2. package/dist/archive.d.cts +5 -4
  3. package/dist/archive.d.ts +5 -4
  4. package/dist/archive.js +190 -341
  5. package/dist/chunk-J7CICTHH-DzD10422.cjs +25 -0
  6. package/dist/chunk-J7CICTHH-Ikr5rmAQ.js +20 -0
  7. package/dist/component-B-5G8Yjc.js +431 -0
  8. package/dist/component-CVkcT_sw.cjs +459 -0
  9. package/dist/component.cjs +2 -8
  10. package/dist/component.d.cts +14 -14
  11. package/dist/component.d.ts +15 -14
  12. package/dist/component.js +2 -8
  13. package/dist/config.cjs +59 -6
  14. package/dist/config.d.cts +134 -133
  15. package/dist/config.d.ts +134 -133
  16. package/dist/config.js +57 -5
  17. package/dist/import.cjs +18 -25
  18. package/dist/import.d.cts +5 -4
  19. package/dist/import.d.ts +5 -4
  20. package/dist/import.js +18 -26
  21. package/dist/imports-Cl3zPCxJ.cjs +971 -0
  22. package/dist/imports-DLu2DPCK.js +966 -0
  23. package/dist/imports.cjs +2 -8
  24. package/dist/imports.d.cts +14 -14
  25. package/dist/imports.d.ts +15 -14
  26. package/dist/imports.js +2 -8
  27. package/dist/index-5NuL-vgA.d.ts +5609 -0
  28. package/dist/index-DORWvPc3.d.cts +5609 -0
  29. package/dist/index.cjs +8 -17
  30. package/dist/index.d.cts +7 -8
  31. package/dist/index.d.ts +7 -8
  32. package/dist/index.js +6 -17
  33. package/dist/library.cjs +32 -48
  34. package/dist/library.d.cts +7 -6
  35. package/dist/library.d.ts +7 -6
  36. package/dist/library.js +32 -49
  37. package/dist/resolver.cjs +25 -10
  38. package/dist/resolver.d.cts +5 -4
  39. package/dist/resolver.d.ts +5 -4
  40. package/dist/resolver.js +24 -10
  41. package/dist/types-CZdqb5KI-T7Ielv5Y.d.cts +134 -0
  42. package/dist/types-CZdqb5KI-T7Ielv5Y.d.ts +134 -0
  43. package/dist/util-Ddld3oFr.js +93 -0
  44. package/dist/util-DtBzae46.cjs +116 -0
  45. package/dist/util.cjs +8 -16
  46. package/dist/util.d.cts +104 -5
  47. package/dist/util.d.ts +104 -5
  48. package/dist/util.js +3 -16
  49. package/package.json +10 -10
  50. package/dist/chunk-2SBJQUCI.cjs +0 -1238
  51. package/dist/chunk-3XFEJIQP.js +0 -135
  52. package/dist/chunk-6PYVVU7E.cjs +0 -581
  53. package/dist/chunk-7JRVVHVI.cjs +0 -33
  54. package/dist/chunk-AKNB7BKJ.cjs +0 -25
  55. package/dist/chunk-DURXCSNX.js +0 -62
  56. package/dist/chunk-HFFYPZA3.js +0 -1238
  57. package/dist/chunk-IXN2F3IJ.js +0 -581
  58. package/dist/chunk-NLSI7A24.cjs +0 -135
  59. package/dist/chunk-RRQV2YXW.js +0 -33
  60. package/dist/chunk-TVGK2KRP.js +0 -25
  61. package/dist/chunk-UNBQUEQ4.cjs +0 -62
@@ -1,581 +0,0 @@
1
- import {
2
- getComponentNames,
3
- styleLog
4
- } from "./chunk-3XFEJIQP.js";
5
- import {
6
- humpToLine
7
- } from "./chunk-TVGK2KRP.js";
8
-
9
- // packages/component.ts
10
- import fastGlob from "fast-glob";
11
- import { resolve } from "path";
12
-
13
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-YNOFNHEK.js
14
- function matchsEnd(key, matchs) {
15
- if (matchs && matchs.length > 0) {
16
- for (const value of matchs) {
17
- if (typeof value == "string") {
18
- if (key.endsWith(value)) {
19
- return true;
20
- }
21
- } else {
22
- if (value.test(key)) {
23
- return true;
24
- }
25
- }
26
- }
27
- return false;
28
- } else {
29
- return true;
30
- }
31
- }
32
-
33
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
34
- function matchsStart(key, matchs) {
35
- if (matchs && matchs.length > 0) {
36
- for (const value of matchs) {
37
- if (typeof value == "string") {
38
- if (key.startsWith(value)) {
39
- return true;
40
- }
41
- } else {
42
- if (value.test(key)) {
43
- return true;
44
- }
45
- }
46
- }
47
- return false;
48
- } else {
49
- return true;
50
- }
51
- }
52
-
53
- // packages/component.ts
54
- function checkSuffixBeforeMatch(str, regex, suffix) {
55
- regex.lastIndex = 0;
56
- const match = regex.exec(str);
57
- if (!match) return false;
58
- const matchStartIndex = match.index;
59
- const beforeMatch = str.substring(0, matchStartIndex);
60
- return beforeMatch.endsWith(suffix);
61
- }
62
- function isUrlsMatchi(key, arr, matchs) {
63
- for (const name of arr) {
64
- const t = "/" + name;
65
- if (matchs && matchs.length > 0) {
66
- for (const value of matchs) {
67
- if (typeof value == "string") {
68
- if (key.endsWith(t + value)) {
69
- return true;
70
- }
71
- } else {
72
- if (checkSuffixBeforeMatch(key, value, t)) {
73
- return true;
74
- }
75
- }
76
- }
77
- } else {
78
- const v = key.includes(name);
79
- if (v) {
80
- return true;
81
- }
82
- }
83
- }
84
- return false;
85
- }
86
- var FangComponent = class {
87
- config;
88
- #comUrls;
89
- #dirUrls;
90
- #cssUrls;
91
- #cacheObj;
92
- #curDir;
93
- constructor(config) {
94
- this.config = config || {};
95
- this.#setConfigValue();
96
- }
97
- // /**
98
- // * 配置参数
99
- // */
100
- // get config() {
101
- // return this.config;
102
- // }
103
- /**
104
- * 初始化数据
105
- */
106
- #setConfigValue() {
107
- this.#comUrls = [];
108
- this.#dirUrls = [];
109
- this.#cssUrls = [];
110
- this.#cacheObj = {};
111
- this.#curDir = "";
112
- if (this.config.dir) {
113
- this.config.dir = this.config.dir + "/";
114
- this.config.dir = this.config.dir.replace(/\/\/$/, "/");
115
- this.#curDir = resolve(process.cwd(), this.config.dir).replace(/\\/g, "/") + "/";
116
- }
117
- this.#getUrls();
118
- }
119
- /**
120
- * 别名数组
121
- */
122
- #getNames() {
123
- if (this.config.getAliass) {
124
- return this.config.getAliass;
125
- } else {
126
- return function(name, _type, c) {
127
- const arr = getComponentNames(name);
128
- if (c.alias) {
129
- return [...getComponentNames(c.alias + "-" + name), ...arr];
130
- } else {
131
- return arr;
132
- }
133
- };
134
- }
135
- }
136
- // 可以添加 @ts-ignore 注释暂时忽略这个警告
137
- // @ts-ignore
138
- // #getMatchsUrl(
139
- // urls: Array<string>,
140
- // name: string,
141
- // type: string,
142
- // config: Config,
143
- // ) {
144
- // const arr = this.#getNames()(name, type, config);
145
- // const ms: FangMatchs = [];
146
- // const m = config.matchextss;
147
- // if (m) {
148
- // ms.push(m);
149
- // }
150
- // return (
151
- // urls.filter((v) => {
152
- // return isUrlsMatchi(v, arr, ms);
153
- // })[0] || ''
154
- // );
155
- // }
156
- #isMatchFile(url, arr, matchexts, nomatchexts) {
157
- const is = isUrlsMatchi(url, arr, matchexts);
158
- if (is && nomatchexts && nomatchexts.length > 0) {
159
- if (matchsEnd(url, nomatchexts)) {
160
- return false;
161
- } else {
162
- return true;
163
- }
164
- } else {
165
- return is;
166
- }
167
- }
168
- #isMatchDir(url) {
169
- const is = matchsStart(url, this.config.matchs);
170
- const nomatchs = this.config.nomatchs;
171
- if (is && nomatchs && nomatchs.length > 0) {
172
- if (matchsStart(url, nomatchs)) {
173
- return false;
174
- } else {
175
- return true;
176
- }
177
- } else {
178
- return is;
179
- }
180
- }
181
- /**
182
- * 读取url地址列表
183
- */
184
- #getUrls() {
185
- const url = this.#getFgUrl();
186
- const reg = new RegExp("^" + this.#curDir);
187
- let isUrl = (key) => {
188
- const uk = key.replace(reg, "");
189
- return this.#isMatchDir(uk);
190
- };
191
- if (url) {
192
- const globs = fastGlob.sync(url, {
193
- onlyFiles: false,
194
- absolute: true
195
- }) || [];
196
- this.#comUrls = globs.filter((key) => {
197
- return isUrl(key);
198
- });
199
- }
200
- if (this.config.directives) {
201
- const durl = this.config.dir + "**/" + this.config.directives + "/**/*.{js,ts}";
202
- const globs = fastGlob.sync(durl, {
203
- onlyFiles: false,
204
- absolute: true
205
- }) || [];
206
- this.#dirUrls = globs.filter((key) => {
207
- return isUrl(key);
208
- });
209
- }
210
- if (this.config.csss !== "") {
211
- const cs = this.config.csssuffixs ?? ["css", "scss"];
212
- let uf = cs.join();
213
- if (cs.length > 1) {
214
- uf = "{" + cs.join(",") + "}";
215
- }
216
- let curl = this.config.dir + "**/*." + uf;
217
- if (this.config.csss) {
218
- curl = this.config.dir + "**/" + this.config.csss + "/**/*." + uf;
219
- }
220
- const globs = fastGlob.sync(curl, {
221
- onlyFiles: false,
222
- absolute: true
223
- }) || [];
224
- this.#cssUrls = globs.filter((key) => {
225
- return isUrl(key);
226
- });
227
- }
228
- if (this.config.urlprefix) {
229
- if (this.config.dir) {
230
- const dir = this.config.dir;
231
- const urls = [];
232
- const dirUrls = [];
233
- const cssUrls = [];
234
- this.#comUrls?.forEach((key) => {
235
- urls.push(key.replace(reg, dir));
236
- });
237
- this.#dirUrls?.forEach((key) => {
238
- dirUrls.push(key.replace(reg, dir));
239
- });
240
- this.#cssUrls?.forEach((key) => {
241
- cssUrls.push(key.replace(reg, dir));
242
- });
243
- this.config.urls = urls;
244
- this.config.dirUrls = dirUrls;
245
- this.config.cssUrls = cssUrls;
246
- }
247
- }
248
- }
249
- /**
250
- * 获取components 的匹配路径
251
- * @returns { String } 匹配路径
252
- */
253
- #getFgUrl() {
254
- if (this.config.extensions) {
255
- if (this.config.extensions.length > 1) {
256
- return this.config.dir + "**/*.{" + this.config.extensions.join(",") + "}";
257
- } else if (this.config.extensions.length == 1) {
258
- return this.config.dir + "**/*." + this.config.extensions[0];
259
- }
260
- } else {
261
- return this.config.dir + "**/*.*";
262
- }
263
- return;
264
- }
265
- /**
266
- * 获取当前缓存数
267
- * @param {String} name 名称
268
- * @param {String} type 类型
269
- * @returns { Object } 注册的对象
270
- */
271
- #getCache(name, type) {
272
- if (this.#cacheObj) {
273
- const obj = this.#cacheObj[type] || {};
274
- return obj[name];
275
- }
276
- }
277
- /**
278
- * 设置缓存数据
279
- * @param {String} name 名称
280
- * @param {String} type 类型
281
- * @param { Object } 注册的对象
282
- */
283
- #setCache(name, type, obj) {
284
- const cach = this.#cacheObj || {};
285
- const co = cach[type] || {};
286
- co[name] = obj;
287
- cach[type] = co;
288
- }
289
- /**
290
- * 是否要替换
291
- * @param { String } name 名称
292
- * @returns { Boolean } 是否要替换
293
- */
294
- #namefilter(name) {
295
- name = humpToLine(name);
296
- if (this.config.startss) {
297
- for (let index = 0; index < this.config.startss.length; index++) {
298
- const element = this.config.startss[index] + "-";
299
- if (name.startsWith(element)) {
300
- return false;
301
- }
302
- }
303
- }
304
- if (this.config.filtes) {
305
- for (let index = 0; index < this.config.filtes.length; index++) {
306
- const element = this.config.filtes[index];
307
- if (name === element) {
308
- return false;
309
- }
310
- }
311
- }
312
- return true;
313
- }
314
- /**
315
- * 返回对应的值
316
- * @param {String} from 文件地址
317
- * @param {String} name 名称
318
- * @param {String} type 类型
319
- * @returns { Object } 注册的对象
320
- */
321
- #getNameFromUrl(from, name, type, sideEffects) {
322
- let dname = "";
323
- if (this.config.getFromName) {
324
- dname = this.config.getFromName(from, name, type);
325
- }
326
- return {
327
- name: dname || "default",
328
- from,
329
- sideEffects
330
- };
331
- }
332
- /**
333
- * 通过名称匹配对应路径
334
- * @param {String} name 名称
335
- * @param {String} type 类型
336
- * @returns { Object } 注册的对象
337
- */
338
- #setNameFrom(name, type) {
339
- const from = this.#getMatchUrl(name, type);
340
- if (from) {
341
- let sideEffects = void 0;
342
- if (type == "component") {
343
- sideEffects = this.#getMatchUrl(name, "sideEffects");
344
- }
345
- return this.#getNameFromUrl(from, name, type, sideEffects);
346
- }
347
- }
348
- /**
349
- * 匹配到url地址
350
- * @param {string} arr 需要匹配的地址名称数组
351
- * @param {String} type 类型
352
- * @returns {Array} 匹配到的地址数组
353
- */
354
- #getUrlsMatchi(name, type) {
355
- const arr = this.#getNames()(name, type, this.config);
356
- const as = [];
357
- if (type == "directive") {
358
- const isMatchurl = this.config.isMatchDir;
359
- if (isMatchurl) {
360
- this.#dirUrls?.forEach((key) => {
361
- if (isMatchurl(key, name, arr, this.config)) {
362
- as.push(key);
363
- }
364
- });
365
- } else {
366
- this.#dirUrls?.forEach((key) => {
367
- if (this.#isMatchFile(
368
- key,
369
- arr,
370
- this.config.matchDirexts,
371
- this.config.nomatchDirexts
372
- )) {
373
- as.push(key);
374
- }
375
- });
376
- }
377
- } else if (type == "sideEffects") {
378
- const isMatchurl = this.config.isMatchCss;
379
- if (isMatchurl) {
380
- this.#dirUrls?.forEach((key) => {
381
- if (isMatchurl(key, name, arr, this.config)) {
382
- as.push(key);
383
- }
384
- });
385
- } else {
386
- this.#cssUrls?.forEach((key) => {
387
- if (this.#isMatchFile(
388
- key,
389
- arr,
390
- this.config.matchCsss,
391
- this.config.nomatchCsss
392
- )) {
393
- as.push(key);
394
- }
395
- });
396
- }
397
- } else {
398
- const isMatchurl = this.config.isMatch;
399
- if (isMatchurl) {
400
- this.#dirUrls?.forEach((key) => {
401
- if (isMatchurl(key, name, arr, this.config)) {
402
- as.push(key);
403
- }
404
- });
405
- } else {
406
- this.#comUrls?.forEach((key) => {
407
- if (this.#isMatchFile(
408
- key,
409
- arr,
410
- this.config.matchexts,
411
- this.config.nomatchexts
412
- )) {
413
- as.push(key);
414
- }
415
- });
416
- }
417
- }
418
- return as;
419
- }
420
- /**
421
- * 获取对应的url
422
- * @param {Array} urls 匹配到的地址数组
423
- * @param {String} name 名称
424
- * @param {String} type 类型
425
- * @returns { String } 文件地址
426
- */
427
- #getCorrespondUrl(urls, name, type) {
428
- const arr = this.#getNames()(name, type, this.config);
429
- if (type == "directive") {
430
- const vs = this.#dirUrls || [];
431
- const getUrl = this.config.getMatchDirs;
432
- if (getUrl) {
433
- return getUrl(vs, name, type, this.config);
434
- } else {
435
- const ms = [];
436
- const m = this.config.matchDirextss;
437
- if (m) {
438
- ms.push(m);
439
- }
440
- return urls.filter((key) => {
441
- return isUrlsMatchi(key, arr, ms);
442
- })[0] || vs.filter((key) => {
443
- return isUrlsMatchi(key, arr, ms);
444
- })[0];
445
- }
446
- } else if (type == "sideEffects") {
447
- const vs = this.#cssUrls || [];
448
- const getUrl = this.config.getMatchCsss;
449
- if (getUrl) {
450
- return getUrl(vs, name, type, this.config);
451
- } else {
452
- const ms = [];
453
- const m = this.config.matchCssss;
454
- if (m) {
455
- ms.push(m);
456
- }
457
- return urls.filter((key) => {
458
- return isUrlsMatchi(key, arr, ms);
459
- })[0] || vs.filter((key) => {
460
- return isUrlsMatchi(key, arr, ms);
461
- })[0];
462
- }
463
- } else {
464
- const vs = this.#comUrls || [];
465
- const getUrl = this.config.getMatchs;
466
- if (getUrl) {
467
- return getUrl(vs, name, type, this.config);
468
- } else {
469
- const ms = [];
470
- const m = this.config.matchextss;
471
- if (m) {
472
- ms.push(m);
473
- }
474
- return urls.filter((key) => {
475
- return isUrlsMatchi(key, arr, ms);
476
- })[0] || vs.filter((key) => {
477
- return isUrlsMatchi(key, arr, ms);
478
- })[0];
479
- }
480
- }
481
- }
482
- /**
483
- * 无前缀匹配
484
- * @param {String} name 名称
485
- * @param {String} type 类型
486
- * @returns { String } 文件地址
487
- */
488
- #getMatchUrl(name, type) {
489
- const urls = this.#getUrlsMatchi(name, type);
490
- return this.#getCorrespondUrl(urls, name, type);
491
- }
492
- /**
493
- * 输出日志
494
- * @param name
495
- * @param type
496
- * @param obj
497
- * @param is
498
- */
499
- #setLog(name, type, obj, is) {
500
- if (this.config.log) {
501
- const texts = {
502
- component: 2,
503
- directive: 4,
504
- sideEffects: 5
505
- };
506
- const arr = [];
507
- arr.push(
508
- styleLog("[@fangzhongya/vue-components]", {
509
- text: 3
510
- })
511
- );
512
- if (obj && obj.from) {
513
- let sfrom = styleLog(obj?.from, {
514
- text: 4,
515
- revert: true
516
- });
517
- arr.push(
518
- styleLog(type, {
519
- text: texts[type]
520
- })
521
- );
522
- arr.push(
523
- styleLog(name, {
524
- bold: true
525
- })
526
- );
527
- if (!is) {
528
- sfrom = styleLog("+", {
529
- text: 2
530
- }) + sfrom;
531
- }
532
- arr.push(sfrom);
533
- if (obj.sideEffects) {
534
- arr.push(
535
- styleLog(obj.sideEffects.toString(), {
536
- text: texts["sideEffects"]
537
- })
538
- );
539
- }
540
- } else {
541
- arr.push(
542
- styleLog(type, {
543
- text: texts[type]
544
- })
545
- );
546
- arr.push(
547
- styleLog(name, {
548
- bold: true,
549
- text: 1
550
- })
551
- );
552
- }
553
- console.log(arr.join(" "));
554
- }
555
- }
556
- /**
557
- * 自动按需匹配注册
558
- * @param {String} name 名称
559
- * @param {String} type 类型
560
- * @returns { Object } 注册的对象
561
- */
562
- resolve(name, type) {
563
- const cache = this.#getCache(name, type);
564
- if (this.config.isCache && cache) {
565
- this.#setLog(name, type, cache, true);
566
- return cache;
567
- } else if (this.#namefilter(name)) {
568
- let obj = this.#setNameFrom(name, type);
569
- if (obj) {
570
- this.#setLog(name, type, obj);
571
- this.#setCache(name, type, obj);
572
- return obj;
573
- }
574
- }
575
- }
576
- };
577
- var component_default = FangComponent;
578
-
579
- export {
580
- component_default
581
- };
@@ -1,135 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkAKNB7BKJcjs = require('./chunk-AKNB7BKJ.cjs');
4
-
5
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-HVQG2IGJ.js
6
- function styleLog(msg = "", obj) {
7
- const arr = ["\x1B[0m"];
8
- if (_optionalChain([obj, 'optionalAccess', _ => _.revert])) {
9
- arr.push("\x1B[4m");
10
- }
11
- if (_optionalChain([obj, 'optionalAccess', _2 => _2.lineThrough])) {
12
- arr.push("\x1B[9m");
13
- }
14
- if (_optionalChain([obj, 'optionalAccess', _3 => _3.italic])) {
15
- arr.push("\x1B[3m");
16
- }
17
- if (_optionalChain([obj, 'optionalAccess', _4 => _4.bold])) {
18
- arr.push("\x1B[1m");
19
- }
20
- if (_optionalChain([obj, 'optionalAccess', _5 => _5.bag])) {
21
- arr.push(`\x1B[4${_optionalChain([obj, 'optionalAccess', _6 => _6.bag])}m`);
22
- } else {
23
- arr.push("\x1B[40m");
24
- }
25
- if (_optionalChain([obj, 'optionalAccess', _7 => _7.text])) {
26
- arr.push(`\x1B[3${_optionalChain([obj, 'optionalAccess', _8 => _8.text])}m`);
27
- } else {
28
- arr.push("\x1B[30m");
29
- }
30
- arr.push(msg);
31
- arr.push("\x1B[0m");
32
- return arr.join("");
33
- }
34
-
35
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-A6J46LQK.js
36
- function unmergeObject(a, b, j = 0, i) {
37
- let c;
38
- if (a instanceof Array) {
39
- if (j > 0 && i) {
40
- c = Object.assign([], a);
41
- if (b instanceof Array) {
42
- for (const v of b) {
43
- if (!a.includes(v)) {
44
- c.push(v);
45
- }
46
- }
47
- } else {
48
- if (!a.includes(b)) {
49
- c.push(b);
50
- }
51
- }
52
- } else {
53
- c = b;
54
- }
55
- } else if (typeof a == "object") {
56
- const cv = Object.prototype.toString.call(a);
57
- const ct = Object.prototype.toString.call(b);
58
- if (a && typeof b == "object" && cv == ct && j > 0) {
59
- c = { ...a };
60
- const n = j - 1;
61
- if (n > 0) {
62
- for (const key in b) {
63
- const v = a[key];
64
- const t = b[key];
65
- c[key] = unmergeObject(v, t, n, i);
66
- }
67
- } else {
68
- for (const key in b) {
69
- c[key] = b[key];
70
- }
71
- }
72
- } else {
73
- c = b;
74
- }
75
- } else {
76
- c = b;
77
- }
78
- return c;
79
- }
80
-
81
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
82
- function firstUpper(str) {
83
- return str.slice(0, 1).toUpperCase() + str.slice(1);
84
- }
85
-
86
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
87
- function lineToLargeHump(name) {
88
- let arr = name.split("-");
89
- arr = arr.map((vs) => {
90
- return firstUpper(vs);
91
- });
92
- return arr.join("");
93
- }
94
-
95
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
96
- function firstLower(str) {
97
- return str.slice(0, 1).toLowerCase() + str.slice(1);
98
- }
99
-
100
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-AM67P3W7.js
101
- function lineToSmallHump(name) {
102
- return firstLower(lineToLargeHump(name));
103
- }
104
-
105
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-VRRDYCUH.js
106
- function getComponentNames(name) {
107
- if (name.includes("-")) {
108
- const line = _chunkAKNB7BKJcjs.humpToLine.call(void 0, name);
109
- const upper = lineToLargeHump(line);
110
- const lower = lineToSmallHump(upper);
111
- return [line, upper, lower];
112
- } else if (/[A-Z]/.test(name)) {
113
- const line = _chunkAKNB7BKJcjs.humpToLine.call(void 0, name);
114
- if (/^[A-Z]/.test(name)) {
115
- const upper = lineToLargeHump(line);
116
- const lower = lineToSmallHump(upper);
117
- if (line.includes("-")) {
118
- return [line, upper, lower];
119
- } else {
120
- return [name, lower];
121
- }
122
- } else {
123
- return [line, name];
124
- }
125
- } else {
126
- return [name];
127
- }
128
- }
129
-
130
-
131
-
132
-
133
-
134
-
135
- exports.styleLog = styleLog; exports.unmergeObject = unmergeObject; exports.firstUpper = firstUpper; exports.getComponentNames = getComponentNames;