isPredicateSubset

Function: isPredicateSubset()

ts
function isPredicateSubset(subset, superset): boolean;
function isPredicateSubset(subset, superset): boolean;

Defined in: packages/db/src/query/predicate-utils.ts:801

Check if one predicate (where + orderBy + limit) is a subset of another. Returns true if all aspects of the subset predicate are satisfied by the superset.

Parameters

subset

LoadSubsetOptions

The predicate requirements to check

superset

LoadSubsetOptions

The predicate that might satisfy the requirements

Returns

boolean

true if subset is satisfied by superset

Example

ts
isPredicateSubset(
  { where: gt(ref('age'), val(20)), limit: 10 },
  { where: gt(ref('age'), val(10)), limit: 20 }
) // true
isPredicateSubset(
  { where: gt(ref('age'), val(20)), limit: 10 },
  { where: gt(ref('age'), val(10)), limit: 20 }
) // true
Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.