summaryrefslogtreecommitdiff
path: root/node_modules/dir-glob
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:10:59 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:41:44 +0800
commitfc87c009806dcc98867f6b58efe29b042aa01dee (patch)
tree8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/dir-glob
parent3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff)
node: updatemain
Diffstat (limited to 'node_modules/dir-glob')
-rw-r--r--node_modules/dir-glob/index.js75
-rw-r--r--node_modules/dir-glob/license9
-rw-r--r--node_modules/dir-glob/package.json38
-rw-r--r--node_modules/dir-glob/readme.md76
4 files changed, 0 insertions, 198 deletions
diff --git a/node_modules/dir-glob/index.js b/node_modules/dir-glob/index.js
deleted file mode 100644
index c21cdf39..00000000
--- a/node_modules/dir-glob/index.js
+++ /dev/null
@@ -1,75 +0,0 @@
-'use strict';
-const path = require('path');
-const pathType = require('path-type');
-
-const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0];
-
-const getPath = (filepath, cwd) => {
- const pth = filepath[0] === '!' ? filepath.slice(1) : filepath;
- return path.isAbsolute(pth) ? pth : path.join(cwd, pth);
-};
-
-const addExtensions = (file, extensions) => {
- if (path.extname(file)) {
- return `**/${file}`;
- }
-
- return `**/${file}.${getExtensions(extensions)}`;
-};
-
-const getGlob = (directory, options) => {
- if (options.files && !Array.isArray(options.files)) {
- throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof options.files}\``);
- }
-
- if (options.extensions && !Array.isArray(options.extensions)) {
- throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``);
- }
-
- if (options.files && options.extensions) {
- return options.files.map(x => path.posix.join(directory, addExtensions(x, options.extensions)));
- }
-
- if (options.files) {
- return options.files.map(x => path.posix.join(directory, `**/${x}`));
- }
-
- if (options.extensions) {
- return [path.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)];
- }
-
- return [path.posix.join(directory, '**')];
-};
-
-module.exports = async (input, options) => {
- options = {
- cwd: process.cwd(),
- ...options
- };
-
- if (typeof options.cwd !== 'string') {
- throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``);
- }
-
- const globs = await Promise.all([].concat(input).map(async x => {
- const isDirectory = await pathType.isDirectory(getPath(x, options.cwd));
- return isDirectory ? getGlob(x, options) : x;
- }));
-
- return [].concat.apply([], globs); // eslint-disable-line prefer-spread
-};
-
-module.exports.sync = (input, options) => {
- options = {
- cwd: process.cwd(),
- ...options
- };
-
- if (typeof options.cwd !== 'string') {
- throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``);
- }
-
- const globs = [].concat(input).map(x => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x);
-
- return [].concat.apply([], globs); // eslint-disable-line prefer-spread
-};
diff --git a/node_modules/dir-glob/license b/node_modules/dir-glob/license
deleted file mode 100644
index db6bc32c..00000000
--- a/node_modules/dir-glob/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Kevin MÃ¥rtensson <kevinmartensson@gmail.com> (github.com/kevva)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/dir-glob/package.json b/node_modules/dir-glob/package.json
deleted file mode 100644
index b0a397e6..00000000
--- a/node_modules/dir-glob/package.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "dir-glob",
- "version": "3.0.1",
- "description": "Convert directories to glob compatible strings",
- "license": "MIT",
- "repository": "kevva/dir-glob",
- "author": {
- "name": "Kevin MÃ¥rtensson",
- "email": "kevinmartensson@gmail.com",
- "url": "github.com/kevva"
- },
- "engines": {
- "node": ">=8"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "convert",
- "directory",
- "extensions",
- "files",
- "glob"
- ],
- "dependencies": {
- "path-type": "^4.0.0"
- },
- "devDependencies": {
- "ava": "^2.1.0",
- "del": "^4.1.1",
- "make-dir": "^3.0.0",
- "rimraf": "^2.5.0",
- "xo": "^0.24.0"
- }
-}
diff --git a/node_modules/dir-glob/readme.md b/node_modules/dir-glob/readme.md
deleted file mode 100644
index cb7313f0..00000000
--- a/node_modules/dir-glob/readme.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# dir-glob [![Build Status](https://travis-ci.org/kevva/dir-glob.svg?branch=master)](https://travis-ci.org/kevva/dir-glob)
-
-> Convert directories to glob compatible strings
-
-
-## Install
-
-```
-$ npm install dir-glob
-```
-
-
-## Usage
-
-```js
-const dirGlob = require('dir-glob');
-
-(async () => {
- console.log(await dirGlob(['index.js', 'test.js', 'fixtures']));
- //=> ['index.js', 'test.js', 'fixtures/**']
-
- console.log(await dirGlob(['index.js', 'inner_folder'], {cwd: 'fixtures'}));
- //=> ['index.js', 'inner_folder/**']
-
- console.log(await dirGlob(['lib/**', 'fixtures'], {
- files: ['test', 'unicorn']
- extensions: ['js']
- }));
- //=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']
-
- console.log(await dirGlob(['lib/**', 'fixtures'], {
- files: ['test', 'unicorn', '*.jsx'],
- extensions: ['js', 'png']
- }));
- //=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
-})();
-```
-
-
-## API
-
-### dirGlob(input, options?)
-
-Returns a `Promise<string[]>` with globs.
-
-### dirGlob.sync(input, options?)
-
-Returns a `string[]` with globs.
-
-#### input
-
-Type: `string | string[]`
-
-Paths.
-
-#### options
-
-Type: `object`
-
-##### extensions
-
-Type: `string[]`
-
-Append extensions to the end of your globs.
-
-##### files
-
-Type: `string[]`
-
-Only glob for certain files.
-
-##### cwd
-
-Type: `string[]`
-
-Test in specific directory.