isDefinedAndHasMembers
Return if a query can have records.
queryLogic.isDefinedAndHasMembers(query)
Returns the query object if query can have records. It returns true
if the query is not
EMPTY, UNDEFINABLE, or UNKNOWABLE.
import {QueryLogic} from "can";
const queryLogic = new QueryLogic();
const emptyObject = queryLogic.isDefinedAndHasMembers({});
console.log( emptyObject ); //-> {}
const universal = queryLogic.isDefinedAndHasMembers(QueryLogic.UNIVERSAL);
console.log( universal ); //-> QueryLogic.UNIVERSAL
const undefinable = queryLogic.isDefinedAndHasMembers(QueryLogic.UNDEFINABLE);
console.log( undefinable );//-> false
Parameters
- a
{Query}
:A query.
Returns
{Query|Boolean}
:
returns false
if query is
EMPTY, UNDEFINABLE, or UNKNOWABLE, else it returns the query object.