@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
26 lines • 1.1 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Configuration = void 0;
/**
* Strongly typed configuration framework to force TS auto-infer privacy
* callbacks arguments types (which are not Ents, but row-like inputs).
*
* Motivation:
* 1. We MUST resolve privacyXyz rules below lazily, at actual operation;
* otherwise in case of cyclic Ent dependencies between EntA and EntB, one of
* them will be magically undefined.
* 2. We can’t define these parameter as BaseEnt arguments: privacy rules may
* refer the derived Ent itself and other Ents and thus produce cyclic
* dependencies. TS doesn't allow to work with such cyclic dependencies
* during the class is defining.
* 3. Configuration can’t be just returned from a virtual method, because in TS,
* type inference in return values is poor:
* https://github.com/Microsoft/TypeScript/issues/31273
*/
class Configuration {
constructor(cfg) {
Object.assign(this, cfg);
}
}
exports.Configuration = Configuration;
//# sourceMappingURL=Configuration.js.map
;