Amp-Thread-ID: https://ampcode.com/threads/T-01a0cad9-6963-772e-98a3-ab92e31eba1d Co-authored-by: Alexander Brown <drjkl@comfy.org>
10 lines
281 B
JavaScript
10 lines
281 B
JavaScript
const LAYER_WIDGET_TYPES = new Set(['spline', 'handdraw', 'box_layer']);
|
|
|
|
export function isLayerWidget(widget) {
|
|
return LAYER_WIDGET_TYPES.has(widget?.value?.type);
|
|
}
|
|
|
|
export function getLayerWidgetType(widget) {
|
|
return isLayerWidget(widget) ? widget.value.type : null;
|
|
}
|