mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Initial Commit Rework
This commit is contained in:
parent
74a4cc048c
commit
95051cbd63
2483 changed files with 101351 additions and 111396 deletions
5
frontend/src/Utilities/String/combinePath.js
Normal file
5
frontend/src/Utilities/String/combinePath.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
export default function combinePath(isWindows, basePath, paths = []) {
|
||||
const slash = isWindows ? '\\' : '/';
|
||||
|
||||
return `${basePath}${slash}${paths.join(slash)}`;
|
||||
}
|
17
frontend/src/Utilities/String/split.js
Normal file
17
frontend/src/Utilities/String/split.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
function split(input, separator = ',') {
|
||||
if (!input) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return _.reduce(input.split(separator), (result, s) => {
|
||||
if (s) {
|
||||
result.push(s);
|
||||
}
|
||||
|
||||
return result;
|
||||
}, []);
|
||||
}
|
||||
|
||||
export default split;
|
11
frontend/src/Utilities/String/titleCase.js
Normal file
11
frontend/src/Utilities/String/titleCase.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
function titleCase(input) {
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return input.replace(/\w\S*/g, (match) => {
|
||||
return match.charAt(0).toUpperCase() + match.substr(1).toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
export default titleCase;
|
Loading…
Add table
Add a link
Reference in a new issue