File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import path from 'node:path' ;
22import fs from 'node:fs' ;
3- import glob from 'globby' ;
3+ import { globbySync , isDynamicPattern } from 'globby' ;
44import junk from 'junk' ;
55
66export default class GlobPattern {
@@ -16,7 +16,7 @@ export default class GlobPattern {
1616 this . options = options ;
1717
1818 if (
19- ! glob . hasMagic ( pattern )
19+ ! isDynamicPattern ( pattern )
2020 && fs . existsSync ( pattern )
2121 && fs . lstatSync ( pattern ) . isDirectory ( )
2222 ) {
@@ -30,7 +30,7 @@ export default class GlobPattern {
3030
3131 get normalizedPath ( ) {
3232 const segments = this . originalPath . split ( '/' ) ;
33- const magicIndex = segments . findIndex ( item => item ? glob . hasMagic ( item ) : false ) ;
33+ const magicIndex = segments . findIndex ( item => item ? isDynamicPattern ( item ) : false ) ;
3434 const normalized = segments . slice ( 0 , magicIndex ) . join ( '/' ) ;
3535
3636 if ( normalized ) {
@@ -41,11 +41,11 @@ export default class GlobPattern {
4141 }
4242
4343 hasMagic ( ) {
44- return glob . hasMagic ( this . options . flat ? this . path : this . originalPath ) ;
44+ return isDynamicPattern ( this . options . flat ? this . path : this . originalPath ) ;
4545 }
4646
4747 getMatches ( ) {
48- let matches = glob . sync ( this . path , {
48+ let matches = globbySync ( this . path , {
4949 ...this . options ,
5050 dot : true ,
5151 absolute : true ,
Original file line number Diff line number Diff line change 1- import { GlobbyOptions as GlobOptions } from 'globby' ;
1+ import { Options as GlobOptions } from 'globby' ;
22import { Options as CpFileOptions } from 'cp-file' ;
33
44export interface Entry {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import pMap from 'p-map';
55import arrify from 'arrify' ;
66import cpFile from 'cp-file' ;
77import pFilter from 'p-filter' ;
8- import glob from 'globby' ;
8+ import { isDynamicPattern } from 'globby' ;
99import CpyError from './cpy-error.js' ;
1010import GlobPattern from './glob-pattern.js' ;
1111
@@ -162,7 +162,7 @@ export default function cpy(
162162 ) ;
163163 }
164164
165- if ( matches . length === 0 && ! glob . hasMagic ( pattern . originalPath ) ) {
165+ if ( matches . length === 0 && ! isDynamicPattern ( pattern . originalPath ) ) {
166166 throw new CpyError (
167167 `Cannot copy \`${ pattern . originalPath } \`: the file doesn't exist` ,
168168 ) ;
Original file line number Diff line number Diff line change 4747 "dependencies" : {
4848 "arrify" : " ^3.0.0" ,
4949 "cp-file" : " ^9.1.0" ,
50- "globby" : " ^11 .0.4 " ,
50+ "globby" : " ^12 .0.0 " ,
5151 "junk" : " ^3.1.0" ,
5252 "nested-error-stacks" : " ^2.1.0" ,
5353 "p-filter" : " ^2.1.0" ,
6060 "tempy" : " ^1.0.1" ,
6161 "tsd" : " ^0.17.0" ,
6262 "typescript" : " ^4.3.5" ,
63- "xo" : " ^0.41 .0"
63+ "xo" : " ^0.42 .0"
6464 }
6565}
You can’t perform that action at this time.
0 commit comments