@tsed/core 6.87.0 → 6.88.1
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/lib/index.js +13 -12
- package/lib/index.js.map +1 -1
- package/lib/index.modern.js +13 -12
- package/lib/index.modern.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -67,12 +67,24 @@ function _classPrivateFieldLooseBase(receiver, privateKey) {
|
|
|
67
67
|
return receiver;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
function uniq(list) {
|
|
71
|
+
return Array.from(new Set(list).values());
|
|
72
|
+
}
|
|
73
|
+
function uniqBy(list, key = "id") {
|
|
74
|
+
const map = new Map();
|
|
75
|
+
list.forEach(item => {
|
|
76
|
+
map.set(item[key], item);
|
|
77
|
+
});
|
|
78
|
+
return Array.from(map.values());
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
/**
|
|
71
82
|
* Create a complete and iterable trap.
|
|
72
83
|
* @param self
|
|
73
84
|
* @param options
|
|
74
85
|
* @ignore
|
|
75
86
|
*/
|
|
87
|
+
|
|
76
88
|
function proxyDelegation(self, options = {}) {
|
|
77
89
|
const {
|
|
78
90
|
handlers = {},
|
|
@@ -128,23 +140,12 @@ function proxyDelegation(self, options = {}) {
|
|
|
128
140
|
},
|
|
129
141
|
|
|
130
142
|
ownKeys(target) {
|
|
131
|
-
return Reflect.ownKeys(target).concat(ownKeys && ownKeys(target) || []);
|
|
143
|
+
return uniq(Reflect.ownKeys(target).concat(ownKeys && ownKeys(target) || []));
|
|
132
144
|
}
|
|
133
145
|
|
|
134
146
|
}, handlers));
|
|
135
147
|
}
|
|
136
148
|
|
|
137
|
-
function uniq(list) {
|
|
138
|
-
return Array.from(new Set(list).values());
|
|
139
|
-
}
|
|
140
|
-
function uniqBy(list, key = "id") {
|
|
141
|
-
const map = new Map();
|
|
142
|
-
list.forEach(item => {
|
|
143
|
-
map.set(item[key], item);
|
|
144
|
-
});
|
|
145
|
-
return Array.from(map.values());
|
|
146
|
-
}
|
|
147
|
-
|
|
148
149
|
async function importPackage(packageName, loaderFn = () => Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(packageName)); }), optional = false) {
|
|
149
150
|
try {
|
|
150
151
|
return await loaderFn();
|