style / tools optis & new tools calculator
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s
This commit is contained in:
parent
6b84607b25
commit
0db35a0d2c
23 changed files with 1106 additions and 24 deletions
15
website/src/features/toolboxes/modules/textImport.js
Normal file
15
website/src/features/toolboxes/modules/textImport.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
export function parseColonImportLines(text) {
|
||||
return String(text || "")
|
||||
.split(/\r?\n/)
|
||||
.map((line) => line.trim())
|
||||
.filter(Boolean)
|
||||
.map((line) => {
|
||||
const separatorIndex = line.indexOf(":");
|
||||
if (separatorIndex === -1) return { label: line, value: "" };
|
||||
return {
|
||||
label: line.slice(0, separatorIndex).trim(),
|
||||
value: line.slice(separatorIndex + 1).trim()
|
||||
};
|
||||
})
|
||||
.filter((entry) => entry.label);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue