mod: removed reverse option

This commit is contained in:
uihp
2025-02-09 02:37:18 +08:00
parent f323a35e3e
commit 98a3f3ad04
3 changed files with 9 additions and 18 deletions
+2 -6
View File
@@ -9,19 +9,15 @@ class StringToggle:
@classmethod
def INPUT_TYPES(cls) -> dict:
return {
'required': {
'separator': ('STRING', {'default': ', '}),
'reverse': ('BOOLEAN', {'default': False})
},
'required': { 'separator': ('STRING', {'default': ', '}) },
'optional': optional
}
RETURN_TYPES = ('STRING',)
FUNCTION = 'join'
CATEGORY = 'utils'
def join(self, separator: str, reverse: bool, previous: str = '', **kwargs) -> tuple[str]:
def join(self, separator: str, previous: str = '', **kwargs) -> tuple[str]:
arguments = {}
for (argtype, unique), value in [(k.split('_'),v) for k,v in kwargs.items() if '_' in k]:
arguments.setdefault(argtype, {})[unique] = value
strings = ([previous] if previous else []) + [text for unique, text in arguments['text'].items() if arguments['append'][unique]]
if reverse: strings = strings[::-1]
return (separator.join(strings),)