Function: operationMatches()
ts
function operationMatches(op, ref): boolean;Defined in: operation-ref.ts:64
Whether an operation matches a ref, comparing base names so that counted suffixes line up in both directions: thumbs~5 matches the thumbs ref, the thumbs operation matches a thumbs~5 ref, and thumbs~5 matches thumbs~3.
Parameters
| Parameter | Type |
|---|---|
op | CdnOperation |
ref | OperationRef |
Returns
boolean
Example
ts
operationMatches(thumbs(5), 'thumbs') // → true
operationMatches(thumbs(5), thumbs(3)) // → true
operationMatches({ name: 'resize', params: [] }, 'preview') // → false