@artenc/nest-orm 1.3.0 → 1.3.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.
@@ -0,0 +1,9 @@
1
+ export declare const GENERATED_COLUMNS: unique symbol;
2
+ export type Constructor = new (...args: any[]) => unknown;
3
+ export declare function addGeneratedColumn(constructor: Constructor, column: GeneratedColumnMetadata): void;
4
+ export declare function getGeneratedColumns(constructor: Constructor): GeneratedColumnMetadata[];
5
+ type GeneratedColumnMetadata = {
6
+ propertyKey: string;
7
+ generator: () => unknown;
8
+ };
9
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GENERATED_COLUMNS = void 0;
4
+ exports.addGeneratedColumn = addGeneratedColumn;
5
+ exports.getGeneratedColumns = getGeneratedColumns;
6
+ exports.GENERATED_COLUMNS = Symbol('GENERATED_COLUMNS');
7
+ function addGeneratedColumn(constructor, column) {
8
+ const existing = (Reflect.getMetadata(exports.GENERATED_COLUMNS, constructor) ?? []);
9
+ Reflect.defineMetadata(exports.GENERATED_COLUMNS, [...existing, column], constructor);
10
+ }
11
+ function getGeneratedColumns(constructor) {
12
+ return (Reflect.getMetadata(exports.GENERATED_COLUMNS, constructor) ?? []);
13
+ }
14
+ //# sourceMappingURL=generated-column.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-column.util.js","sourceRoot":"","sources":["../../src/utils/generated-column.util.ts"],"names":[],"mappings":";;;AAIA,gDAGC;AAED,kDAEC;AAXY,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAI5D,SAAgB,kBAAkB,CAAC,WAAwB,EAAE,MAA+B;IACxF,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,yBAAiB,EAAE,WAAW,CAAC,IAAI,EAAE,CAA8B,CAAA;IACzG,OAAO,CAAC,cAAc,CAAC,yBAAiB,EAAE,CAAC,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,CAAA;AACjF,CAAC;AAED,SAAgB,mBAAmB,CAAC,WAAwB;IACxD,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,yBAAiB,EAAE,WAAW,CAAC,IAAI,EAAE,CAA8B,CAAA;AACnG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artenc/nest-orm",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Helper utility to work with TypeORM",
5
5
  "author": "artenc",
6
6
  "license": "MIT",