UNPKG

@singlephon/rift

Version:

A lightweight micro-framework connecting Blade, Livewire, Alpine.js, and JS seamlessly in Laravel projects.

17 lines (13 loc) 504 B
import {VersionError} from "../errors/version"; export default class Version { static _exact_ = '0.2.5' static check (version, config = { soft: false}) { if (config.soft) { if (version !== Version._exact_) console.warn(`[Rift] Framework version mismatch: frontend (${Version._exact_}) ≠ backend (${version})`) return true; } if (version !== Version._exact_) throw new VersionError(Version._exact_, version) } }