@snowtop/ent 0.0.35 → 0.0.36

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.
@@ -32,7 +32,7 @@ export declare class AssocEdgeLoaderFactory<T extends AssocEdge> implements Load
32
32
  name: string;
33
33
  constructor(edgeType: string, edgeCtr: AssocEdgeConstructor<T> | (() => AssocEdgeConstructor<T>));
34
34
  createLoader(context?: Context): AssocLoader<T>;
35
- private isFunction;
35
+ private isConstructor;
36
36
  createConfigurableLoader(options: EdgeQueryableDataOptions, context?: Context): AssocLoader<T>;
37
37
  }
38
38
  export {};
@@ -161,16 +161,18 @@ class AssocEdgeLoaderFactory {
161
161
  createLoader(context) {
162
162
  return this.createConfigurableLoader({}, context);
163
163
  }
164
- isFunction(edgeCtr) {
164
+ isConstructor(edgeCtr) {
165
165
  // not constructor
166
- return !(edgeCtr.prototype && edgeCtr.prototype.constructor === edgeCtr);
166
+ return (edgeCtr.prototype &&
167
+ edgeCtr.prototype.constructor &&
168
+ edgeCtr.prototype.constructor.name.length > 0);
167
169
  }
168
170
  createConfigurableLoader(options, context) {
169
171
  let edgeCtr = this.edgeCtr;
170
172
  // in generated code, the edge is not necessarily defined at the time of loading
171
173
  // so we call this as follows:
172
174
  // const loader = new AssocEdgeLoaderFactory(EdgeType.Foo, ()=>DerivedEdgeClass);
173
- if (this.isFunction(edgeCtr)) {
175
+ if (!this.isConstructor(edgeCtr)) {
174
176
  edgeCtr = edgeCtr();
175
177
  }
176
178
  // rename to make TS happy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowtop/ent",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "description": "snowtop ent framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",