MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / safe_workflow_id

Function safe_workflow_id

app/workflow/workflow.cpp:135–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 value = replace_all(value, "${workflow_dir}", context.workflow_dir.string());
134 for (const auto & [key, item] : context.values) {
135 value = replace_all(value, "${" + key + "}", item);
136 }
137 return value;
138}
139
140std::string safe_workflow_id(std::string value) {
141 if (value.empty()) {
142 throw std::runtime_error("workflow batch item id must not be empty");
143 }
144 for (char & ch : value) {
145 const unsigned char uch = static_cast<unsigned char>(ch);
146 if (std::isalnum(uch) == 0 && ch != '-' && ch != '_') {
147 ch = '_';
148 }
149 }

Callers 1

run_batch_inputs_stepFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected