You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
397 B
14 lines
397 B
|
3 years ago
|
"use strict";
|
||
|
|
|
||
|
|
const enumerationValues = new Set(["select", "start", "end", "preserve"]);
|
||
|
|
module.exports = {
|
||
|
|
enumerationValues,
|
||
|
|
convert(value, { context = "The provided value" } = {}) {
|
||
|
|
const string = `${value}`;
|
||
|
|
if (!enumerationValues.has(value)) {
|
||
|
|
throw new TypeError(`${context} '${value}' is not a valid enumeration value for SelectionMode`);
|
||
|
|
}
|
||
|
|
return string;
|
||
|
|
}
|
||
|
|
};
|