Skip to content

Commit c3d410b

Browse files
hellocontrol-bngmrmckeb
authored andcommitted
Update getFilePath to use path.dirname (#63)
1 parent c1e00f2 commit c3d410b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/helpers/getClasses.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import postcss from 'postcss';
23
import less from 'less';
34
import sass from 'sass';
@@ -17,8 +18,7 @@ export const getFileType = (fileName: string) => {
1718
return FileTypes.scss;
1819
};
1920

20-
const getFilePath = (fileName: string) =>
21-
fileName.substring(0, fileName.lastIndexOf('/'));
21+
const getFilePath = (fileName: string) => path.dirname(fileName);
2222

2323
export const getClasses = (
2424
processor: postcss.Processor,
@@ -71,7 +71,6 @@ export const getClasses = (
7171

7272
return processedCss.root ? extractICSS(processedCss.root).icssExports : {};
7373
} catch (e) {
74-
console.log(e);
7574
logger.error(e);
7675
return {};
7776
}

0 commit comments

Comments
 (0)