mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Initial Commit Rework
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
export default function combinePath(isWindows, basePath, paths = []) {
|
||||
const slash = isWindows ? '\\' : '/';
|
||||
|
||||
return `${basePath}${slash}${paths.join(slash)}`;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user