feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

47
node_modules/path-exists/index.d.ts generated vendored
View File

@@ -1,28 +1,31 @@
declare const pathExists: {
/**
Check if a path exists.
/**
Check if a path exists.
@returns Whether the path exists.
@returns Whether the path exists.
@example
```
// foo.ts
import pathExists = require('path-exists');
@example
```
// foo.ts
import {pathExists} from 'path-exists';
(async () => {
console.log(await pathExists('foo.ts'));
//=> true
})();
```
*/
(path: string): Promise<boolean>;
console.log(await pathExists('foo.ts'));
//=> true
```
*/
export function pathExists(path: string): Promise<boolean>;
/**
Synchronously check if a path exists.
/**
Synchronously check if a path exists.
@returns Whether the path exists.
*/
sync(path: string): boolean;
};
@returns Whether the path exists.
export = pathExists;
@example
```
// foo.ts
import {pathExistsSync} from 'path-exists';
console.log(pathExistsSync('foo.ts'));
//=> true
```
*/
export function pathExistsSync(path: string): boolean;

20
node_modules/path-exists/index.js generated vendored
View File

@@ -1,23 +1,19 @@
'use strict';
const fs = require('fs');
const {promisify} = require('util');
import fs, {promises as fsPromises} from 'node:fs';
const pAccess = promisify(fs.access);
module.exports = async path => {
export async function pathExists(path) {
try {
await pAccess(path);
await fsPromises.access(path);
return true;
} catch (_) {
} catch {
return false;
}
};
}
module.exports.sync = path => {
export function pathExistsSync(path) {
try {
fs.accessSync(path);
return true;
} catch (_) {
} catch {
return false;
}
};
}

2
node_modules/path-exists/license generated vendored
View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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:

View File

@@ -1,16 +1,18 @@
{
"name": "path-exists",
"version": "4.0.0",
"version": "5.0.0",
"description": "Check if a path exists",
"license": "MIT",
"repository": "sindresorhus/path-exists",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "xo && ava && tsd"
@@ -32,8 +34,8 @@
"stat"
],
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
}
}

32
node_modules/path-exists/readme.md generated vendored
View File

@@ -1,52 +1,52 @@
# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists)
# path-exists
> Check if a path exists
NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed.
While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.
Never use this before handling a file though:
> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there.
## Install
```
$ npm install path-exists
```
## Usage
```js
// foo.js
const pathExists = require('path-exists');
import {pathExists} from 'path-exists';
(async () => {
console.log(await pathExists('foo.js'));
//=> true
})();
console.log(await pathExists('foo.js'));
//=> true
```
## API
### pathExists(path)
Returns a `Promise<boolean>` of whether the path exists.
### pathExists.sync(path)
### pathExistsSync(path)
Returns a `boolean` of whether the path exists.
## Related
- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module
- [path-type](https://github.com/sindresorhus/path-type) - Check if a path exists and whether it's a file, directory, or symlink
---
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-path-exists?utm_source=npm-path-exists&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>