I have cloned this library and in this library they are using an import with a double astrix, like this:
import * as Areas from './areas/**/planner-element.jsx';
Can anyone explain what is this **
and what it does ?
I have cloned this library and in this library they are using an import with a double astrix, like this:
import * as Areas from './areas/**/planner-element.jsx';
Can anyone explain what is this **
and what it does ?
It's a pattern to identify folders and sub-folders recursively.
For example if they have something like
areas/foo/planner-element.jsx
areas/foo/bar/planner-element.jsx
It will identify both of them. It's like a more loose notation, so it's not really important where that file is, just that it's somewhere under areas
\**\
This pattern is used for recursive folder tree traversal.
Check out this SO answer
./lines/**/planner-element.jsx
translates to the file planner-element.jsx
in any directory under the lines directory.
A single asterisk translates to any character up the first / (so ./lines/*.jsx will include all jsx files in the lines directory).
A double asterisk translates to any character, which means not only file names but also directories are taken into account (and so ./lines/**/planner-element.jsx will include any file named planner-element.jsx which is in any direrctory underneath the lines directory)
** denotes folder any folder names in the path and also can be mutiple child folders.