ScrollLogicalPosition.js 451 B

1234567891011121314
  1. "use strict";
  2. const enumerationValues = new Set(["start", "center", "end", "nearest"]);
  3. exports.enumerationValues = enumerationValues;
  4. exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
  5. const string = `${value}`;
  6. if (!enumerationValues.has(string)) {
  7. throw new globalObject.TypeError(
  8. `${context} '${string}' is not a valid enumeration value for ScrollLogicalPosition`
  9. );
  10. }
  11. return string;
  12. };