From fea3e7212421bce09ce264b0b8e294c64cce8396 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Thu, 22 Jul 2021 13:22:24 +0300 Subject: [PATCH] chore(deps): update globby v12 --- glob-pattern.js | 10 +++++----- index.d.ts | 2 +- index.js | 4 ++-- package.json | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/glob-pattern.js b/glob-pattern.js index 8b5f9de..f65f945 100644 --- a/glob-pattern.js +++ b/glob-pattern.js @@ -1,6 +1,6 @@ import path from 'node:path'; import fs from 'node:fs'; -import glob from 'globby'; +import {globbySync, isDynamicPattern} from 'globby'; import junk from 'junk'; export default class GlobPattern { @@ -16,7 +16,7 @@ export default class GlobPattern { this.options = options; if ( - !glob.hasMagic(pattern) + !isDynamicPattern(pattern) && fs.existsSync(pattern) && fs.lstatSync(pattern).isDirectory() ) { @@ -30,7 +30,7 @@ export default class GlobPattern { get normalizedPath() { const segments = this.originalPath.split('/'); - const magicIndex = segments.findIndex(item => item ? glob.hasMagic(item) : false); + const magicIndex = segments.findIndex(item => item ? isDynamicPattern(item) : false); const normalized = segments.slice(0, magicIndex).join('/'); if (normalized) { @@ -41,11 +41,11 @@ export default class GlobPattern { } hasMagic() { - return glob.hasMagic(this.options.flat ? this.path : this.originalPath); + return isDynamicPattern(this.options.flat ? this.path : this.originalPath); } getMatches() { - let matches = glob.sync(this.path, { + let matches = globbySync(this.path, { ...this.options, dot: true, absolute: true, diff --git a/index.d.ts b/index.d.ts index 1b8f812..4c20506 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -import {GlobbyOptions as GlobOptions} from 'globby'; +import {Options as GlobOptions} from 'globby'; import {Options as CpFileOptions} from 'cp-file'; export interface Entry { diff --git a/index.js b/index.js index 84b43ba..abb6349 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ import pMap from 'p-map'; import arrify from 'arrify'; import cpFile from 'cp-file'; import pFilter from 'p-filter'; -import glob from 'globby'; +import {isDynamicPattern} from 'globby'; import CpyError from './cpy-error.js'; import GlobPattern from './glob-pattern.js'; @@ -162,7 +162,7 @@ export default function cpy( ); } - if (matches.length === 0 && !glob.hasMagic(pattern.originalPath)) { + if (matches.length === 0 && !isDynamicPattern(pattern.originalPath)) { throw new CpyError( `Cannot copy \`${pattern.originalPath}\`: the file doesn't exist`, ); diff --git a/package.json b/package.json index 66bffa1..7ccd29e 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "dependencies": { "arrify": "^3.0.0", "cp-file": "^9.1.0", - "globby": "^11.0.4", + "globby": "^12.0.0", "junk": "^3.1.0", "nested-error-stacks": "^2.1.0", "p-filter": "^2.1.0", @@ -60,6 +60,6 @@ "tempy": "^1.0.1", "tsd": "^0.17.0", "typescript": "^4.3.5", - "xo": "^0.41.0" + "xo": "^0.42.0" } }