/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
const require_arbitrary = require('./arbitrary.cjs');

//#region ../fixtures/src/util.ts
const assertUnreachable = (_x) => {
	throw new Error("Didn't expect to get here");
};
function isArbitraryFixture(value) {
	return typeof value === "object" && value !== null && "type" in value && value.type === "arbitraryFixture";
}
/** Registry of all arbitrary fixtures, auto-constructed from exports of arbitrary.ts */
const arbitraryFixtureMap = Object.fromEntries(Object.entries(require_arbitrary.arbitrary_exports).filter(([, value]) => isArbitraryFixture(value)));
/** Returns the ArbitraryFixture for the given fixture type name, or undefined if it's not an arbitrary fixture */
function getArbitraryFixture(fixtureType) {
	return arbitraryFixtureMap[fixtureType];
}
function validateArbitraryValue(fixture, value) {
	switch (fixture.valueType) {
		case "integer": return typeof value === "number" && Number.isInteger(value) && (fixture.min == null || value >= fixture.min) && (fixture.max == null || value <= fixture.max);
	}
	return assertUnreachable(fixture.valueType);
}

//#endregion
exports.getArbitraryFixture = getArbitraryFixture;
exports.validateArbitraryValue = validateArbitraryValue;