fix: types error

This commit is contained in:
chenos 2022-10-06 17:21:20 +08:00
parent 50b184c93e
commit 07a1aad784
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import { ACL } from './acl';
export type ConditionFunc = (ctx: any) => Promise<boolean>;
export type ConditionFunc = (ctx: any) => Promise<boolean> | boolean;
export class AllowManager {
protected skipActions = new Map<string, Map<string, string | ConditionFunc | true>>();

View File

@ -1,7 +1,7 @@
import lodash from 'lodash';
import { Model as SequelizeModel, ModelCtor } from 'sequelize';
import { Collection } from './collection';
import { Database } from './database';
import lodash from 'lodash';
import { Field } from './fields';
interface IModel {
@ -23,6 +23,8 @@ export class Model<TModelAttributes extends {} = any, TCreationAttributes extend
public static database: Database;
public static collection: Collection;
[key: string]: any;
public toJSON<T extends TModelAttributes>(): T {
const handleObj = (obj, options: JSONTransformerOptions) => {
const handles = [