Skip to content

Commit

Permalink
fix(type): rename ResetDecorator to ResetAnnotation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Oct 3, 2023
1 parent c4ed83a commit 1cc65d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/orm/src/plugin/log-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ClassType } from '@deepkit/core';
import { DatabaseSession } from '../database-session.js';
import { Database } from '../database.js';
import { Query } from '../query.js';
import { AutoIncrement, entity, InlineRuntimeType, PrimaryKey, PrimaryKeyFields, ReflectionClass, ResetDecorator } from '@deepkit/type';
import { AutoIncrement, entity, InlineRuntimeType, PrimaryKey, PrimaryKeyFields, ReflectionClass, ResetAnnotation } from '@deepkit/type';
import { DatabasePlugin } from './plugin.js';
import { OrmEntity } from '../type.js';

Expand Down Expand Up @@ -128,7 +128,7 @@ export class LogPlugin implements DatabasePlugin {
@entity.collection(this.getLogEntityCollectionName(schema))
class LogEntityForSchema extends this.options.entity {
//we can not work with references since that would mean we can not delete the parent without deleting the log entry.
reference: InlineRuntimeType<typeof primaryKey> & ResetDecorator<'primaryKey'> & ResetDecorator<'autoIncrement'>;
reference: InlineRuntimeType<typeof primaryKey> & ResetAnnotation<'primaryKey'> & ResetAnnotation<'autoIncrement'>;
}

entry = ReflectionClass.from(LogEntityForSchema);
Expand Down
4 changes: 2 additions & 2 deletions packages/type/src/reflection/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1719,11 +1719,11 @@ export type Data<Name extends string, Value> = { __meta?: ['data', never & Name,
* type Password = string & MinLength<6> & Excluded;
*
* interface UserCreationPayload {
* password: Password & ResetDecorator<'excluded'>
* password: Password & ResetAnnotation<'excluded'>
* }
* ```
*/
export type ResetDecorator<Name extends string> = { __meta?: ['reset', Name] };
export type ResetAnnotation<Name extends string> = { __meta?: ['reset', Name] };

export type IndexOptions = {
name?: string;
Expand Down
6 changes: 3 additions & 3 deletions packages/type/tests/type.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
PrimaryKey,
primaryKeyAnnotation,
ReflectionKind,
ResetDecorator,
ResetAnnotation,
resolveTypeMembers,
stringifyResolvedType,
stringifyType,
Expand Down Expand Up @@ -141,7 +141,7 @@ test('reset primary decorator', () => {
}

interface UserCreationPayload {
id: User['id'] & ResetDecorator<'primaryKey'>;
id: User['id'] & ResetAnnotation<'primaryKey'>;
}

const type = typeOf<UserCreationPayload>();
Expand All @@ -158,7 +158,7 @@ test('reset type decorator', () => {
}

interface UserCreationPayload {
password: User['password'] & Group<'a'> & ResetDecorator<'excluded'>;
password: User['password'] & Group<'a'> & ResetAnnotation<'excluded'>;
}

{
Expand Down

0 comments on commit 1cc65d0

Please sign in to comment.