@@ -2,12 +2,10 @@
* templateChecker
*/
-function checkTemplatePath(path) {
+export default function checkTemplatePath(path: string): boolean {
if (path.match(/.*\/_{1,2}template$/)) {
return true;
}
return false;
-
-module.exports = checkTemplatePath;
@@ -1,15 +1,13 @@
// converts csv item to array
-const toArrayFromCsv = (text) => {
- let array = [];
+export const toArrayFromCsv = (text: string): string[] => {
if (text == null) {
- return array;
+ return [];
- array = text.split(',').map(el => el.trim());
- array = array.filter(el => el !== '');
+ const array = text
+ .split(',')
+ .map(el => el.trim())
+ .filter(el => el !== '');
return array;
};
-module.exports = toArrayFromCsv;