import Entity from "../entity/entity" ; import Search from "./search" ; import WhereField from "./where-field" ; export abstract class WhereBoolean < TEntity extends Entity > extends WhereField < TEntity > { protected value ! : boolean ; eq ( value ) { this . value = value ; return this . search ; } equal ( value ) { return this . eq ( value ) ; } equals ( value ) { return this . eq ( value ) ; } equalTo ( value ) { return this . eq ( value ) ; } true ( ) { return this . eq ( true ) ; } false ( ) { return this . eq ( false ) ; } abstract toString ( ) ; } export class WhereHashBoolean < TEntity extends Entity > extends WhereBoolean < TEntity > { toString ( ) { return this . buildQuery ( `{${ this . value ? '1' : '0' }}` ) ; } } export class WhereJsonBoolean < TEntity extends Entity > extends WhereBoolean < TEntity > { toString ( ) { return this . buildQuery ( `{${ this . value }}` ) ; } }