@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
25 lines (24 loc) • 675 B
JavaScript
;
var Type = /* @__PURE__ */ ((Type2) => {
Type2["BOOLEAN"] = "boolean";
Type2["BUTTON"] = "button";
return Type2;
})(Type || {});
const convert_boolean = function(value) {
return value ? 1 : 0;
};
const convert_button = function(value) {
return value;
};
const ConvertMap = {
["boolean" /* BOOLEAN */]: convert_boolean,
["button" /* BUTTON */]: convert_button
};
export class ParamsValueToDefaultConverter {
static convert(type, value) {
const method = ConvertMap[type];
return method(value);
}
}
ParamsValueToDefaultConverter.convert("boolean" /* BOOLEAN */, false);
ParamsValueToDefaultConverter.convert("button" /* BUTTON */, null);