Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 923 Bytes

File metadata and controls

44 lines (28 loc) · 923 Bytes
id isPredicateSubset
title isPredicateSubset

Function: isPredicateSubset()

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

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