requireApiVersion
Official
Returns true if the API version is equal or higher than the requested version. Use this to limit export functionality that require specific API versions to avoid crashing on older Obsidian builds.
Import:
import { requireApiVersion } from 'obsidian';Example:
console.log(requireApiVersion('1.8.9')); // trueSignature:
function requireApiVersion(version: string): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
version | string | The version to check against. |
Returns: boolean — true if the API version is equal or higher than the requested version.
Example:
console.log(requireApiVersion('1.8.9')); // true