Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Latest commit

 

History

History
36 lines (24 loc) · 934 Bytes

versionPriorTo.md

File metadata and controls

36 lines (24 loc) · 934 Bytes

shopify.utils.versionPriorTo

This method determines if the given version is older than the configured apiVersion for the shopifyApi object. Its main use is when you want to tweak behaviour depending on your current API version, though apps won't typically need this kind of check.

Example

const shopify = shopifyApi({
  apiVersion: ApiVersion.July23,
});

if (shopify.utils.versionPriorTo(ApiVersion.July23)) {
  // false in this example, as both versions are July23
}
if (shopify.utils.versionPriorTo(ApiVersion.October23)) {
  // true in this example, as ApiVersion.October23 is newer than ApiVersion.July23, i.e. the configured version is older
  // than the reference one
}

Parameters

apiVersion

ApiVersion | ❗ required

The API version to check against.

Return

boolean

Whether the reference version is older than the configured version.

Back to shopify.utils