You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importglobbyfrom'globby';constdir=newURL('./src',import.meta.url);console.log(awaitglobby('*',{cwd: dir}));// TypeError: Expected `cwd` to be of type `string` but received type `object`
Currently, I have to
+ import {fileURLToPath} from 'node:url';
import globby from 'globby';
const dir = new URL('./src', import.meta.url);
- console.log(await globby('*', {cwd: dir}));+ console.log(await globby('*', {cwd: fileURLToPath(dir)}));
The text was updated successfully, but these errors were encountered:
fisker
changed the title
Accept URL as cwd?
Accept URL as options.cwd?
May 12, 2021
// TypeError: Expected cwd to be of type string but received type object
I was just browsing in this repo and came accross this and wanted to comment.
Not sure how you guys implemented this yet but why not do something like this everywhere a URL is accepted?
if(cwdinstanceofURL){cwd=cwd.toString()}
eg. check if it is an URL object and if so use it's .toString() method to convert it into a string...
Currently, I have to
The text was updated successfully, but these errors were encountered: