Skip to content

Commit 6dc0d57

Browse files
bmishrwjblue
andauthored
refactor: use path helper methods
Co-authored-by: Robert Jackson <[email protected]>
1 parent d5047d2 commit 6dc0d57

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/utils/ember.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,8 @@ function isModuleByFilePath(filePath, module) {
157157
const expectedFileNameTs = `${module}.ts`;
158158
const expectedFolderName = `${module}s`;
159159

160-
const filePathParts = filePath.split(path.sep);
161-
const actualFolders = filePathParts.slice(0, -1);
162-
const actualFileName = filePathParts[filePathParts.length - 1];
160+
const actualFolders = path.dirname(filePath).split(path.sep);
161+
const actualFileName = path.basename(filePath);
163162

164163
/* Check both folder and filename to support both classic and POD's structure */
165164
return (

0 commit comments

Comments
 (0)