Use as const

#5089
This commit is contained in:
syuilo 2019-06-27 18:04:09 +09:00
parent 6b897e562a
commit 952789cc1e
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
102 changed files with 853 additions and 966 deletions

View file

@ -2,7 +2,7 @@ import { EntityRepository, Repository } from 'typeorm';
import { UserList } from '../entities/user-list';
import { ensure } from '../../prelude/ensure';
import { UserListJoinings } from '..';
import { bool, types, SchemaType } from '../../misc/schema';
import { SchemaType } from '../../misc/schema';
export type PackedUserList = SchemaType<typeof packedUserListSchema>;
@ -27,33 +27,33 @@ export class UserListRepository extends Repository<UserList> {
}
export const packedUserListSchema = {
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 UserList.',
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 UserList 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 UserList.'
},
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',
}
},