@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.
@@ -47,12 +47,24 @@ function _classPrivateFieldLooseBase(receiver, privateKey) {
47
47
  return receiver;
48
48
  }
49
49
 
50
+ function uniq(list) {
51
+ return Array.from(new Set(list).values());
52
+ }
53
+ function uniqBy(list, key = "id") {
54
+ const map = new Map();
55
+ list.forEach(item => {
56
+ map.set(item[key], item);
57
+ });
58
+ return Array.from(map.values());
59
+ }
60
+
50
61
  /**
51
62
  * Create a complete and iterable trap.
52
63
  * @param self
53
64
  * @param options
54
65
  * @ignore
55
66
  */
67
+
56
68
  function proxyDelegation(self, options = {}) {
57
69
  const {
58
70
  handlers = {},
@@ -108,23 +120,12 @@ function proxyDelegation(self, options = {}) {
108
120
  },
109
121
 
110
122
  ownKeys(target) {
111
- return Reflect.ownKeys(target).concat(ownKeys && ownKeys(target) || []);
123
+ return uniq(Reflect.ownKeys(target).concat(ownKeys && ownKeys(target) || []));
112
124
  }
113
125
 
114
126
  }, handlers));
115
127
  }
116
128
 
117
- function uniq(list) {
118
- return Array.from(new Set(list).values());
119
- }
120
- function uniqBy(list, key = "id") {
121
- const map = new Map();
122
- list.forEach(item => {
123
- map.set(item[key], item);
124
- });
125
- return Array.from(map.values());
126
- }
127
-
128
129
  async function importPackage(packageName, loaderFn = () => import(packageName), optional = false) {
129
130
  try {
130
131
  return await loaderFn();