SourceTermAnalysisSystem_vue/node_modules/toml-eslint-parser/lib/parser-options.js
2026-05-15 10:22:44 +08:00

34 lines
1008 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTOMLVer = void 0;
class TOMLVerImpl {
constructor(major, minor) {
this.major = major;
this.minor = minor;
}
lt(major, minor) {
return this.major < major || (this.major === major && this.minor < minor);
}
gte(major, minor) {
return this.major > major || (this.major === major && this.minor >= minor);
}
}
const TOML_VERSION_1_0 = new TOMLVerImpl(1, 0);
const TOML_VERSION_1_1 = new TOMLVerImpl(1, 1);
const DEFAULT_TOML_VERSION = TOML_VERSION_1_0;
const SUPPORTED_TOML_VERSIONS = {
"1.0": TOML_VERSION_1_0,
"1.0.0": TOML_VERSION_1_0,
"1.1": TOML_VERSION_1_1,
"1.1.0": TOML_VERSION_1_1,
latest: TOML_VERSION_1_0,
next: TOML_VERSION_1_1,
};
/**
* Get TOML version object from given TOML version string.
*/
function getTOMLVer(v) {
return SUPPORTED_TOML_VERSIONS[v || "latest"] || DEFAULT_TOML_VERSION;
}
exports.getTOMLVer = getTOMLVer;