blob: da0f75c7a0f79bd515c8ea0488a325da8d08885e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
"use strict";
const enumerationValues = new Set(["loading", "interactive", "complete"]);
exports.enumerationValues = enumerationValues;
exports.convert = function convert(value, { context = "The provided value" } = {}) {
const string = `${value}`;
if (!enumerationValues.has(string)) {
throw new TypeError(`${context} '${string}' is not a valid enumeration value for DocumentReadyState`);
}
return string;
};
|