fix(babel-plugin-extend-docs): consider windows paths
This commit is contained in:
parent
75c1b22760
commit
82c6cce62a
2 changed files with 6 additions and 1 deletions
5
.changeset/strong-tables-drum.md
Normal file
5
.changeset/strong-tables-drum.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'babel-plugin-extend-docs': patch
|
||||
---
|
||||
|
||||
Take into account that paths can be windows-based with backslashes, when analyzing folder depth
|
||||
|
|
@ -7,7 +7,7 @@ const { joinPaths } = require('./helpers.js');
|
|||
* @param {*} filePath
|
||||
*/
|
||||
function getFolderDepth(filePath) {
|
||||
return [...filePath.match(new RegExp('/', 'g'))].length - 1;
|
||||
return [...filePath.match(new RegExp(/\/|\\/, 'g'))].length - 1;
|
||||
}
|
||||
|
||||
function getImportAs(specifier, newImportName) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue