Skip to main content

IFluidCodeDetailsComparer Interface

Provides capability to compare Fluid code details.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-definitions/legacy.

For more information about our API support guarantees, see here.

Signature

export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer

Extends: IProvideFluidCodeDetailsComparer

Methods

Method Alerts Return Type Description
compare(a, b) Alpha Promise<number | undefined>

Return a number representing the ascending sort order of the a and b code details:

- < 0 if a < b.

- = 0 if a === b.

- > 0 if a > b.

- undefined if a is not comparable to b.

Similar semantics to: Array.sort

satisfies(candidate, constraint) Alpha Promise<boolean>

Determines if the candidate code details satisfy the constraints specified in constraint code details.

Similar semantics to: https://github.com/npm/node-semver#usage

Method Details

compare

Return a number representing the ascending sort order of the a and b code details:

  • < 0 if a < b.

  • = 0 if a === b.

  • > 0 if a > b.

  • undefined if a is not comparable to b.

Similar semantics to: Array.sort

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;

Parameters

Parameter Type Description
a IFluidCodeDetails
b IFluidCodeDetails

Returns

Return type: Promise<number | undefined>

satisfies

Determines if the candidate code details satisfy the constraints specified in constraint code details.

Similar semantics to: https://github.com/npm/node-semver#usage

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;

Parameters

Parameter Type Description
candidate IFluidCodeDetails
constraint IFluidCodeDetails

Returns

Return type: Promise<boolean>