@caspingus/lt
Version:
A utility library of helpers and tools for working with Learnosity APIs.
24 lines (19 loc) • 659 B
JavaScript
import { diagnostics } from '../core/diagnostics';
/**
* A utility object relating to Author API styling.
* @module Utils/Styling
*/
/**
* Checks for Author API version to determine if we need to
* add a new CSS string to certain classnames.
* @since 2.23.0
* @ignore
* @param {string} prefix The current state.classNamePrefix value.
*/
export function checkAppVersion(prefix) {
if (prefix === null && diagnostics()?.versions?.concrete) {
const appVersion = parseFloat(diagnostics().versions.concrete.replace(/^v/, '').split('.').slice(0, 2).join(''));
prefix = appVersion >= 2227 ? 'author-' : '';
}
return prefix;
}