isSubset
Return if a query is a subset of another set.
queryLogic.isSubset(a, b)
Returns true if a is a subset of b. Equal sets are considered subsets of each other. In set theory, subset is
represented by A ⊆ B
.
import {QueryLogic} from "can";
const queryLogic = new QueryLogic();
const filter = queryLogic.isSubset({filter: {type: "critical"}}, {});
console.log( filter ); //-> true
const emptyObject = queryLogic.isSubset({}, {});
console.log( emptyObject ); //-> true
Returns
{Boolean}
:
true
if a
is a subset of b
.