Yuki Takei 4 лет назад
Родитель
Сommit
a11428842b

+ 1 - 3
packages/app/src/utils/template-checker.ts

@@ -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;

+ 6 - 8
packages/app/src/utils/to-array-from-csv.ts

@@ -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;