Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cjs globby v13 esm #140

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {GlobbyOptions} from 'globby';
import {Options as GlobbyOptions} from 'globby';

declare namespace del {
interface Options extends GlobbyOptions {
Expand Down Expand Up @@ -51,7 +51,7 @@ declare const del: {
sync: (
patterns: string | readonly string[],
options?: del.Options
) => string[];
) => Promise<string[]>;

/**
Delete files and directories using glob patterns.
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = async (patterns, {force, dryRun, cwd = process.cwd(), ...option

patterns = normalizePatterns(patterns);

const files = (await globby(patterns, options))
const files = (await import('globby')).globby(patterns, options))
.sort((a, b) => b.localeCompare(a));

const mapper = async file => {
Expand All @@ -87,7 +87,7 @@ module.exports = async (patterns, {force, dryRun, cwd = process.cwd(), ...option
return removedFiles;
};

module.exports.sync = (patterns, {force, dryRun, cwd = process.cwd(), ...options} = {}) => {
module.exports.sync = async (patterns, {force, dryRun, cwd = process.cwd(), ...options} = {}) => {
options = {
expandDirectories: false,
onlyFiles: false,
Expand All @@ -98,7 +98,7 @@ module.exports.sync = (patterns, {force, dryRun, cwd = process.cwd(), ...options

patterns = normalizePatterns(patterns);

const files = globby.sync(patterns, options)
const files = (await import('globby')).globbySync(patterns, options)
.sort((a, b) => b.localeCompare(a));

const removedFiles = files.map(file => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "del",
"version": "6.0.0",
"version": "6.1.0",
"description": "Delete files and directories",
"license": "MIT",
"repository": "sindresorhus/del",
Expand Down Expand Up @@ -46,7 +46,7 @@
"filesystem"
],
"dependencies": {
"globby": "^11.0.1",
"globby": "^13.1.1",
"graceful-fs": "^4.2.4",
"is-glob": "^4.0.1",
"is-path-cwd": "^2.2.0",
Expand Down