@privateaim/client-vue 0.8.28 → 0.8.29

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.mjs CHANGED
@@ -19,112 +19,16 @@ import { VCFormGroup, VCFormInput, buildFormGroup, buildFormTextarea, buildFormS
19
19
  import { VCTimeago } from '@vuecs/timeago';
20
20
  import { useClipboard } from '@vueuse/core';
21
21
 
22
- /*
23
- * Copyright (c) 2024-2024.
24
- * Author Peter Placzek (tada5hi)
25
- * For the full copyright and license information,
26
- * view the LICENSE file that was distributed with this source code.
27
- */ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
28
- /**
29
- * Convert string to property path array.
30
- *
31
- * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
32
- * @see https://github.com/chaijs/pathval
33
- *
34
- * @param segment
35
- */ function pathToArray(segment) {
36
- const str = segment.replace(/([^\\])\[/g, '$1.[');
37
- const parts = str.match(/(\\\.|[^.]+?)+/g);
38
- if (!parts) {
39
- return [];
40
- }
41
- const result = [];
42
- for(let i = 0; i < parts.length; i++){
43
- if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
44
- continue;
45
- }
46
- const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
47
- if (regex) {
48
- result.push(regex[1]);
49
- } else {
50
- result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
51
- }
52
- }
53
- return result;
54
- }
55
-
56
22
  /*
57
23
  * Copyright (c) 2024.
58
24
  * Author Peter Placzek (tada5hi)
59
25
  * For the full copyright and license information,
60
26
  * view the LICENSE file that was distributed with this source code.
61
- */ var Character;
27
+ */ var Character$1;
62
28
  (function(Character) {
63
29
  Character["WILDCARD"] = "*";
64
30
  Character["GLOBSTAR"] = "**";
65
- })(Character || (Character = {}));
66
-
67
- /*
68
- * Copyright (c) 2024.
69
- * Author Peter Placzek (tada5hi)
70
- * For the full copyright and license information,
71
- * view the LICENSE file that was distributed with this source code.
72
- */ function isObject(input) {
73
- return !!input && typeof input === 'object' && !Array.isArray(input);
74
- }
75
-
76
- function getPathValue(data, path) {
77
- const parts = Array.isArray(path) ? path : pathToArray(path);
78
- let res;
79
- let temp = data;
80
- let index = 0;
81
- while(index < parts.length){
82
- if (temp === null || typeof temp === 'undefined') {
83
- break;
84
- }
85
- if (parts[index] in Object(temp)) {
86
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
87
- // @ts-expect-error
88
- temp = temp[parts[index]];
89
- } else {
90
- break;
91
- }
92
- if (index === parts.length - 1) {
93
- res = temp;
94
- }
95
- index++;
96
- }
97
- return res;
98
- }
99
-
100
- const NUMBER_REGEX = /^\d+$/;
101
- function setPathValue(data, path, value) {
102
- const parts = Array.isArray(path) ? path : pathToArray(path);
103
- let temp = data;
104
- let index = 0;
105
- while(index < parts.length){
106
- /* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
107
- break;
108
- }
109
- const key = parts[index];
110
- // [foo, '0']
111
- if (typeof temp[key] === 'undefined') {
112
- const match = NUMBER_REGEX.test(key);
113
- if (match) {
114
- temp[key] = [];
115
- } else {
116
- temp[key] = {};
117
- }
118
- }
119
- if (index === parts.length - 1) {
120
- temp[key] = value;
121
- break;
122
- }
123
- index++;
124
- temp = temp[key];
125
- }
126
- return data;
127
- }
31
+ })(Character$1 || (Character$1 = {}));
128
32
 
129
33
  var StoreName = /*#__PURE__*/ function(StoreName) {
130
34
  StoreName["DEFAULT"] = "default";
@@ -1647,6 +1551,113 @@ function createEntityManager(ctx) {
1647
1551
  };
1648
1552
  }
1649
1553
 
1554
+ /*
1555
+ * Copyright (c) 2024-2024.
1556
+ * Author Peter Placzek (tada5hi)
1557
+ * For the full copyright and license information,
1558
+ * view the LICENSE file that was distributed with this source code.
1559
+ */ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
1560
+ /**
1561
+ * Convert string to property path array.
1562
+ *
1563
+ * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
1564
+ * @see https://github.com/chaijs/pathval
1565
+ *
1566
+ * @param segment
1567
+ */ function pathToArray(segment) {
1568
+ const str = segment.replace(/([^\\])\[/g, '$1.[');
1569
+ const parts = str.match(/(\\\.|[^.]+?)+/g);
1570
+ if (!parts) {
1571
+ return [];
1572
+ }
1573
+ const result = [];
1574
+ for(let i = 0; i < parts.length; i++){
1575
+ if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
1576
+ continue;
1577
+ }
1578
+ const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
1579
+ if (regex) {
1580
+ result.push(regex[1]);
1581
+ } else {
1582
+ result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
1583
+ }
1584
+ }
1585
+ return result;
1586
+ }
1587
+
1588
+ /*
1589
+ * Copyright (c) 2024.
1590
+ * Author Peter Placzek (tada5hi)
1591
+ * For the full copyright and license information,
1592
+ * view the LICENSE file that was distributed with this source code.
1593
+ */ var Character;
1594
+ (function(Character) {
1595
+ Character["WILDCARD"] = "*";
1596
+ Character["GLOBSTAR"] = "**";
1597
+ })(Character || (Character = {}));
1598
+
1599
+ /*
1600
+ * Copyright (c) 2024.
1601
+ * Author Peter Placzek (tada5hi)
1602
+ * For the full copyright and license information,
1603
+ * view the LICENSE file that was distributed with this source code.
1604
+ */ function isObject(input) {
1605
+ return !!input && typeof input === 'object' && !Array.isArray(input);
1606
+ }
1607
+
1608
+ function getPathValue(data, path) {
1609
+ const parts = Array.isArray(path) ? path : pathToArray(path);
1610
+ let res;
1611
+ let temp = data;
1612
+ let index = 0;
1613
+ while(index < parts.length){
1614
+ if (temp === null || typeof temp === 'undefined') {
1615
+ break;
1616
+ }
1617
+ if (parts[index] in Object(temp)) {
1618
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1619
+ // @ts-expect-error
1620
+ temp = temp[parts[index]];
1621
+ } else {
1622
+ break;
1623
+ }
1624
+ if (index === parts.length - 1) {
1625
+ res = temp;
1626
+ }
1627
+ index++;
1628
+ }
1629
+ return res;
1630
+ }
1631
+
1632
+ const NUMBER_REGEX = /^\d+$/;
1633
+ function setPathValue(data, path, value) {
1634
+ const parts = Array.isArray(path) ? path : pathToArray(path);
1635
+ let temp = data;
1636
+ let index = 0;
1637
+ while(index < parts.length){
1638
+ /* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
1639
+ break;
1640
+ }
1641
+ const key = parts[index];
1642
+ // [foo, '0']
1643
+ if (typeof temp[key] === 'undefined') {
1644
+ const match = NUMBER_REGEX.test(key);
1645
+ if (match) {
1646
+ temp[key] = [];
1647
+ } else {
1648
+ temp[key] = {};
1649
+ }
1650
+ }
1651
+ if (index === parts.length - 1) {
1652
+ temp[key] = value;
1653
+ break;
1654
+ }
1655
+ index++;
1656
+ temp = temp[key];
1657
+ }
1658
+ return data;
1659
+ }
1660
+
1650
1661
  class MemoryStore {
1651
1662
  data;
1652
1663
  constructor(options){