@@ -71,7 +71,7 @@ export abstract class Capability<P extends string = string>
7171 return this ;
7272 }
7373
74- public diff ( capability : Capability < P > , fallbackToFirstOfType ?: boolean ) {
74+ public diff ( capability : Capability < P > , fallbackToFirstOfType ?: boolean , strict ?: boolean ) {
7575 const instance = new ( Object . getPrototypeOf ( this ) . constructor ) (
7676 this . definition ,
7777 this . universalProperties ,
@@ -81,7 +81,7 @@ export abstract class Capability<P extends string = string>
8181 . getPropertiesArray ( )
8282 . reduce < Property [ ] > ( ( properties , property ) => {
8383 if ( this . hasProperty ( property . name as P ) ) {
84- const ref = this . findProperty ( property , fallbackToFirstOfType ) ;
84+ const ref = this . findProperty ( property , fallbackToFirstOfType , strict ) ;
8585 if ( ref && ref . equals ( property ) ) {
8686 return properties ;
8787 }
@@ -188,11 +188,15 @@ export abstract class Capability<P extends string = string>
188188 return property ;
189189 }
190190
191- public findProperty ( property : Property , fallbackToFirstOfType ?: boolean ) : Property | undefined {
191+ public findProperty (
192+ property : Property ,
193+ fallbackToFirstOfType ?: boolean ,
194+ strict ?: boolean ,
195+ ) : Property | undefined {
192196 if ( this . hasProperty ( property . name as P ) ) {
193197 if ( property . multiple ) {
194198 const match = this . getProperties ( property . name as P ) . find ( ( ref ) =>
195- ref . isInstanceOf ( property ) ,
199+ ref . isInstanceOf ( property , strict ) ,
196200 ) ;
197201 return match === undefined && fallbackToFirstOfType
198202 ? this . getProperty ( property . name as P )
@@ -231,9 +235,9 @@ export abstract class Capability<P extends string = string>
231235 return this ;
232236 }
233237
234- public update ( capability : Capability < P > , fallbackToFirstOfType ?: boolean ) {
238+ public update ( capability : Capability < P > , fallbackToFirstOfType ?: boolean , strict ?: boolean ) {
235239 return capability . getPropertiesArray ( ) . reduce ( ( result , property ) => {
236- const ref = this . findProperty ( property , fallbackToFirstOfType ) ;
240+ const ref = this . findProperty ( property , fallbackToFirstOfType , strict ) ;
237241
238242 if ( ref ) {
239243 ref . replace ( property ) ;
0 commit comments