@sqb/connect 4.1.3 → 4.1.4
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.
|
@@ -95,11 +95,13 @@ exports.Entity = Entity;
|
|
|
95
95
|
}
|
|
96
96
|
Entity.getPrimaryIndexColumns = getPrimaryIndexColumns;
|
|
97
97
|
function mixin(derivedCtor, ...bases) {
|
|
98
|
-
const trgMeta = entity_metadata_1.EntityMetadata.inject(derivedCtor);
|
|
99
98
|
for (const base of bases) {
|
|
99
|
+
if (!base)
|
|
100
|
+
continue;
|
|
100
101
|
(0, apply_mixins_1.applyMixins)(derivedCtor, base);
|
|
101
102
|
const srcMeta = entity_metadata_1.EntityMetadata.get(base);
|
|
102
103
|
if (srcMeta) {
|
|
104
|
+
const trgMeta = entity_metadata_1.EntityMetadata.inject(derivedCtor);
|
|
103
105
|
entity_metadata_1.EntityMetadata.mixin(trgMeta, srcMeta);
|
|
104
106
|
}
|
|
105
107
|
}
|
|
@@ -147,11 +149,11 @@ exports.Entity = Entity;
|
|
|
147
149
|
applyConstructorProperties(this, c, args);
|
|
148
150
|
}
|
|
149
151
|
};
|
|
150
|
-
const trgMeta = entity_metadata_1.EntityMetadata.inject(UnionClass);
|
|
151
152
|
for (const base of bases) {
|
|
152
153
|
(0, apply_mixins_1.applyMixins)(UnionClass, base);
|
|
153
154
|
const srcMeta = entity_metadata_1.EntityMetadata.get(base);
|
|
154
155
|
if (srcMeta) {
|
|
156
|
+
const trgMeta = entity_metadata_1.EntityMetadata.inject(UnionClass);
|
|
155
157
|
entity_metadata_1.EntityMetadata.mixin(trgMeta, srcMeta);
|
|
156
158
|
}
|
|
157
159
|
}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.applyMixins = void 0;
|
|
4
4
|
function applyMixins(derivedCtor, baseCtor, filter) {
|
|
5
5
|
for (const name of Object.getOwnPropertyNames(baseCtor.prototype)) {
|
|
6
|
-
if (
|
|
6
|
+
if ((name === 'constructor' || name === '__proto__' || name === 'toJSON' || name === 'toString') ||
|
|
7
|
+
filter && !filter(name))
|
|
7
8
|
continue;
|
|
8
9
|
Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) ||
|
|
9
10
|
Object.create(null));
|
package/package.json
CHANGED