ba-polyglot-storage/src/decorators/PartitionKey.ts
Alan Bridgeman db22585fcb
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 56s
Initial code commit
2026-07-21 12:16:50 -05:00

11 lines
No EOL
404 B
TypeScript

import 'reflect-metadata';
/** Metadata key used to store the partition key of an entity */
export const PARTITION_KEY_META = Symbol('polyglot:partitionKey');
/** Marks a property as the partition key of the entity. */
export function PartitionKey(): PropertyDecorator {
return (target, propertyKey) => {
Reflect.defineMetadata(PARTITION_KEY_META, propertyKey, target.constructor);
};
}