Use as const

#5089
This commit is contained in:
syuilo
2019-06-27 18:04:09 +09:00
parent 6b897e562a
commit 952789cc1e
102 changed files with 853 additions and 966 deletions

View File

@@ -2,7 +2,7 @@ import { EntityRepository, Repository } from 'typeorm';
import { UserGroup } from '../entities/user-group';
import { ensure } from '../../prelude/ensure';
import { UserGroupJoinings } from '..';
import { bool, types, SchemaType } from '../../misc/schema';
import { SchemaType } from '../../misc/schema';
export type PackedUserGroup = SchemaType<typeof packedUserGroupSchema>;
@@ -28,38 +28,38 @@ export class UserGroupRepository extends Repository<UserGroup> {
}
export const packedUserGroupSchema = {
type: types.object,
optional: bool.false, nullable: bool.false,
type: 'object' as const,
optional: false as const, nullable: false as const,
properties: {
id: {
type: types.string,
optional: bool.false, nullable: bool.false,
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this UserGroup.',
example: 'xxxxxxxxxx',
},
createdAt: {
type: types.string,
optional: bool.false, nullable: bool.false,
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time',
description: 'The date that the UserGroup was created.'
},
name: {
type: types.string,
optional: bool.false, nullable: bool.false,
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The name of the UserGroup.'
},
ownerId: {
type: types.string,
nullable: bool.false, optional: bool.false,
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
},
userIds: {
type: types.array,
nullable: bool.false, optional: bool.true,
type: 'array' as const,
nullable: false as const, optional: true as const,
items: {
type: types.string,
nullable: bool.false, optional: bool.false,
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
}
},