Skip to content

Commit

Permalink
feat: 优化setMongooseMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Apr 15, 2024
1 parent 53cb314 commit 8c0eee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const mongooseMeta = Symbol('MongooseMeta')

export function setMongooseMeta(target: object, meta: Partial<MongooseMeta>): void {
const exists = Reflect.getMetadata(mongooseMeta, target) ?? new MongooseMeta()
Reflect.defineMetadata(mongooseMeta, {...exists, ...meta}, target)
Object.assign(exists, meta)
}

export function getMongooseMeta(target: object): MongooseMeta {
Expand Down

0 comments on commit 8c0eee7

Please sign in to comment.