Aktueller Stand
This commit is contained in:
31
backend/node_modules/@fastify/static/.eslintrc.json
generated
vendored
31
backend/node_modules/@fastify/static/.eslintrc.json
generated
vendored
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": ["eslint:recommended", "standard"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["types/*.test-d.ts", "types/*.d.ts"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": ["./tsconfig.eslint.json"]
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
||||
],
|
||||
"rules": {
|
||||
"no-use-before-define": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-floating-promises": "off",
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-argument": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/no-misused-promises": ["error", {
|
||||
"checksVoidReturn": false
|
||||
}]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
2
backend/node_modules/@fastify/static/.github/dependabot.yml
generated
vendored
2
backend/node_modules/@fastify/static/.github/dependabot.yml
generated
vendored
@@ -9,5 +9,5 @@ updates:
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: "monthly"
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
14
backend/node_modules/@fastify/static/.github/workflows/ci.yml
generated
vendored
14
backend/node_modules/@fastify/static/.github/workflows/ci.yml
generated
vendored
@@ -4,7 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- next
|
||||
- 'v*'
|
||||
paths-ignore:
|
||||
@@ -15,9 +14,20 @@ on:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
|
||||
# This allows a subsequently queued workflow run to interrupt previous runs
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5
|
||||
with:
|
||||
license-check: true
|
||||
lint: true
|
||||
|
||||
2
backend/node_modules/@fastify/static/.taprc
generated
vendored
2
backend/node_modules/@fastify/static/.taprc
generated
vendored
@@ -1,2 +0,0 @@
|
||||
files:
|
||||
- test/**/*.test.js
|
||||
4
backend/node_modules/@fastify/static/LICENSE
generated
vendored
4
backend/node_modules/@fastify/static/LICENSE
generated
vendored
@@ -1,6 +1,8 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2023 Fastify
|
||||
Copyright (c) 2017-present The Fastify team
|
||||
|
||||
The Fastify team members are listed at https://github.com/fastify/fastify#team.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
245
backend/node_modules/@fastify/static/README.md
generated
vendored
245
backend/node_modules/@fastify/static/README.md
generated
vendored
@@ -1,21 +1,30 @@
|
||||
# @fastify/static
|
||||
|
||||

|
||||
[](https://github.com/fastify/fastify-static/actions/workflows/ci.yml)
|
||||
[](https://www.npmjs.com/package/@fastify/static)
|
||||
[](https://standardjs.com/)
|
||||
[](https://github.com/neostandard/neostandard)
|
||||
|
||||
Plugin for serving static files as fast as possible. Supports Fastify version `4.x`.
|
||||
|
||||
| Fastify version | branch |
|
||||
| --------------- | -------------------------------------------------------------------- |
|
||||
| `^4.x` | This branch |
|
||||
| `^3.x` | [`v5.x`](https://github.com/fastify/fastify-static/tree/v5.x) |
|
||||
| `^2.x` | [`2.x`](https://github.com/fastify/fastify-static/tree/2.x) |
|
||||
| `^1.11.x` | [`1.x`](https://github.com/fastify/fastify-static/tree/1.x) |
|
||||
Plugin for serving static files as fast as possible.
|
||||
|
||||
## Install
|
||||
```
|
||||
npm i @fastify/static
|
||||
```
|
||||
|
||||
`npm i @fastify/static`
|
||||
### Compatibility
|
||||
|
||||
| Plugin version | Fastify version |
|
||||
| ---------------|-----------------|
|
||||
| `>=8.x` | `^5.x` |
|
||||
| `>=7.x <8.x` | `^4.x` |
|
||||
| `>=5.x <7.x` | `^3.x` |
|
||||
| `>=2.x <5.x` | `^2.x` |
|
||||
| `^1.x` | `^1.x` |
|
||||
|
||||
|
||||
Please note that if a Fastify version is out of support, then so are the corresponding versions of this plugin
|
||||
in the table above.
|
||||
See [Fastify's LTS policy](https://github.com/fastify/fastify/blob/main/docs/Reference/LTS.md) for more details.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -102,16 +111,47 @@ fastify.get('/path/without/cache/control', function (req, reply) {
|
||||
|
||||
```
|
||||
|
||||
### Managing cache-control headers
|
||||
|
||||
Production sites should use a reverse-proxy to manage caching headers.
|
||||
However, here is an example of using fastify-static to host a Single Page Application (for example a [vite.js](https://vite.dev/) build) with sane caching.
|
||||
|
||||
```js
|
||||
fastify.register(require('@fastify/static'), {
|
||||
root: path.join(import.meta.dirname, 'dist'), // import.meta.dirname node.js >= v20.11.0
|
||||
// By default all assets are immutable and can be cached for a long period due to cache bursting techniques
|
||||
maxAge: '30d',
|
||||
immutable: true,
|
||||
})
|
||||
|
||||
// Explicitly reduce caching of assets that don't use cache bursting techniques
|
||||
fastify.get('/', function (req, reply) {
|
||||
// index.html should never be cached
|
||||
reply.sendFile('index.html', {maxAge: 0, immutable: false})
|
||||
})
|
||||
|
||||
fastify.get('/favicon.ico', function (req, reply) {
|
||||
// favicon can be cached for a short period
|
||||
reply.sendFile('favicon.ico', {maxAge: '1d', immutable: false})
|
||||
})
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
#### `root` (required)
|
||||
#### `serve`
|
||||
Default: `true`
|
||||
|
||||
The absolute path of the directory that contains the files to serve.
|
||||
The file to serve will be determined by combining `req.url` with the
|
||||
provided root directory.
|
||||
If set to `false`, the plugin will not serve files from the `root` directory.
|
||||
|
||||
You can also provide an array of directories containing files to serve.
|
||||
This is useful for serving multiple static directories under a single prefix. Files are served in a "first found, first served" manner, so the order in which you list the directories is important. For best performance, you should always list your main asset directory first. Duplicate paths will raise an error.
|
||||
#### `root` (required if `serve` is not false)
|
||||
|
||||
The absolute path of the directory containing the files to serve.
|
||||
The file to serve is determined by combining `req.url` with the
|
||||
root directory.
|
||||
|
||||
An array of directories can be provided to serve multiple static directories
|
||||
under a single prefix. Files are served in a "first found, first served" manner,
|
||||
so list directories in order of priority. Duplicate paths will raise an error.
|
||||
|
||||
#### `prefix`
|
||||
|
||||
@@ -123,20 +163,26 @@ A URL path prefix used to create a virtual mount path for the static directory.
|
||||
|
||||
Default: `{}`
|
||||
|
||||
Constraints that will be added to registered routes. See Fastify's documentation for
|
||||
Constraints to add to registered routes. See Fastify's documentation for
|
||||
[route constraints](https://fastify.dev/docs/latest/Reference/Routes/#constraints).
|
||||
|
||||
#### `logLevel`
|
||||
|
||||
Default: `info`
|
||||
|
||||
Set log level for registered routes.
|
||||
|
||||
#### `prefixAvoidTrailingSlash`
|
||||
|
||||
Default: `false`
|
||||
|
||||
If set to false prefix will get trailing "/" at the end. If set to true, prefix will not append "/" to prefix.
|
||||
If `false`, the prefix gets a trailing "/". If `true`, no trailing "/" is added to the prefix.
|
||||
|
||||
#### `schemaHide`
|
||||
|
||||
Default: `true`
|
||||
|
||||
A flag that define if the fastify route hide-schema attribute is hidden or not
|
||||
A flag that defines if the fastify route hide-schema attribute is hidden or not.
|
||||
|
||||
#### `setHeaders`
|
||||
|
||||
@@ -144,7 +190,7 @@ Default: `undefined`
|
||||
|
||||
A function to set custom headers on the response. Alterations to the headers
|
||||
must be done synchronously. The function is called as `fn(res, path, stat)`,
|
||||
where the arguments are:
|
||||
with the arguments:
|
||||
|
||||
- `res` The response object.
|
||||
- `path` The path of the file that is being sent.
|
||||
@@ -153,19 +199,20 @@ where the arguments are:
|
||||
#### `send` Options
|
||||
|
||||
The following options are also supported and will be passed directly to the
|
||||
[`send`](https://www.npmjs.com/package/send) module:
|
||||
[`@fastify/send`](https://www.npmjs.com/package/@fastify/send) module:
|
||||
|
||||
- [`acceptRanges`](https://www.npmjs.com/package/send#acceptranges)
|
||||
- [`cacheControl`](https://www.npmjs.com/package/send#cachecontrol)
|
||||
- [`dotfiles`](https://www.npmjs.com/package/send#dotfiles)
|
||||
- [`etag`](https://www.npmjs.com/package/send#etag)
|
||||
- [`extensions`](https://www.npmjs.com/package/send#extensions)
|
||||
- [`immutable`](https://www.npmjs.com/package/send#immutable)
|
||||
- [`index`](https://www.npmjs.com/package/send#index)
|
||||
- [`lastModified`](https://www.npmjs.com/package/send#lastmodified)
|
||||
- [`maxAge`](https://www.npmjs.com/package/send#maxage)
|
||||
- [`acceptRanges`](https://www.npmjs.com/package/@fastify/send#acceptranges)
|
||||
- [`contentType`](https://www.npmjs.com/package/@fastify/send#contenttype)
|
||||
- [`cacheControl`](https://www.npmjs.com/package/@fastify/send#cachecontrol) - Enable or disable setting Cache-Control response header (defaults to `true`). To provide a custom Cache-Control header, set this option to false
|
||||
- [`dotfiles`](https://www.npmjs.com/package/@fastify/send#dotfiles)
|
||||
- [`etag`](https://www.npmjs.com/package/@fastify/send#etag)
|
||||
- [`extensions`](https://www.npmjs.com/package/@fastify/send#extensions)
|
||||
- [`immutable`](https://www.npmjs.com/package/@fastify/send#immutable)
|
||||
- [`index`](https://www.npmjs.com/package/@fastify/send#index)
|
||||
- [`lastModified`](https://www.npmjs.com/package/@fastify/send#lastmodified)
|
||||
- [`maxAge`](https://www.npmjs.com/package/@fastify/send#maxage)
|
||||
|
||||
You're able to alter this options when calling `reply.download('filename.html', options)` or `reply.download('filename.html', 'otherfilename.html', options)` on each response to a request.
|
||||
These options can be altered when calling `reply.sendFile('filename.html', options)` or `reply.sendFile('filename.html', 'otherfilename.html', options)` on each response.
|
||||
|
||||
#### `redirect`
|
||||
|
||||
@@ -173,67 +220,70 @@ Default: `false`
|
||||
|
||||
If set to `true`, `@fastify/static` redirects to the directory with a trailing slash.
|
||||
|
||||
This option cannot be set to `true` with `wildcard` set to `false` on a server
|
||||
with `ignoreTrailingSlash` set to `true`.
|
||||
This option cannot be `true` if `wildcard` is `false` and `ignoreTrailingSlash` is `true`.
|
||||
|
||||
If this option is set to `false`, then requesting directories without trailing
|
||||
slash will trigger your app's 404 handler using `reply.callNotFound()`.
|
||||
If `false`, requesting directories without a trailing slash triggers the app's 404 handler using `reply.callNotFound()`.
|
||||
|
||||
#### `wildcard`
|
||||
|
||||
Default: `true`
|
||||
|
||||
If set to `true`, `@fastify/static` adds a wildcard route to serve files.
|
||||
If set to `false`, `@fastify/static` globs the filesystem for all defined
|
||||
files in the served folder (`${root}/**/**`), and just creates the routes needed for
|
||||
those and it will not serve the newly added file on the filesystem.
|
||||
If `true`, `@fastify/static` adds a wildcard route to serve files.
|
||||
If `false`, it globs the filesystem for all defined files in the
|
||||
served folder (`${root}/**/**`) and creates the necessary routes,
|
||||
but will not serve newly added files.
|
||||
|
||||
The default options of https://www.npmjs.com/package/glob are applied
|
||||
for getting the file list.
|
||||
The default options of [`glob`](https://www.npmjs.com/package/glob)
|
||||
are applied for getting the file list.
|
||||
|
||||
This option cannot be set to `false` with `redirect` set to `true` on a server
|
||||
with `ignoreTrailingSlash` set to `true`.
|
||||
This option cannot be `false` if `redirect` is `true` and `ignoreTrailingSlash` is `true`.
|
||||
|
||||
#### `globIgnore`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
This is passed to [`glob`](https://www.npmjs.com/package/glob)
|
||||
as the `ignore` option. It can be used to ignore files or directories
|
||||
when using the `wildcard: false` option.
|
||||
|
||||
#### `allowedPath`
|
||||
|
||||
Default: `(pathName, root, request) => true`
|
||||
|
||||
This function allows filtering the served files. Also, with the help of the request object a more complex path authentication is possible.
|
||||
If the function returns `true`, the file will be served.
|
||||
If the function returns `false`, Fastify's 404 handler will be called.
|
||||
This function filters served files. Using the request object, complex path authentication is possible.
|
||||
Returning `true` serves the file; returning `false` calls Fastify's 404 handler.
|
||||
|
||||
#### `index`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
Under the hood we use [send](https://github.com/pillarjs/send#index) lib that by default supports "index.html" files.
|
||||
To disable this set false or to supply a new index pass a string or an array in preferred order.
|
||||
Under the hood, [`@fastify/send`](https://www.npmjs.com/package/@fastify/send) supports "index.html" files by default.
|
||||
To disable this, set `false`, or supply a new index by passing a string or an array in preferred order.
|
||||
|
||||
#### `serveDotFiles`
|
||||
|
||||
Default: `false`
|
||||
|
||||
When `true`, files in hidden directories (e.g. `.foo`) will be served.
|
||||
If `true`, serves files in hidden directories (e.g., `.foo`).
|
||||
|
||||
#### `list`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
If set, it provides the directory list calling the directory path.
|
||||
If set, provides the directory list by calling the directory path.
|
||||
Default response is JSON.
|
||||
|
||||
Default response is json.
|
||||
Multi-root is not supported within the `list` option.
|
||||
|
||||
Note:
|
||||
- Multi-root is not supported within the `list` option.
|
||||
- If `dotfiles` option value is `deny` or `ignore`, dotfiles will be excluded.
|
||||
If `dotfiles` is `deny` or `ignore`, dotfiles are excluded.
|
||||
|
||||
**Example:**
|
||||
Example:
|
||||
|
||||
```js
|
||||
fastify.register(require('@fastify/static'), {
|
||||
root: path.join(__dirname, 'public'),
|
||||
prefix: '/public/',
|
||||
index: false
|
||||
index: false,
|
||||
list: true
|
||||
})
|
||||
```
|
||||
@@ -241,7 +291,7 @@ fastify.register(require('@fastify/static'), {
|
||||
Request
|
||||
|
||||
```bash
|
||||
GET .../public
|
||||
GET /public
|
||||
```
|
||||
|
||||
Response
|
||||
@@ -256,17 +306,17 @@ Default: `json`
|
||||
|
||||
Options: `html`, `json`
|
||||
|
||||
Directory list can be also in `html` format; in that case, `list.render` function is required.
|
||||
Directory list can be in `html` format; in that case, `list.render` function is required.
|
||||
|
||||
You can override the option with URL parameter `format`. Options are `html` and `json`.
|
||||
This option can be overridden by the URL parameter `format`. Options are `html` and `json`.
|
||||
|
||||
```bash
|
||||
GET .../public/assets?format=json
|
||||
GET /public/assets?format=json
|
||||
```
|
||||
|
||||
will return the response as json independent of `list.format`.
|
||||
Returns the response as JSON, regardless of `list.format`.
|
||||
|
||||
**Example:**
|
||||
Example:
|
||||
|
||||
```js
|
||||
fastify.register(require('@fastify/static'), {
|
||||
@@ -293,7 +343,7 @@ fastify.register(require('@fastify/static'), {
|
||||
Request
|
||||
|
||||
```bash
|
||||
GET .../public
|
||||
GET /public
|
||||
```
|
||||
|
||||
Response
|
||||
@@ -317,11 +367,11 @@ Response
|
||||
|
||||
Default: `['']`
|
||||
|
||||
Directory list can respond to different routes, declared in `list.names` options.
|
||||
Directory list can respond to different routes declared in `list.names`.
|
||||
|
||||
Note: if a file with the same name exists, the actual file is sent.
|
||||
> ℹ️ Note: If a file with the same name exists, the actual file is sent.
|
||||
|
||||
**Example:**
|
||||
Example:
|
||||
|
||||
```js
|
||||
fastify.register(require('@fastify/static'), {
|
||||
@@ -335,20 +385,20 @@ fastify.register(require('@fastify/static'), {
|
||||
})
|
||||
```
|
||||
|
||||
Dir list respond with the same content to
|
||||
Dir list respond with the same content to:
|
||||
|
||||
```bash
|
||||
GET .../public
|
||||
GET .../public/
|
||||
GET .../public/index
|
||||
GET .../public/index.json
|
||||
GET /public
|
||||
GET /public/
|
||||
GET /public/index
|
||||
GET /public/index.json
|
||||
```
|
||||
|
||||
#### `list.extendedFolderInfo`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
If `true` some extended information for folders will be accessible in `list.render` and in the json response.
|
||||
If `true`, extended information for folders will be accessible in `list.render` and the JSON response.
|
||||
|
||||
```js
|
||||
render(dirs, files) {
|
||||
@@ -362,7 +412,7 @@ render(dirs, files) {
|
||||
}
|
||||
```
|
||||
|
||||
Warning: This will slightly decrease the performance, especially for deeply nested file structures.
|
||||
> ⚠ Warning: This will slightly decrease the performance, especially for deeply nested file structures.
|
||||
|
||||
#### `list.jsonFormat`
|
||||
|
||||
@@ -370,7 +420,7 @@ Default: `names`
|
||||
|
||||
Options: `names`, `extended`
|
||||
|
||||
This option determines the output format when `json` is selected.
|
||||
Determines the output format when `json` is selected.
|
||||
|
||||
`names`:
|
||||
```json
|
||||
@@ -394,13 +444,11 @@ This option determines the output format when `json` is selected.
|
||||
"name": "dir1",
|
||||
"stats": {
|
||||
"dev": 2100,
|
||||
"size": 4096,
|
||||
...
|
||||
"size": 4096
|
||||
},
|
||||
"extendedInfo": {
|
||||
"fileCount": 4,
|
||||
"totalSize": 51233,
|
||||
...
|
||||
"totalSize": 51233
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -409,8 +457,7 @@ This option determines the output format when `json` is selected.
|
||||
"name": "file1.txt",
|
||||
"stats": {
|
||||
"dev": 2200,
|
||||
"size": 554,
|
||||
...
|
||||
"size": 554
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -421,9 +468,9 @@ This option determines the output format when `json` is selected.
|
||||
|
||||
Default: `false`
|
||||
|
||||
Try to send the brotli encoded asset first (when supported within the `Accept-Encoding` headers), retry for gzip, then the fall back to the original `pathname`. You may choose to skip compression for smaller files that don't benefit from it.
|
||||
First, try to send the brotli encoded asset (if supported by `Accept-Encoding` headers), then gzip, and finally the original `pathname`. Skip compression for smaller files that do not benefit from it.
|
||||
|
||||
Assume this structure with the compressed asset as a sibling of the un-compressed counterpart:
|
||||
Assume this structure with the compressed asset as a sibling of the uncompressed counterpart:
|
||||
|
||||
```
|
||||
./public
|
||||
@@ -437,22 +484,21 @@ Assume this structure with the compressed asset as a sibling of the un-compresse
|
||||
|
||||
#### Disable serving
|
||||
|
||||
If you would just like to use the reply decorator and not serve whole directories automatically, you can simply pass the option `{ serve: false }`. This will prevent the plugin from serving everything under `root`.
|
||||
To use only the reply decorator without serving directories, pass `{ serve: false }`.
|
||||
This prevents the plugin from serving everything under `root`.
|
||||
|
||||
#### Disabling reply decorator
|
||||
|
||||
The reply object is decorated with a `sendFile` function by default. If you want to
|
||||
disable this, pass the option `{ decorateReply: false }`. If @fastify/static is
|
||||
registered to multiple prefixes in the same route only one can initialize reply
|
||||
decorators.
|
||||
The reply object is decorated with a `sendFile` function by default. To disable this,
|
||||
pass `{ decorateReply: false }`. If `@fastify/static` is registered to multiple prefixes
|
||||
in the same route, only one can initialize reply decorators.
|
||||
|
||||
#### Handling 404s
|
||||
|
||||
If a request matches the URL `prefix` but a file cannot be found for the
|
||||
request, Fastify's 404 handler will be called. You can set a custom 404
|
||||
handler with [`fastify.setNotFoundHandler()`](https://fastify.dev/docs/latest/Reference/Server/#setnotfoundhandler).
|
||||
If a request matches the URL `prefix` but no file is found, Fastify's 404
|
||||
handler is called. Set a custom 404 handler with [`fastify.setNotFoundHandler()`](https://fastify.dev/docs/latest/Reference/Server/#setnotfoundhandler).
|
||||
|
||||
When registering `@fastify/static` within an encapsulated context, the `wildcard` option may need to be set to `false` in order to support index resolution and nested not-found-handler:
|
||||
When registering `@fastify/static` within an encapsulated context, the `wildcard` option may need to be set to `false` to support index resolution and nested not-found-handler:
|
||||
|
||||
```js
|
||||
const app = require('fastify')();
|
||||
@@ -469,25 +515,24 @@ app.register((childContext, _, done) => {
|
||||
}, { prefix: 'docs' });
|
||||
```
|
||||
|
||||
This code will send the `index.html` for the paths `docs`, `docs/`, and `docs/index.html`. For all other `docs/<undefined-routes>` it will reply with `404.html`.
|
||||
This code will send the `index.html` for the paths `docs`, `docs/`, and `docs/index.html`. For all other `docs/<undefined-routes>` it will reply with `404.html`.
|
||||
|
||||
### Handling Errors
|
||||
|
||||
If an error occurs while trying to send a file, the error will be passed
|
||||
to Fastify's error handler. You can set a custom error handler with
|
||||
[`fastify.setErrorHandler()`](https://fastify.dev/docs/latest/Reference/Server/#seterrorhandler).
|
||||
If an error occurs while sending a file, it is passed to Fastify's error handler.
|
||||
Set a custom handler with [`fastify.setErrorHandler()`](https://fastify.dev/docs/latest/Reference/Server/#seterrorhandler).
|
||||
|
||||
### Payload `stream.filename`
|
||||
### Payload `stream.path`
|
||||
|
||||
If you need to access the filename inside the `onSend` hook, you can use `payload.filename`.
|
||||
Access the file path inside the `onSend` hook using `payload.path`.
|
||||
|
||||
```js
|
||||
fastify.addHook('onSend', function (req, reply, payload, next) {
|
||||
console.log(payload.filename)
|
||||
console.log(payload.path)
|
||||
next()
|
||||
})
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Licensed under [MIT](./LICENSE)
|
||||
Licensed under [MIT](./LICENSE).
|
||||
|
||||
7
backend/node_modules/@fastify/static/eslint.config.js
generated
vendored
Normal file
7
backend/node_modules/@fastify/static/eslint.config.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = require('neostandard')({
|
||||
ignores: require('neostandard').resolveIgnoresFromGitignore(),
|
||||
noJsx: true,
|
||||
ts: true,
|
||||
})
|
||||
35
backend/node_modules/@fastify/static/example/server-dir-list.js
generated
vendored
35
backend/node_modules/@fastify/static/example/server-dir-list.js
generated
vendored
@@ -1,32 +1,21 @@
|
||||
'use strict'
|
||||
|
||||
const path = require('node:path')
|
||||
const Handlebars = require('handlebars')
|
||||
|
||||
const fastify = require('fastify')({ logger: { level: 'trace' } })
|
||||
|
||||
// Handlebar template for listing files and directories.
|
||||
const template = `
|
||||
<html>
|
||||
<body>
|
||||
dirs
|
||||
<ul>
|
||||
{{#dirs}}
|
||||
<li><a href="{{href}}">{{name}}</a></li>
|
||||
{{/dirs}}
|
||||
</ul>
|
||||
|
||||
list
|
||||
|
||||
<ul>
|
||||
{{#files}}
|
||||
<li><a href="{{href}}" target="_blank">{{name}}</a></li>
|
||||
{{/files}}
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
const renderer = (dirs, files) => {
|
||||
return `
|
||||
<html><body>
|
||||
<ul>
|
||||
${dirs.map(dir => `<li><a href="${dir.href}">${dir.name}</a></li>`).join('\n ')}
|
||||
</ul>
|
||||
<ul>
|
||||
${files.map(file => `<li><a href="${file.href}" target="_blank">${file.name}</a></li>`).join('\n ')}
|
||||
</ul>
|
||||
</body></html>
|
||||
`
|
||||
const handlebarTemplate = Handlebars.compile(template)
|
||||
}
|
||||
|
||||
fastify
|
||||
.register(require('..'), {
|
||||
@@ -41,7 +30,7 @@ fastify
|
||||
// A list of filenames that trigger a directory list response.
|
||||
names: ['index', 'index.html', 'index.htm', '/'],
|
||||
// You can provide your own render method as needed.
|
||||
render: (dirs, files) => handlebarTemplate({ dirs, files })
|
||||
renderer
|
||||
}
|
||||
})
|
||||
.listen({ port: 3000 }, err => {
|
||||
|
||||
400
backend/node_modules/@fastify/static/index.js
generated
vendored
400
backend/node_modules/@fastify/static/index.js
generated
vendored
@@ -1,6 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const { PassThrough } = require('node:stream')
|
||||
const path = require('node:path')
|
||||
const { fileURLToPath } = require('node:url')
|
||||
const { statSync } = require('node:fs')
|
||||
@@ -17,10 +16,17 @@ const asteriskRegex = /\*/gu
|
||||
|
||||
const supportedEncodings = ['br', 'gzip', 'deflate']
|
||||
send.mime.default_type = 'application/octet-stream'
|
||||
const encodingExtensionMap = {
|
||||
br: '.br',
|
||||
gzip: '.gz'
|
||||
}
|
||||
|
||||
/** @type {import("fastify").FastifyPluginAsync<import("./types").FastifyStaticOptions>} */
|
||||
async function fastifyStatic (fastify, opts) {
|
||||
opts.root = normalizeRoot(opts.root)
|
||||
checkRootPathForErrors(fastify, opts.root)
|
||||
if (opts.serve !== false || opts.root !== undefined) {
|
||||
opts.root = normalizeRoot(opts.root)
|
||||
checkRootPathForErrors(fastify, opts.root)
|
||||
}
|
||||
|
||||
const setHeaders = opts.setHeaders
|
||||
if (setHeaders !== undefined && typeof setHeaders !== 'function') {
|
||||
@@ -32,13 +38,12 @@ async function fastifyStatic (fastify, opts) {
|
||||
throw invalidDirListOpts
|
||||
}
|
||||
|
||||
if (opts.dotfiles === undefined) {
|
||||
opts.dotfiles = 'allow'
|
||||
}
|
||||
opts.dotfiles ??= 'allow'
|
||||
|
||||
const sendOptions = {
|
||||
root: opts.root,
|
||||
acceptRanges: opts.acceptRanges,
|
||||
contentType: opts.contentType,
|
||||
cacheControl: opts.cacheControl,
|
||||
dotfiles: opts.dotfiles,
|
||||
etag: opts.etag,
|
||||
@@ -49,7 +54,7 @@ async function fastifyStatic (fastify, opts) {
|
||||
maxAge: opts.maxAge
|
||||
}
|
||||
|
||||
let prefix = opts.prefix ?? (opts.prefix = '/')
|
||||
let prefix = opts.prefix ??= '/'
|
||||
|
||||
if (!opts.prefixAvoidTrailingSlash) {
|
||||
prefix =
|
||||
@@ -62,8 +67,9 @@ async function fastifyStatic (fastify, opts) {
|
||||
const routeOpts = {
|
||||
constraints: opts.constraints,
|
||||
schema: {
|
||||
hide: opts.schemaHide !== undefined ? opts.schemaHide : true
|
||||
hide: opts.schemaHide ?? true
|
||||
},
|
||||
logLevel: opts.logLevel,
|
||||
errorHandler (error, request, reply) {
|
||||
if (error?.code === 'ERR_STREAM_PREMATURE_CLOSE') {
|
||||
reply.request.raw.destroy()
|
||||
@@ -77,7 +83,7 @@ async function fastifyStatic (fastify, opts) {
|
||||
if (opts.decorateReply !== false) {
|
||||
fastify.decorateReply('sendFile', function (filePath, rootPath, options) {
|
||||
const opts = typeof rootPath === 'object' ? rootPath : options
|
||||
const root = typeof rootPath === 'string' ? rootPath : opts && opts.root
|
||||
const root = typeof rootPath === 'string' ? rootPath : opts?.root
|
||||
pumpSendToReply(
|
||||
this.request,
|
||||
this,
|
||||
@@ -108,7 +114,7 @@ async function fastifyStatic (fastify, opts) {
|
||||
|
||||
if (opts.serve !== false) {
|
||||
if (opts.wildcard && typeof opts.wildcard !== 'boolean') {
|
||||
throw new Error('"wildcard" option must be a boolean')
|
||||
throw new TypeError('"wildcard" option must be a boolean')
|
||||
}
|
||||
if (opts.wildcard === undefined || opts.wildcard === true) {
|
||||
fastify.route({
|
||||
@@ -121,11 +127,11 @@ async function fastifyStatic (fastify, opts) {
|
||||
})
|
||||
if (opts.redirect === true && prefix !== opts.prefix) {
|
||||
fastify.get(opts.prefix, routeOpts, (req, reply) => {
|
||||
reply.redirect(301, getRedirectUrl(req.raw.url))
|
||||
reply.redirect(getRedirectUrl(req.raw.url), 301)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
const indexes = opts.index === undefined ? ['index.html'] : [].concat(opts.index)
|
||||
const indexes = new Set(opts.index === undefined ? ['index.html'] : [].concat(opts.index))
|
||||
const indexDirs = new Map()
|
||||
const routes = new Set()
|
||||
|
||||
@@ -134,7 +140,7 @@ async function fastifyStatic (fastify, opts) {
|
||||
rootPath = rootPath.split(path.win32.sep).join(path.posix.sep)
|
||||
!rootPath.endsWith('/') && (rootPath += '/')
|
||||
const files = await glob('**/**', {
|
||||
cwd: rootPath, absolute: false, follow: true, nodir: true, dot: opts.serveDotFiles
|
||||
cwd: rootPath, absolute: false, follow: true, nodir: true, dot: opts.serveDotFiles, ignore: opts.globIgnore
|
||||
})
|
||||
|
||||
for (let file of files) {
|
||||
@@ -150,7 +156,7 @@ async function fastifyStatic (fastify, opts) {
|
||||
setUpHeadAndGet(routeOpts, route, `/${file}`, rootPath)
|
||||
|
||||
const key = path.posix.basename(route)
|
||||
if (indexes.includes(key) && !indexDirs.has(key)) {
|
||||
if (indexes.has(key) && !indexDirs.has(key)) {
|
||||
indexDirs.set(path.posix.dirname(route), rootPath)
|
||||
}
|
||||
}
|
||||
@@ -170,7 +176,16 @@ async function fastifyStatic (fastify, opts) {
|
||||
|
||||
const allowedPath = opts.allowedPath
|
||||
|
||||
function pumpSendToReply (
|
||||
/**
|
||||
* @param {import("fastify").FastifyRequest} request
|
||||
* @param {import("fastify").FastifyReply} reply
|
||||
* @param {string} pathname
|
||||
* @param {import("./types").FastifyStaticOptions['root']} rootPath
|
||||
* @param {number} [rootPathOffset]
|
||||
* @param {import("@fastify/send").SendOptions} [pumpOptions]
|
||||
* @param {Set<string>} [checkedEncodings]
|
||||
*/
|
||||
async function pumpSendToReply (
|
||||
request,
|
||||
reply,
|
||||
pathname,
|
||||
@@ -188,6 +203,8 @@ async function fastifyStatic (fastify, opts) {
|
||||
} else {
|
||||
options.root = rootPath
|
||||
}
|
||||
} else if (path.isAbsolute(pathname) === false) {
|
||||
return reply.callNotFound()
|
||||
}
|
||||
|
||||
if (allowedPath && !allowedPath(pathname, options.root, request)) {
|
||||
@@ -202,9 +219,7 @@ async function fastifyStatic (fastify, opts) {
|
||||
* We conditionally create this structure to track our attempts
|
||||
* at sending pre-compressed assets
|
||||
*/
|
||||
if (!checkedEncodings) {
|
||||
checkedEncodings = new Set()
|
||||
}
|
||||
checkedEncodings ??= new Set()
|
||||
|
||||
encoding = getEncodingHeader(request.headers, checkedEncodings)
|
||||
|
||||
@@ -214,110 +229,45 @@ async function fastifyStatic (fastify, opts) {
|
||||
if (!pathname) {
|
||||
return reply.callNotFound()
|
||||
}
|
||||
pathnameForSend = pathnameForSend + pathname + '.' + getEncodingExtension(encoding)
|
||||
pathnameForSend = pathnameForSend + pathname + encodingExtensionMap[encoding]
|
||||
} else {
|
||||
pathnameForSend = pathname + '.' + getEncodingExtension(encoding)
|
||||
pathnameForSend = pathname + encodingExtensionMap[encoding]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// `send(..., path, ...)` will URI-decode path so we pass an encoded path here
|
||||
const stream = send(request.raw, encodeURI(pathnameForSend), options)
|
||||
let resolvedFilename
|
||||
stream.on('file', function (file) {
|
||||
resolvedFilename = file
|
||||
})
|
||||
|
||||
const wrap = new PassThrough({
|
||||
flush (cb) {
|
||||
this.finished = true
|
||||
if (reply.raw.statusCode === 304) {
|
||||
reply.send('')
|
||||
}
|
||||
cb()
|
||||
}
|
||||
})
|
||||
|
||||
wrap.getHeader = reply.getHeader.bind(reply)
|
||||
wrap.setHeader = reply.header.bind(reply)
|
||||
wrap.removeHeader = () => {}
|
||||
wrap.finished = false
|
||||
|
||||
Object.defineProperty(wrap, 'filename', {
|
||||
get () {
|
||||
return resolvedFilename
|
||||
}
|
||||
})
|
||||
Object.defineProperty(wrap, 'statusCode', {
|
||||
get () {
|
||||
return reply.raw.statusCode
|
||||
},
|
||||
set (code) {
|
||||
reply.code(code)
|
||||
}
|
||||
})
|
||||
|
||||
if (request.method === 'HEAD') {
|
||||
wrap.on('finish', reply.send.bind(reply))
|
||||
} else {
|
||||
wrap.on('pipe', function () {
|
||||
if (encoding) {
|
||||
reply.header('content-type', getContentType(pathname))
|
||||
reply.header('content-encoding', encoding)
|
||||
}
|
||||
reply.send(wrap)
|
||||
})
|
||||
}
|
||||
|
||||
if (setHeaders !== undefined) {
|
||||
stream.on('headers', setHeaders)
|
||||
}
|
||||
|
||||
stream.on('directory', function (_, path) {
|
||||
if (opts.list) {
|
||||
dirList.send({
|
||||
reply,
|
||||
dir: path,
|
||||
options: opts.list,
|
||||
route: pathname,
|
||||
prefix,
|
||||
dotfiles: opts.dotfiles
|
||||
}).catch((err) => reply.send(err))
|
||||
return
|
||||
}
|
||||
|
||||
if (opts.redirect === true) {
|
||||
try {
|
||||
reply.redirect(301, getRedirectUrl(request.raw.url))
|
||||
} catch (error) {
|
||||
// the try-catch here is actually unreachable, but we keep it for safety and prevent DoS attack
|
||||
/* istanbul ignore next */
|
||||
reply.send(error)
|
||||
}
|
||||
} else {
|
||||
// if is a directory path without a trailing slash, and has an index file, reply as if it has a trailing slash
|
||||
if (!pathname.endsWith('/') && findIndexFile(pathname, options.root, options.index)) {
|
||||
return pumpSendToReply(
|
||||
request,
|
||||
const {
|
||||
statusCode,
|
||||
headers,
|
||||
stream,
|
||||
type,
|
||||
metadata
|
||||
} = await send(request.raw, encodeURI(pathnameForSend), options)
|
||||
switch (type) {
|
||||
case 'directory': {
|
||||
const path = metadata.path
|
||||
if (opts.list) {
|
||||
await dirList.send({
|
||||
reply,
|
||||
pathname + '/',
|
||||
rootPath,
|
||||
undefined,
|
||||
undefined,
|
||||
checkedEncodings
|
||||
)
|
||||
dir: path,
|
||||
options: opts.list,
|
||||
route: pathname,
|
||||
prefix,
|
||||
dotfiles: opts.dotfiles
|
||||
}).catch((err) => reply.send(err))
|
||||
}
|
||||
|
||||
reply.callNotFound()
|
||||
}
|
||||
})
|
||||
|
||||
stream.on('error', function (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
// when preCompress is enabled and the path is a directory without a trailing slash
|
||||
if (opts.preCompressed && encoding) {
|
||||
const indexPathname = findIndexFile(pathname, options.root, options.index)
|
||||
if (indexPathname) {
|
||||
if (opts.redirect === true) {
|
||||
try {
|
||||
reply.redirect(getRedirectUrl(request.raw.url), 301)
|
||||
} /* c8 ignore start */ catch (error) {
|
||||
// the try-catch here is actually unreachable, but we keep it for safety and prevent DoS attack
|
||||
await reply.send(error)
|
||||
} /* c8 ignore stop */
|
||||
} else {
|
||||
// if is a directory path without a trailing slash, and has an index file, reply as if it has a trailing slash
|
||||
if (!pathname.endsWith('/') && findIndexFile(pathname, options.root, options.index)) {
|
||||
return pumpSendToReply(
|
||||
request,
|
||||
reply,
|
||||
@@ -328,58 +278,112 @@ async function fastifyStatic (fastify, opts) {
|
||||
checkedEncodings
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// if file exists, send real file, otherwise send dir list if name match
|
||||
if (opts.list && dirList.handle(pathname, opts.list)) {
|
||||
dirList.send({
|
||||
reply,
|
||||
dir: dirList.path(opts.root, pathname),
|
||||
options: opts.list,
|
||||
route: pathname,
|
||||
prefix,
|
||||
dotfiles: opts.dotfiles
|
||||
}).catch((err) => reply.send(err))
|
||||
return
|
||||
reply.callNotFound()
|
||||
}
|
||||
|
||||
// root paths left to try?
|
||||
if (Array.isArray(rootPath) && rootPathOffset < (rootPath.length - 1)) {
|
||||
return pumpSendToReply(request, reply, pathname, rootPath, rootPathOffset + 1)
|
||||
}
|
||||
|
||||
if (opts.preCompressed && !checkedEncodings.has(encoding)) {
|
||||
checkedEncodings.add(encoding)
|
||||
return pumpSendToReply(
|
||||
request,
|
||||
reply,
|
||||
pathnameOrig,
|
||||
rootPath,
|
||||
rootPathOffset,
|
||||
undefined,
|
||||
checkedEncodings
|
||||
)
|
||||
}
|
||||
|
||||
return reply.callNotFound()
|
||||
break
|
||||
}
|
||||
case 'error': {
|
||||
if (
|
||||
statusCode === 403 &&
|
||||
(!options.index || !options.index.length) &&
|
||||
pathnameForSend[pathnameForSend.length - 1] === '/'
|
||||
) {
|
||||
if (opts.list) {
|
||||
await dirList.send({
|
||||
reply,
|
||||
dir: dirList.path(opts.root, pathname),
|
||||
options: opts.list,
|
||||
route: pathname,
|
||||
prefix,
|
||||
dotfiles: opts.dotfiles
|
||||
}).catch((err) => reply.send(err))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// The `send` library terminates the request with a 404 if the requested
|
||||
// path contains a dotfile and `send` is initialized with `{dotfiles:
|
||||
// 'ignore'}`. `send` aborts the request before getting far enough to
|
||||
// check if the file exists (hence, a 404 `NotFoundError` instead of
|
||||
// `ENOENT`).
|
||||
// https://github.com/pillarjs/send/blob/de073ed3237ade9ff71c61673a34474b30e5d45b/index.js#L582
|
||||
if (err.status === 404) {
|
||||
return reply.callNotFound()
|
||||
if (metadata.error.code === 'ENOENT') {
|
||||
// when preCompress is enabled and the path is a directory without a trailing slash
|
||||
if (opts.preCompressed && encoding) {
|
||||
if (opts.redirect !== true) {
|
||||
const indexPathname = findIndexFile(pathname, options.root, options.index)
|
||||
if (indexPathname) {
|
||||
return pumpSendToReply(
|
||||
request,
|
||||
reply,
|
||||
pathname + '/',
|
||||
rootPath,
|
||||
undefined,
|
||||
undefined,
|
||||
checkedEncodings
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if file exists, send real file, otherwise send dir list if name match
|
||||
if (opts.list && dirList.handle(pathname, opts.list)) {
|
||||
await dirList.send({
|
||||
reply,
|
||||
dir: dirList.path(opts.root, pathname),
|
||||
options: opts.list,
|
||||
route: pathname,
|
||||
prefix,
|
||||
dotfiles: opts.dotfiles
|
||||
}).catch((err) => reply.send(err))
|
||||
return
|
||||
}
|
||||
|
||||
// root paths left to try?
|
||||
if (Array.isArray(rootPath) && rootPathOffset < (rootPath.length - 1)) {
|
||||
return pumpSendToReply(request, reply, pathname, rootPath, rootPathOffset + 1)
|
||||
}
|
||||
|
||||
if (opts.preCompressed && !checkedEncodings.has(encoding)) {
|
||||
checkedEncodings.add(encoding)
|
||||
return pumpSendToReply(
|
||||
request,
|
||||
reply,
|
||||
pathnameOrig,
|
||||
rootPath,
|
||||
rootPathOffset,
|
||||
undefined,
|
||||
checkedEncodings
|
||||
)
|
||||
}
|
||||
|
||||
return reply.callNotFound()
|
||||
}
|
||||
|
||||
// The `send` library terminates the request with a 404 if the requested
|
||||
// path contains a dotfile and `send` is initialized with `{dotfiles:
|
||||
// 'ignore'}`. `send` aborts the request before getting far enough to
|
||||
// check if the file exists (hence, a 404 `NotFoundError` instead of
|
||||
// `ENOENT`).
|
||||
// https://github.com/pillarjs/send/blob/de073ed3237ade9ff71c61673a34474b30e5d45b/index.js#L582
|
||||
if (metadata.error.status === 404) {
|
||||
return reply.callNotFound()
|
||||
}
|
||||
|
||||
await reply.send(metadata.error)
|
||||
break
|
||||
}
|
||||
|
||||
reply.send(err)
|
||||
})
|
||||
|
||||
// we cannot use pump, because send error
|
||||
// handling is not compatible
|
||||
stream.pipe(wrap)
|
||||
case 'file': {
|
||||
// reply.raw.statusCode by default 200
|
||||
// when ever the user changed it, we respect the status code
|
||||
// otherwise use send provided status code
|
||||
const newStatusCode = reply.statusCode !== 200 ? reply.statusCode : statusCode
|
||||
reply.code(newStatusCode)
|
||||
setHeaders?.(reply.raw, metadata.path, metadata.stat)
|
||||
reply.headers(headers)
|
||||
if (encoding) {
|
||||
reply.header('content-type', getContentType(pathname))
|
||||
reply.header('content-encoding', encoding)
|
||||
}
|
||||
await reply.send(stream)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setUpHeadAndGet (routeOpts, route, file, rootPath) {
|
||||
@@ -388,20 +392,23 @@ async function fastifyStatic (fastify, opts) {
|
||||
url: route,
|
||||
handler: serveFileHandler
|
||||
})
|
||||
toSetUp.config = toSetUp.config || {}
|
||||
toSetUp.config ??= {}
|
||||
toSetUp.config.file = file
|
||||
toSetUp.config.rootPath = rootPath
|
||||
fastify.route(toSetUp)
|
||||
}
|
||||
|
||||
function serveFileHandler (req, reply) {
|
||||
// TODO: remove the fallback branch when bump major
|
||||
/* istanbul ignore next */
|
||||
const routeConfig = req.routeOptions?.config || req.routeConfig
|
||||
pumpSendToReply(req, reply, routeConfig.file, routeConfig.rootPath)
|
||||
/** @type {import("fastify").RouteHandlerMethod} */
|
||||
async function serveFileHandler (req, reply) {
|
||||
const routeConfig = req.routeOptions?.config
|
||||
return pumpSendToReply(req, reply, routeConfig.file, routeConfig.rootPath)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("./types").FastifyStaticOptions['root']} root
|
||||
* @returns {import("./types").FastifyStaticOptions['root']}
|
||||
*/
|
||||
function normalizeRoot (root) {
|
||||
if (root === undefined) {
|
||||
return root
|
||||
@@ -425,6 +432,11 @@ function normalizeRoot (root) {
|
||||
return root
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("fastify").FastifyInstance} fastify
|
||||
* @param {import("./types").FastifyStaticOptions['root']} rootPath
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkRootPathForErrors (fastify, rootPath) {
|
||||
if (rootPath === undefined) {
|
||||
throw new Error('"root" option is required')
|
||||
@@ -453,9 +465,14 @@ function checkRootPathForErrors (fastify, rootPath) {
|
||||
throw new Error('"root" option must be a string or array of strings')
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("fastify").FastifyInstance} fastify
|
||||
* @param {import("./types").FastifyStaticOptions['root']} rootPath
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkPath (fastify, rootPath) {
|
||||
if (typeof rootPath !== 'string') {
|
||||
throw new Error('"root" option must be a string')
|
||||
throw new TypeError('"root" option must be a string')
|
||||
}
|
||||
if (path.isAbsolute(rootPath) === false) {
|
||||
throw new Error('"root" option must be an absolute path')
|
||||
@@ -479,18 +496,26 @@ function checkPath (fastify, rootPath) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} path
|
||||
* @return {string}
|
||||
*/
|
||||
function getContentType (path) {
|
||||
const type = send.mime.getType(path) || send.mime.default_type
|
||||
|
||||
if (!send.isUtf8MimeType(type)) {
|
||||
return type
|
||||
}
|
||||
return `${type}; charset=UTF-8`
|
||||
return `${type}; charset=utf-8`
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} pathname
|
||||
* @param {*} root
|
||||
* @param {import("./types").FastifyStaticOptions['index']} [indexFiles]
|
||||
* @return {string|boolean}
|
||||
*/
|
||||
function findIndexFile (pathname, root, indexFiles = ['index.html']) {
|
||||
// TODO remove istanbul ignore
|
||||
/* istanbul ignore else */
|
||||
if (Array.isArray(indexFiles)) {
|
||||
return indexFiles.find(filename => {
|
||||
const p = path.join(root, pathname, filename)
|
||||
@@ -502,11 +527,15 @@ function findIndexFile (pathname, root, indexFiles = ['index.html']) {
|
||||
}
|
||||
})
|
||||
}
|
||||
/* istanbul ignore next */
|
||||
/* c8 ignore next */
|
||||
return false
|
||||
}
|
||||
|
||||
// Adapted from https://github.com/fastify/fastify-compress/blob/665e132fa63d3bf05ad37df3c20346660b71a857/index.js#L451
|
||||
/**
|
||||
* Adapted from https://github.com/fastify/fastify-compress/blob/665e132fa63d3bf05ad37df3c20346660b71a857/index.js#L451
|
||||
* @param {import('fastify').FastifyRequest['headers']} headers
|
||||
* @param {Set<string>} checked
|
||||
*/
|
||||
function getEncodingHeader (headers, checked) {
|
||||
if (!('accept-encoding' in headers)) return
|
||||
|
||||
@@ -519,41 +548,32 @@ function getEncodingHeader (headers, checked) {
|
||||
)
|
||||
}
|
||||
|
||||
function getEncodingExtension (encoding) {
|
||||
switch (encoding) {
|
||||
case 'br':
|
||||
return 'br'
|
||||
|
||||
case 'gzip':
|
||||
return 'gz'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @return {string}
|
||||
*/
|
||||
function getRedirectUrl (url) {
|
||||
let i = 0
|
||||
// we detect how many slash before a valid path
|
||||
for (; i < url.length; ++i) {
|
||||
for (const ul = url.length; i < ul; ++i) {
|
||||
if (url[i] !== '/' && url[i] !== '\\') break
|
||||
}
|
||||
// turns all leading / or \ into a single /
|
||||
url = '/' + url.substr(i)
|
||||
url = '/' + url.slice(i)
|
||||
try {
|
||||
const parsed = new URL(url, 'http://localhost.com/')
|
||||
const parsedPathname = parsed.pathname
|
||||
return parsedPathname + (parsedPathname[parsedPathname.length - 1] !== '/' ? '/' : '') + (parsed.search || '')
|
||||
} catch {
|
||||
} /* c8 ignore start */ catch {
|
||||
// the try-catch here is actually unreachable, but we keep it for safety and prevent DoS attack
|
||||
/* istanbul ignore next */
|
||||
const err = new Error(`Invalid redirect URL: ${url}`)
|
||||
/* istanbul ignore next */
|
||||
err.statusCode = 400
|
||||
/* istanbul ignore next */
|
||||
throw err
|
||||
}
|
||||
} /* c8 ignore stop */
|
||||
}
|
||||
|
||||
module.exports = fp(fastifyStatic, {
|
||||
fastify: '4.x',
|
||||
fastify: '5.x',
|
||||
name: '@fastify/static'
|
||||
})
|
||||
module.exports.default = fastifyStatic
|
||||
|
||||
8
backend/node_modules/@fastify/static/lib/dirList.js
generated
vendored
8
backend/node_modules/@fastify/static/lib/dirList.js
generated
vendored
@@ -108,7 +108,7 @@ const dirList = {
|
||||
*/
|
||||
send: async function ({ reply, dir, options, route, prefix, dotfiles }) {
|
||||
if (reply.request.query.format === 'html' && typeof options.render !== 'function') {
|
||||
throw new Error('The `list.render` option must be a function and is required with the URL parameter `format=html`')
|
||||
throw new TypeError('The `list.render` option must be a function and is required with the URL parameter `format=html`')
|
||||
}
|
||||
|
||||
let entries
|
||||
@@ -125,9 +125,9 @@ const dirList = {
|
||||
entries.dirs.forEach(entry => nameEntries.dirs.push(entry.name))
|
||||
entries.files.forEach(entry => nameEntries.files.push(entry.name))
|
||||
|
||||
reply.send(nameEntries)
|
||||
await reply.send(nameEntries)
|
||||
} else {
|
||||
reply.send(entries)
|
||||
await reply.send(entries)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -135,7 +135,7 @@ const dirList = {
|
||||
const html = options.render(
|
||||
entries.dirs.map(entry => dirList.htmlInfo(entry, route, prefix, options)),
|
||||
entries.files.map(entry => dirList.htmlInfo(entry, route, prefix, options)))
|
||||
reply.type('text/html').send(html)
|
||||
await reply.type('text/html').send(html)
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
63
backend/node_modules/@fastify/static/node_modules/glob/LICENSE.md
generated
vendored
Normal file
63
backend/node_modules/@fastify/static/node_modules/glob/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
All packages under `src/` are licensed according to the terms in
|
||||
their respective `LICENSE` or `LICENSE.md` files.
|
||||
|
||||
The remainder of this project is licensed under the Blue Oak
|
||||
Model License, as follows:
|
||||
|
||||
-----
|
||||
|
||||
# Blue Oak Model License
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
## Purpose
|
||||
|
||||
This license gives everyone as much permission to work with
|
||||
this software as possible, while protecting contributors
|
||||
from liability.
|
||||
|
||||
## Acceptance
|
||||
|
||||
In order to receive this license, you must agree to its
|
||||
rules. The rules of this license are both obligations
|
||||
under that agreement and conditions to your license.
|
||||
You must not do anything with this software that triggers
|
||||
a rule that you cannot or will not follow.
|
||||
|
||||
## Copyright
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe that contributor's
|
||||
copyright in it.
|
||||
|
||||
## Notices
|
||||
|
||||
You must ensure that everyone who gets a copy of
|
||||
any part of this software from you, with or without
|
||||
changes, also gets the text of this license or a link to
|
||||
<https://blueoakcouncil.org/license/1.0.0>.
|
||||
|
||||
## Excuse
|
||||
|
||||
If anyone notifies you in writing that you have not
|
||||
complied with [Notices](#notices), you can keep your
|
||||
license by taking all practical steps to comply within 30
|
||||
days after the notice. If you do not do so, your license
|
||||
ends immediately.
|
||||
|
||||
## Patent
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe any patent claims
|
||||
they can license or become able to license.
|
||||
|
||||
## Reliability
|
||||
|
||||
No contributor can revoke this license.
|
||||
|
||||
## No Liability
|
||||
|
||||
***As far as the law allows, this software comes as is,
|
||||
without any warranty or condition, and no contributor
|
||||
will be liable to anyone for any damages related to this
|
||||
software or this license, under any kind of legal claim.***
|
||||
1177
backend/node_modules/@fastify/static/node_modules/glob/README.md
generated
vendored
Normal file
1177
backend/node_modules/@fastify/static/node_modules/glob/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
388
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.d.ts
generated
vendored
Normal file
388
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.d.ts
generated
vendored
Normal file
@@ -0,0 +1,388 @@
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Minipass } from 'minipass';
|
||||
import { FSOption, Path, PathScurry } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
export type MatchSet = Minimatch['set'];
|
||||
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
|
||||
/**
|
||||
* A `GlobOptions` object may be provided to any of the exported methods, and
|
||||
* must be provided to the `Glob` constructor.
|
||||
*
|
||||
* All options are optional, boolean, and false by default, unless otherwise
|
||||
* noted.
|
||||
*
|
||||
* All resolved options are added to the Glob object as properties.
|
||||
*
|
||||
* If you are running many `glob` operations, you can pass a Glob object as the
|
||||
* `options` argument to a subsequent operation to share the previously loaded
|
||||
* cache.
|
||||
*/
|
||||
export interface GlobOptions {
|
||||
/**
|
||||
* Set to `true` to always receive absolute paths for
|
||||
* matched files. Set to `false` to always return relative paths.
|
||||
*
|
||||
* When this option is not set, absolute paths are returned for patterns
|
||||
* that are absolute, and otherwise paths are returned that are relative
|
||||
* to the `cwd` setting.
|
||||
*
|
||||
* This does _not_ make an extra system call to get
|
||||
* the realpath, it only does string path resolution.
|
||||
*
|
||||
* Conflicts with {@link withFileTypes}
|
||||
*/
|
||||
absolute?: boolean;
|
||||
/**
|
||||
* Set to false to enable {@link windowsPathsNoEscape}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
allowWindowsEscape?: boolean;
|
||||
/**
|
||||
* The current working directory in which to search. Defaults to
|
||||
* `process.cwd()`.
|
||||
*
|
||||
* May be eiher a string path or a `file://` URL object or string.
|
||||
*/
|
||||
cwd?: string | URL;
|
||||
/**
|
||||
* Include `.dot` files in normal matches and `globstar`
|
||||
* matches. Note that an explicit dot in a portion of the pattern
|
||||
* will always match dot files.
|
||||
*/
|
||||
dot?: boolean;
|
||||
/**
|
||||
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
||||
*
|
||||
* Without this option, returned relative paths are "bare", so instead of
|
||||
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
||||
*
|
||||
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
||||
* if this option is set.
|
||||
*/
|
||||
dotRelative?: boolean;
|
||||
/**
|
||||
* Follow symlinked directories when expanding `**`
|
||||
* patterns. This can result in a lot of duplicate references in
|
||||
* the presence of cyclic links, and make performance quite bad.
|
||||
*
|
||||
* By default, a `**` in a pattern will follow 1 symbolic link if
|
||||
* it is not the first item in the pattern, or none if it is the
|
||||
* first item in the pattern, following the same behavior as Bash.
|
||||
*/
|
||||
follow?: boolean;
|
||||
/**
|
||||
* string or string[], or an object with `ignored` and `childrenIgnored`
|
||||
* methods.
|
||||
*
|
||||
* If a string or string[] is provided, then this is treated as a glob
|
||||
* pattern or array of glob patterns to exclude from matches. To ignore all
|
||||
* children within a directory, as well as the entry itself, append `'/**'`
|
||||
* to the ignore pattern.
|
||||
*
|
||||
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
||||
* any other settings.
|
||||
*
|
||||
* If an object is provided that has `ignored(path)` and/or
|
||||
* `childrenIgnored(path)` methods, then these methods will be called to
|
||||
* determine whether any Path is a match or if its children should be
|
||||
* traversed, respectively.
|
||||
*/
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
/**
|
||||
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
||||
* effect if {@link nobrace} is set.
|
||||
*
|
||||
* Only has effect on the {@link hasMagic} function.
|
||||
*/
|
||||
magicalBraces?: boolean;
|
||||
/**
|
||||
* Add a `/` character to directory matches. Note that this requires
|
||||
* additional stat calls in some cases.
|
||||
*/
|
||||
mark?: boolean;
|
||||
/**
|
||||
* Perform a basename-only match if the pattern does not contain any slash
|
||||
* characters. That is, `*.js` would be treated as equivalent to
|
||||
* `**\/*.js`, matching all js files in all directories.
|
||||
*/
|
||||
matchBase?: boolean;
|
||||
/**
|
||||
* Limit the directory traversal to a given depth below the cwd.
|
||||
* Note that this does NOT prevent traversal to sibling folders,
|
||||
* root patterns, and so on. It only limits the maximum folder depth
|
||||
* that the walk will descend, relative to the cwd.
|
||||
*/
|
||||
maxDepth?: number;
|
||||
/**
|
||||
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
*/
|
||||
nobrace?: boolean;
|
||||
/**
|
||||
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
||||
* Windows systems, and `false` on all others.
|
||||
*
|
||||
* **Note** `nocase` should only be explicitly set when it is
|
||||
* known that the filesystem's case sensitivity differs from the
|
||||
* platform default. If set `true` on case-sensitive file
|
||||
* systems, or `false` on case-insensitive file systems, then the
|
||||
* walk may return more or less results than expected.
|
||||
*/
|
||||
nocase?: boolean;
|
||||
/**
|
||||
* Do not match directories, only files. (Note: to match
|
||||
* _only_ directories, put a `/` at the end of the pattern.)
|
||||
*/
|
||||
nodir?: boolean;
|
||||
/**
|
||||
* Do not match "extglob" patterns such as `+(a|b)`.
|
||||
*/
|
||||
noext?: boolean;
|
||||
/**
|
||||
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
||||
* `*` instead.)
|
||||
*
|
||||
* Conflicts with {@link matchBase}
|
||||
*/
|
||||
noglobstar?: boolean;
|
||||
/**
|
||||
* Defaults to value of `process.platform` if available, or `'linux'` if
|
||||
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
||||
* behavior.
|
||||
*/
|
||||
platform?: NodeJS.Platform;
|
||||
/**
|
||||
* Set to true to call `fs.realpath` on all of the
|
||||
* results. In the case of an entry that cannot be resolved, the
|
||||
* entry is omitted. This incurs a slight performance penalty, of
|
||||
* course, because of the added system calls.
|
||||
*/
|
||||
realpath?: boolean;
|
||||
/**
|
||||
*
|
||||
* A string path resolved against the `cwd` option, which
|
||||
* is used as the starting point for absolute patterns that start
|
||||
* with `/`, (but not drive letters or UNC paths on Windows).
|
||||
*
|
||||
* Note that this _doesn't_ necessarily limit the walk to the
|
||||
* `root` directory, and doesn't affect the cwd starting point for
|
||||
* non-absolute patterns. A pattern containing `..` will still be
|
||||
* able to traverse out of the root directory, if it is not an
|
||||
* actual root directory on the filesystem, and any non-absolute
|
||||
* patterns will be matched in the `cwd`. For example, the
|
||||
* pattern `/../*` with `{root:'/some/path'}` will return all
|
||||
* files in `/some`, not all files in `/some/path`. The pattern
|
||||
* `*` with `{root:'/some/path'}` will return all the entries in
|
||||
* the cwd, not the entries in `/some/path`.
|
||||
*
|
||||
* To start absolute and non-absolute patterns in the same
|
||||
* path, you can use `{root:''}`. However, be aware that on
|
||||
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
||||
* _always_ start in the `x:/` or `//host/share` directory,
|
||||
* regardless of the `root` setting.
|
||||
*/
|
||||
root?: string;
|
||||
/**
|
||||
* A [PathScurry](http://npm.im/path-scurry) object used
|
||||
* to traverse the file system. If the `nocase` option is set
|
||||
* explicitly, then any provided `scurry` object must match this
|
||||
* setting.
|
||||
*/
|
||||
scurry?: PathScurry;
|
||||
/**
|
||||
* Call `lstat()` on all entries, whether required or not to determine
|
||||
* if it's a valid match. When used with {@link withFileTypes}, this means
|
||||
* that matches will include data such as modified time, permissions, and
|
||||
* so on. Note that this will incur a performance cost due to the added
|
||||
* system calls.
|
||||
*/
|
||||
stat?: boolean;
|
||||
/**
|
||||
* An AbortSignal which will cancel the Glob walk when
|
||||
* triggered.
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* Use `\\` as a path separator _only_, and
|
||||
* _never_ as an escape character. If set, all `\\` characters are
|
||||
* replaced with `/` in the pattern.
|
||||
*
|
||||
* Note that this makes it **impossible** to match against paths
|
||||
* containing literal glob pattern characters, but allows matching
|
||||
* with patterns constructed using `path.join()` and
|
||||
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
* behavior of Glob v7 and before on Windows. Please use with
|
||||
* caution, and be mindful of [the caveat below about Windows
|
||||
* paths](#windows). (For legacy reasons, this is also set if
|
||||
* `allowWindowsEscape` is set to the exact value `false`.)
|
||||
*/
|
||||
windowsPathsNoEscape?: boolean;
|
||||
/**
|
||||
* Return [PathScurry](http://npm.im/path-scurry)
|
||||
* `Path` objects instead of strings. These are similar to a
|
||||
* NodeJS `Dirent` object, but with additional methods and
|
||||
* properties.
|
||||
*
|
||||
* Conflicts with {@link absolute}
|
||||
*/
|
||||
withFileTypes?: boolean;
|
||||
/**
|
||||
* An fs implementation to override some or all of the defaults. See
|
||||
* http://npm.im/path-scurry for details about what can be overridden.
|
||||
*/
|
||||
fs?: FSOption;
|
||||
/**
|
||||
* Just passed along to Minimatch. Note that this makes all pattern
|
||||
* matching operations slower and *extremely* noisy.
|
||||
*/
|
||||
debug?: boolean;
|
||||
/**
|
||||
* Return `/` delimited paths, even on Windows.
|
||||
*
|
||||
* On posix systems, this has no effect. But, on Windows, it means that
|
||||
* paths will be `/` delimited, and absolute paths will be their full
|
||||
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
||||
* `'//?/C:/foo/bar'`
|
||||
*/
|
||||
posix?: boolean;
|
||||
/**
|
||||
* Do not match any children of any matches. For example, the pattern
|
||||
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
||||
*
|
||||
* This is especially useful for cases like "find all `node_modules`
|
||||
* folders, but not the ones in `node_modules`".
|
||||
*
|
||||
* In order to support this, the `Ignore` implementation must support an
|
||||
* `add(pattern: string)` method. If using the default `Ignore` class, then
|
||||
* this is fine, but if this is set to `false`, and a custom `Ignore` is
|
||||
* provided that does not have an `add()` method, then it will throw an
|
||||
* error.
|
||||
*
|
||||
* **Caveat** It *only* ignores matches that would be a descendant of a
|
||||
* previous match, and only if that descendant is matched *after* the
|
||||
* ancestor is encountered. Since the file system walk happens in
|
||||
* indeterminate order, it's possible that a match will already be added
|
||||
* before its ancestor, if multiple or braced patterns are used.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* ```ts
|
||||
* const results = await glob([
|
||||
* // likely to match first, since it's just a stat
|
||||
* 'a/b/c/d/e/f',
|
||||
*
|
||||
* // this pattern is more complicated! It must to various readdir()
|
||||
* // calls and test the results against a regular expression, and that
|
||||
* // is certainly going to take a little bit longer.
|
||||
* //
|
||||
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
||||
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
|
||||
* 'a/[bdf]/?/[a-z]/*',
|
||||
* ], { includeChildMatches: false })
|
||||
* ```
|
||||
*
|
||||
* It's best to only set this to `false` if you can be reasonably sure that
|
||||
* no components of the pattern will potentially match one another's file
|
||||
* system descendants, or if the occasional included child entry will not
|
||||
* cause problems.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
includeChildMatches?: boolean;
|
||||
}
|
||||
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
||||
withFileTypes: true;
|
||||
absolute?: undefined;
|
||||
mark?: undefined;
|
||||
posix?: undefined;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
||||
withFileTypes?: false;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
||||
export type Results<Opts> = Result<Opts>[];
|
||||
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
||||
absolute?: boolean;
|
||||
cwd: string;
|
||||
root?: string;
|
||||
dot: boolean;
|
||||
dotRelative: boolean;
|
||||
follow: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
magicalBraces: boolean;
|
||||
mark?: boolean;
|
||||
matchBase: boolean;
|
||||
maxDepth: number;
|
||||
nobrace: boolean;
|
||||
nocase: boolean;
|
||||
nodir: boolean;
|
||||
noext: boolean;
|
||||
noglobstar: boolean;
|
||||
pattern: string[];
|
||||
platform: NodeJS.Platform;
|
||||
realpath: boolean;
|
||||
scurry: PathScurry;
|
||||
stat: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape: boolean;
|
||||
withFileTypes: FileTypes<Opts>;
|
||||
includeChildMatches: boolean;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts: Opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns: Pattern[];
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern: string | string[], opts: Opts);
|
||||
/**
|
||||
* Returns a Promise that resolves to the results array.
|
||||
*/
|
||||
walk(): Promise<Results<Opts>>;
|
||||
/**
|
||||
* synchronous {@link Glob.walk}
|
||||
*/
|
||||
walkSync(): Results<Opts>;
|
||||
/**
|
||||
* Stream results asynchronously.
|
||||
*/
|
||||
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Stream results synchronously.
|
||||
*/
|
||||
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync(): Generator<Result<Opts>, void, void>;
|
||||
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
||||
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
||||
}
|
||||
//# sourceMappingURL=glob.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,O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AAE,CAAA;IAEnB;;;;;;;;;;;OAWG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI;IA2HlD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAoBpC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBzB;;OAEG;IACH,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}
|
||||
247
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.js
generated
vendored
Normal file
247
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.js
generated
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Glob = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const node_url_1 = require("node:url");
|
||||
const path_scurry_1 = require("path-scurry");
|
||||
const pattern_js_1 = require("./pattern.js");
|
||||
const walker_js_1 = require("./walker.js");
|
||||
// if no process global, just call it linux.
|
||||
// so we default to case-sensitive, / separators
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
class Glob {
|
||||
absolute;
|
||||
cwd;
|
||||
root;
|
||||
dot;
|
||||
dotRelative;
|
||||
follow;
|
||||
ignore;
|
||||
magicalBraces;
|
||||
mark;
|
||||
matchBase;
|
||||
maxDepth;
|
||||
nobrace;
|
||||
nocase;
|
||||
nodir;
|
||||
noext;
|
||||
noglobstar;
|
||||
pattern;
|
||||
platform;
|
||||
realpath;
|
||||
scurry;
|
||||
stat;
|
||||
signal;
|
||||
windowsPathsNoEscape;
|
||||
withFileTypes;
|
||||
includeChildMatches;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns;
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern, opts) {
|
||||
/* c8 ignore start */
|
||||
if (!opts)
|
||||
throw new TypeError('glob options required');
|
||||
/* c8 ignore stop */
|
||||
this.withFileTypes = !!opts.withFileTypes;
|
||||
this.signal = opts.signal;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.dotRelative = !!opts.dotRelative;
|
||||
this.nodir = !!opts.nodir;
|
||||
this.mark = !!opts.mark;
|
||||
if (!opts.cwd) {
|
||||
this.cwd = '';
|
||||
}
|
||||
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
||||
opts.cwd = (0, node_url_1.fileURLToPath)(opts.cwd);
|
||||
}
|
||||
this.cwd = opts.cwd || '';
|
||||
this.root = opts.root;
|
||||
this.magicalBraces = !!opts.magicalBraces;
|
||||
this.nobrace = !!opts.nobrace;
|
||||
this.noext = !!opts.noext;
|
||||
this.realpath = !!opts.realpath;
|
||||
this.absolute = opts.absolute;
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
this.noglobstar = !!opts.noglobstar;
|
||||
this.matchBase = !!opts.matchBase;
|
||||
this.maxDepth =
|
||||
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
|
||||
this.stat = !!opts.stat;
|
||||
this.ignore = opts.ignore;
|
||||
if (this.withFileTypes && this.absolute !== undefined) {
|
||||
throw new Error('cannot set absolute and withFileTypes:true');
|
||||
}
|
||||
if (typeof pattern === 'string') {
|
||||
pattern = [pattern];
|
||||
}
|
||||
this.windowsPathsNoEscape =
|
||||
!!opts.windowsPathsNoEscape ||
|
||||
opts.allowWindowsEscape ===
|
||||
false;
|
||||
if (this.windowsPathsNoEscape) {
|
||||
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
||||
}
|
||||
if (this.matchBase) {
|
||||
if (opts.noglobstar) {
|
||||
throw new TypeError('base matching requires globstar');
|
||||
}
|
||||
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
|
||||
}
|
||||
this.pattern = pattern;
|
||||
this.platform = opts.platform || defaultPlatform;
|
||||
this.opts = { ...opts, platform: this.platform };
|
||||
if (opts.scurry) {
|
||||
this.scurry = opts.scurry;
|
||||
if (opts.nocase !== undefined &&
|
||||
opts.nocase !== opts.scurry.nocase) {
|
||||
throw new Error('nocase option contradicts provided scurry option');
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32
|
||||
: opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin
|
||||
: opts.platform ? path_scurry_1.PathScurryPosix
|
||||
: path_scurry_1.PathScurry;
|
||||
this.scurry = new Scurry(this.cwd, {
|
||||
nocase: opts.nocase,
|
||||
fs: opts.fs,
|
||||
});
|
||||
}
|
||||
this.nocase = this.scurry.nocase;
|
||||
// If you do nocase:true on a case-sensitive file system, then
|
||||
// we need to use regexps instead of strings for non-magic
|
||||
// path portions, because statting `aBc` won't return results
|
||||
// for the file `AbC` for example.
|
||||
const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
|
||||
const mmo = {
|
||||
// default nocase based on platform
|
||||
...opts,
|
||||
dot: this.dot,
|
||||
matchBase: this.matchBase,
|
||||
nobrace: this.nobrace,
|
||||
nocase: this.nocase,
|
||||
nocaseMagicOnly,
|
||||
nocomment: true,
|
||||
noext: this.noext,
|
||||
nonegate: true,
|
||||
optimizationLevel: 2,
|
||||
platform: this.platform,
|
||||
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
||||
debug: !!this.opts.debug,
|
||||
};
|
||||
const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo));
|
||||
const [matchSet, globParts] = mms.reduce((set, m) => {
|
||||
set[0].push(...m.set);
|
||||
set[1].push(...m.globParts);
|
||||
return set;
|
||||
}, [[], []]);
|
||||
this.patterns = matchSet.map((set, i) => {
|
||||
const g = globParts[i];
|
||||
/* c8 ignore start */
|
||||
if (!g)
|
||||
throw new Error('invalid pattern object');
|
||||
/* c8 ignore stop */
|
||||
return new pattern_js_1.Pattern(set, g, 0, this.platform);
|
||||
});
|
||||
}
|
||||
async walk() {
|
||||
// Walkers always return array of Path objects, so we just have to
|
||||
// coerce them into the right shape. It will have already called
|
||||
// realpath() if the option was set to do so, so we know that's cached.
|
||||
// start out knowing the cwd, at least
|
||||
return [
|
||||
...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walk()),
|
||||
];
|
||||
}
|
||||
walkSync() {
|
||||
return [
|
||||
...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walkSync(),
|
||||
];
|
||||
}
|
||||
stream() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).stream();
|
||||
}
|
||||
streamSync() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).streamSync();
|
||||
}
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync() {
|
||||
return this.streamSync()[Symbol.iterator]();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.iterateSync();
|
||||
}
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate() {
|
||||
return this.stream()[Symbol.asyncIterator]();
|
||||
}
|
||||
[Symbol.asyncIterator]() {
|
||||
return this.iterate();
|
||||
}
|
||||
}
|
||||
exports.Glob = Glob;
|
||||
//# sourceMappingURL=glob.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/glob.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.d.ts
generated
vendored
Normal file
14
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { GlobOptions } from './glob.js';
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
//# sourceMappingURL=has-magic.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAS,WAAgB,KACxB,OAQF,CAAA"}
|
||||
27
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.js
generated
vendored
Normal file
27
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hasMagic = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
const hasMagic = (pattern, options = {}) => {
|
||||
if (!Array.isArray(pattern)) {
|
||||
pattern = [pattern];
|
||||
}
|
||||
for (const p of pattern) {
|
||||
if (new minimatch_1.Minimatch(p, options).hasMagic())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
exports.hasMagic = hasMagic;
|
||||
//# sourceMappingURL=has-magic.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/has-magic.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}
|
||||
24
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.d.ts
generated
vendored
Normal file
24
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Minimatch, MinimatchOptions } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
export interface IgnoreLike {
|
||||
ignored?: (p: Path) => boolean;
|
||||
childrenIgnored?: (p: Path) => boolean;
|
||||
add?: (ignore: string) => void;
|
||||
}
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
export declare class Ignore implements IgnoreLike {
|
||||
relative: Minimatch[];
|
||||
relativeChildren: Minimatch[];
|
||||
absolute: Minimatch[];
|
||||
absoluteChildren: Minimatch[];
|
||||
platform: NodeJS.Platform;
|
||||
mmopts: MinimatchOptions;
|
||||
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
|
||||
add(ign: string): void;
|
||||
ignored(p: Path): boolean;
|
||||
childrenIgnored(p: Path): boolean;
|
||||
}
|
||||
//# sourceMappingURL=ignore.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}
|
||||
119
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.js
generated
vendored
Normal file
119
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.js
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
// give it a pattern, and it'll be able to tell you if
|
||||
// a given path should be ignored.
|
||||
// Ignoring a path ignores its children if the pattern ends in /**
|
||||
// Ignores are always parsed in dot:true mode
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Ignore = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const pattern_js_1 = require("./pattern.js");
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
class Ignore {
|
||||
relative;
|
||||
relativeChildren;
|
||||
absolute;
|
||||
absoluteChildren;
|
||||
platform;
|
||||
mmopts;
|
||||
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
|
||||
this.relative = [];
|
||||
this.absolute = [];
|
||||
this.relativeChildren = [];
|
||||
this.absoluteChildren = [];
|
||||
this.platform = platform;
|
||||
this.mmopts = {
|
||||
dot: true,
|
||||
nobrace,
|
||||
nocase,
|
||||
noext,
|
||||
noglobstar,
|
||||
optimizationLevel: 2,
|
||||
platform,
|
||||
nocomment: true,
|
||||
nonegate: true,
|
||||
};
|
||||
for (const ign of ignored)
|
||||
this.add(ign);
|
||||
}
|
||||
add(ign) {
|
||||
// this is a little weird, but it gives us a clean set of optimized
|
||||
// minimatch matchers, without getting tripped up if one of them
|
||||
// ends in /** inside a brace section, and it's only inefficient at
|
||||
// the start of the walk, not along it.
|
||||
// It'd be nice if the Pattern class just had a .test() method, but
|
||||
// handling globstars is a bit of a pita, and that code already lives
|
||||
// in minimatch anyway.
|
||||
// Another way would be if maybe Minimatch could take its set/globParts
|
||||
// as an option, and then we could at least just use Pattern to test
|
||||
// for absolute-ness.
|
||||
// Yet another way, Minimatch could take an array of glob strings, and
|
||||
// a cwd option, and do the right thing.
|
||||
const mm = new minimatch_1.Minimatch(ign, this.mmopts);
|
||||
for (let i = 0; i < mm.set.length; i++) {
|
||||
const parsed = mm.set[i];
|
||||
const globParts = mm.globParts[i];
|
||||
/* c8 ignore start */
|
||||
if (!parsed || !globParts) {
|
||||
throw new Error('invalid pattern object');
|
||||
}
|
||||
// strip off leading ./ portions
|
||||
// https://github.com/isaacs/node-glob/issues/570
|
||||
while (parsed[0] === '.' && globParts[0] === '.') {
|
||||
parsed.shift();
|
||||
globParts.shift();
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform);
|
||||
const m = new minimatch_1.Minimatch(p.globString(), this.mmopts);
|
||||
const children = globParts[globParts.length - 1] === '**';
|
||||
const absolute = p.isAbsolute();
|
||||
if (absolute)
|
||||
this.absolute.push(m);
|
||||
else
|
||||
this.relative.push(m);
|
||||
if (children) {
|
||||
if (absolute)
|
||||
this.absoluteChildren.push(m);
|
||||
else
|
||||
this.relativeChildren.push(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
ignored(p) {
|
||||
const fullpath = p.fullpath();
|
||||
const fullpaths = `${fullpath}/`;
|
||||
const relative = p.relative() || '.';
|
||||
const relatives = `${relative}/`;
|
||||
for (const m of this.relative) {
|
||||
if (m.match(relative) || m.match(relatives))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absolute) {
|
||||
if (m.match(fullpath) || m.match(fullpaths))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
childrenIgnored(p) {
|
||||
const fullpath = p.fullpath() + '/';
|
||||
const relative = (p.relative() || '.') + '/';
|
||||
for (const m of this.relativeChildren) {
|
||||
if (m.match(relative))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absoluteChildren) {
|
||||
if (m.match(fullpath))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.Ignore = Ignore;
|
||||
//# sourceMappingURL=ignore.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/ignore.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
97
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.d.ts
generated
vendored
Normal file
97
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
import { Minipass } from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
|
||||
import { Glob } from './glob.js';
|
||||
export { escape, unescape } from 'minimatch';
|
||||
export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry';
|
||||
export { Glob } from './glob.js';
|
||||
export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
|
||||
export { hasMagic } from './has-magic.js';
|
||||
export { Ignore } from './ignore.js';
|
||||
export type { IgnoreLike } from './ignore.js';
|
||||
export type { MatchStream } from './walker.js';
|
||||
/**
|
||||
* Syncronous form of {@link globStream}. Will read all the matches as fast as
|
||||
* you consume them, even all in a single tick if you consume them immediately,
|
||||
* but will still respond to backpressure if they're not consumed immediately.
|
||||
*/
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Return a stream that emits all the strings or `Path` objects and
|
||||
* then emits `end` when completed.
|
||||
*/
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Synchronous form of {@link glob}
|
||||
*/
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
|
||||
export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
|
||||
/**
|
||||
* Perform an asynchronous glob search for the pattern(s) specified. Returns
|
||||
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
|
||||
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
|
||||
* full option descriptions.
|
||||
*/
|
||||
declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
|
||||
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
|
||||
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
|
||||
declare function glob_(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
|
||||
/**
|
||||
* Return a sync iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
|
||||
/**
|
||||
* Return an async iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
|
||||
export declare const streamSync: typeof globStreamSync;
|
||||
export declare const stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
export declare const iterateSync: typeof globIterateSync;
|
||||
export declare const iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
export declare const sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
export declare const glob: typeof glob_ & {
|
||||
glob: typeof glob_;
|
||||
globSync: typeof globSync;
|
||||
sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
globStream: typeof globStream;
|
||||
stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof globStreamSync;
|
||||
streamSync: typeof globStreamSync;
|
||||
globIterate: typeof globIterate;
|
||||
iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof globIterateSync;
|
||||
iterateSync: typeof globIterateSync;
|
||||
Glob: typeof Glob;
|
||||
hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,YAAY,EACV,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,4BAA4B,GACpC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,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M,OAAO;;CAElB,CAAA;AACF,eAAO,MAAM,IAAI;;;CAGf,CAAA;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAgBf,CAAA"}
|
||||
68
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.js
generated
vendored
Normal file
68
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0;
|
||||
exports.globStreamSync = globStreamSync;
|
||||
exports.globStream = globStream;
|
||||
exports.globSync = globSync;
|
||||
exports.globIterateSync = globIterateSync;
|
||||
exports.globIterate = globIterate;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const glob_js_1 = require("./glob.js");
|
||||
const has_magic_js_1 = require("./has-magic.js");
|
||||
var minimatch_2 = require("minimatch");
|
||||
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } });
|
||||
Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } });
|
||||
var glob_js_2 = require("./glob.js");
|
||||
Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } });
|
||||
var has_magic_js_2 = require("./has-magic.js");
|
||||
Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } });
|
||||
var ignore_js_1 = require("./ignore.js");
|
||||
Object.defineProperty(exports, "Ignore", { enumerable: true, get: function () { return ignore_js_1.Ignore; } });
|
||||
function globStreamSync(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).streamSync();
|
||||
}
|
||||
function globStream(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).stream();
|
||||
}
|
||||
function globSync(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).walkSync();
|
||||
}
|
||||
async function glob_(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).walk();
|
||||
}
|
||||
function globIterateSync(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).iterateSync();
|
||||
}
|
||||
function globIterate(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).iterate();
|
||||
}
|
||||
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
|
||||
exports.streamSync = globStreamSync;
|
||||
exports.stream = Object.assign(globStream, { sync: globStreamSync });
|
||||
exports.iterateSync = globIterateSync;
|
||||
exports.iterate = Object.assign(globIterate, {
|
||||
sync: globIterateSync,
|
||||
});
|
||||
exports.sync = Object.assign(globSync, {
|
||||
stream: globStreamSync,
|
||||
iterate: globIterateSync,
|
||||
});
|
||||
exports.glob = Object.assign(glob_, {
|
||||
glob: glob_,
|
||||
globSync,
|
||||
sync: exports.sync,
|
||||
globStream,
|
||||
stream: exports.stream,
|
||||
globStreamSync,
|
||||
streamSync: exports.streamSync,
|
||||
globIterate,
|
||||
iterate: exports.iterate,
|
||||
globIterateSync,
|
||||
iterateSync: exports.iterateSync,
|
||||
Glob: glob_js_1.Glob,
|
||||
hasMagic: has_magic_js_1.hasMagic,
|
||||
escape: minimatch_1.escape,
|
||||
unescape: minimatch_1.unescape,
|
||||
});
|
||||
exports.glob.glob = exports.glob;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/package.json
generated
vendored
Normal file
3
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
76
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.d.ts
generated
vendored
Normal file
76
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.d.ts
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
export type MMPattern = string | RegExp | typeof GLOBSTAR;
|
||||
export type PatternList = [p: MMPattern, ...rest: MMPattern[]];
|
||||
export type UNCPatternList = [
|
||||
p0: '',
|
||||
p1: '',
|
||||
p2: string,
|
||||
p3: string,
|
||||
...rest: MMPattern[]
|
||||
];
|
||||
export type DrivePatternList = [p0: string, ...rest: MMPattern[]];
|
||||
export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]];
|
||||
export type GlobList = [p: string, ...rest: string[]];
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
export declare class Pattern {
|
||||
#private;
|
||||
readonly length: number;
|
||||
constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform);
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern(): MMPattern;
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString(): boolean;
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar(): boolean;
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp(): boolean;
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString(): string;
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore(): boolean;
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest(): Pattern | null;
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC(): boolean;
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive(): boolean;
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute(): boolean;
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root(): string;
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar(): boolean;
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar(): boolean;
|
||||
}
|
||||
//# sourceMappingURL=pattern.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ,CAAA;AAGzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,GAAG,IAAI,EAAE,SAAS,EAAE;CACrB,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AACjE,MAAM,MAAM,mBAAmB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAChE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAMrD;;;GAGG;AACH,qBAAa,OAAO;;IAIlB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAUrB,WAAW,EAAE,SAAS,EAAE,EACxB,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,CAAC,QAAQ;IA6D3B;;OAEG;IACH,OAAO,IAAI,SAAS;IAIpB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAGnB;;OAEG;IACH,UAAU,IAAI,OAAO;IAGrB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,UAAU,IAAI,MAAM;IAUpB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,IAAI,IAAI,OAAO,GAAG,IAAI;IAetB;;OAEG;IACH,KAAK,IAAI,OAAO;IAoBhB;;OAEG;IACH,OAAO,IAAI,OAAO;IAelB;;OAEG;IACH,UAAU,IAAI,OAAO;IAUrB;;OAEG;IACH,IAAI,IAAI,MAAM;IASd;;;OAGG;IACH,mBAAmB,IAAI,OAAO;IAQ9B;;OAEG;IACH,kBAAkB,IAAI,OAAO;CAM9B"}
|
||||
219
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.js
generated
vendored
Normal file
219
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.js
generated
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
"use strict";
|
||||
// this is just a very light wrapper around 2 arrays with an offset index
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Pattern = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const isPatternList = (pl) => pl.length >= 1;
|
||||
const isGlobList = (gl) => gl.length >= 1;
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
class Pattern {
|
||||
#patternList;
|
||||
#globList;
|
||||
#index;
|
||||
length;
|
||||
#platform;
|
||||
#rest;
|
||||
#globString;
|
||||
#isDrive;
|
||||
#isUNC;
|
||||
#isAbsolute;
|
||||
#followGlobstar = true;
|
||||
constructor(patternList, globList, index, platform) {
|
||||
if (!isPatternList(patternList)) {
|
||||
throw new TypeError('empty pattern list');
|
||||
}
|
||||
if (!isGlobList(globList)) {
|
||||
throw new TypeError('empty glob list');
|
||||
}
|
||||
if (globList.length !== patternList.length) {
|
||||
throw new TypeError('mismatched pattern list and glob list lengths');
|
||||
}
|
||||
this.length = patternList.length;
|
||||
if (index < 0 || index >= this.length) {
|
||||
throw new TypeError('index out of range');
|
||||
}
|
||||
this.#patternList = patternList;
|
||||
this.#globList = globList;
|
||||
this.#index = index;
|
||||
this.#platform = platform;
|
||||
// normalize root entries of absolute patterns on initial creation.
|
||||
if (this.#index === 0) {
|
||||
// c: => ['c:/']
|
||||
// C:/ => ['C:/']
|
||||
// C:/x => ['C:/', 'x']
|
||||
// //host/share => ['//host/share/']
|
||||
// //host/share/ => ['//host/share/']
|
||||
// //host/share/x => ['//host/share/', 'x']
|
||||
// /etc => ['/', 'etc']
|
||||
// / => ['/']
|
||||
if (this.isUNC()) {
|
||||
// '' / '' / 'host' / 'share'
|
||||
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
||||
const [g0, g1, g2, g3, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = [p0, p1, p2, p3, ''].join('/');
|
||||
const g = [g0, g1, g2, g3, ''].join('/');
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
else if (this.isDrive() || this.isAbsolute()) {
|
||||
const [p1, ...prest] = this.#patternList;
|
||||
const [g1, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = p1 + '/';
|
||||
const g = g1 + '/';
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern() {
|
||||
return this.#patternList[this.#index];
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString() {
|
||||
return typeof this.#patternList[this.#index] === 'string';
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar() {
|
||||
return this.#patternList[this.#index] === minimatch_1.GLOBSTAR;
|
||||
}
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp() {
|
||||
return this.#patternList[this.#index] instanceof RegExp;
|
||||
}
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString() {
|
||||
return (this.#globString =
|
||||
this.#globString ||
|
||||
(this.#index === 0 ?
|
||||
this.isAbsolute() ?
|
||||
this.#globList[0] + this.#globList.slice(1).join('/')
|
||||
: this.#globList.join('/')
|
||||
: this.#globList.slice(this.#index).join('/')));
|
||||
}
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore() {
|
||||
return this.length > this.#index + 1;
|
||||
}
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest() {
|
||||
if (this.#rest !== undefined)
|
||||
return this.#rest;
|
||||
if (!this.hasMore())
|
||||
return (this.#rest = null);
|
||||
this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
|
||||
this.#rest.#isAbsolute = this.#isAbsolute;
|
||||
this.#rest.#isUNC = this.#isUNC;
|
||||
this.#rest.#isDrive = this.#isDrive;
|
||||
return this.#rest;
|
||||
}
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isUNC !== undefined ?
|
||||
this.#isUNC
|
||||
: (this.#isUNC =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
pl[0] === '' &&
|
||||
pl[1] === '' &&
|
||||
typeof pl[2] === 'string' &&
|
||||
!!pl[2] &&
|
||||
typeof pl[3] === 'string' &&
|
||||
!!pl[3]);
|
||||
}
|
||||
// pattern like C:/...
|
||||
// split = ['C:', ...]
|
||||
// XXX: would be nice to handle patterns like `c:*` to test the cwd
|
||||
// in c: for *, but I don't know of a way to even figure out what that
|
||||
// cwd is without actually chdir'ing into it?
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isDrive !== undefined ?
|
||||
this.#isDrive
|
||||
: (this.#isDrive =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
this.length > 1 &&
|
||||
typeof pl[0] === 'string' &&
|
||||
/^[a-z]:$/i.test(pl[0]));
|
||||
}
|
||||
// pattern = '/' or '/...' or '/x/...'
|
||||
// split = ['', ''] or ['', ...] or ['', 'x', ...]
|
||||
// Drive and UNC both considered absolute on windows
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isAbsolute !== undefined ?
|
||||
this.#isAbsolute
|
||||
: (this.#isAbsolute =
|
||||
(pl[0] === '' && pl.length > 1) ||
|
||||
this.isDrive() ||
|
||||
this.isUNC());
|
||||
}
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root() {
|
||||
const p = this.#patternList[0];
|
||||
return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
|
||||
p
|
||||
: '';
|
||||
}
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar() {
|
||||
return !(this.#index === 0 ||
|
||||
!this.isGlobstar() ||
|
||||
!this.#followGlobstar);
|
||||
}
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar() {
|
||||
if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
|
||||
return false;
|
||||
this.#followGlobstar = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.Pattern = Pattern;
|
||||
//# sourceMappingURL=pattern.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/pattern.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.d.ts
generated
vendored
Normal file
59
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { MMRegExp } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
export declare class HasWalkedCache {
|
||||
store: Map<string, Set<string>>;
|
||||
constructor(store?: Map<string, Set<string>>);
|
||||
copy(): HasWalkedCache;
|
||||
hasWalked(target: Path, pattern: Pattern): boolean | undefined;
|
||||
storeWalked(target: Path, pattern: Pattern): void;
|
||||
}
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
export declare class MatchRecord {
|
||||
store: Map<Path, number>;
|
||||
add(target: Path, absolute: boolean, ifDir: boolean): void;
|
||||
entries(): [Path, boolean, boolean][];
|
||||
}
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
export declare class SubWalks {
|
||||
store: Map<Path, Pattern[]>;
|
||||
add(target: Path, pattern: Pattern): void;
|
||||
get(target: Path): Pattern[];
|
||||
entries(): [Path, Pattern[]][];
|
||||
keys(): Path[];
|
||||
}
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
export declare class Processor {
|
||||
hasWalkedCache: HasWalkedCache;
|
||||
matches: MatchRecord;
|
||||
subwalks: SubWalks;
|
||||
patterns?: Pattern[];
|
||||
follow: boolean;
|
||||
dot: boolean;
|
||||
opts: GlobWalkerOpts;
|
||||
constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache);
|
||||
processPatterns(target: Path, patterns: Pattern[]): this;
|
||||
subwalkTargets(): Path[];
|
||||
child(): Processor;
|
||||
filterEntries(parent: Path, entries: Path[]): Processor;
|
||||
testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void;
|
||||
testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void;
|
||||
testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void;
|
||||
}
|
||||
//# sourceMappingURL=processor.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAa,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,qBAAa,cAAc;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAA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,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS;IAqBvD,YAAY,CACV,CAAC,EAAE,IAAI,EACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IA8CnB,UAAU,CACR,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,QAAQ,EACX,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IAUnB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"}
|
||||
301
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.js
generated
vendored
Normal file
301
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.js
generated
vendored
Normal file
@@ -0,0 +1,301 @@
|
||||
"use strict";
|
||||
// synchronous utility for filtering entries and calculating subwalks
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
class HasWalkedCache {
|
||||
store;
|
||||
constructor(store = new Map()) {
|
||||
this.store = store;
|
||||
}
|
||||
copy() {
|
||||
return new HasWalkedCache(new Map(this.store));
|
||||
}
|
||||
hasWalked(target, pattern) {
|
||||
return this.store.get(target.fullpath())?.has(pattern.globString());
|
||||
}
|
||||
storeWalked(target, pattern) {
|
||||
const fullpath = target.fullpath();
|
||||
const cached = this.store.get(fullpath);
|
||||
if (cached)
|
||||
cached.add(pattern.globString());
|
||||
else
|
||||
this.store.set(fullpath, new Set([pattern.globString()]));
|
||||
}
|
||||
}
|
||||
exports.HasWalkedCache = HasWalkedCache;
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
class MatchRecord {
|
||||
store = new Map();
|
||||
add(target, absolute, ifDir) {
|
||||
const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
|
||||
const current = this.store.get(target);
|
||||
this.store.set(target, current === undefined ? n : n & current);
|
||||
}
|
||||
// match, absolute, ifdir
|
||||
entries() {
|
||||
return [...this.store.entries()].map(([path, n]) => [
|
||||
path,
|
||||
!!(n & 2),
|
||||
!!(n & 1),
|
||||
]);
|
||||
}
|
||||
}
|
||||
exports.MatchRecord = MatchRecord;
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
class SubWalks {
|
||||
store = new Map();
|
||||
add(target, pattern) {
|
||||
if (!target.canReaddir()) {
|
||||
return;
|
||||
}
|
||||
const subs = this.store.get(target);
|
||||
if (subs) {
|
||||
if (!subs.find(p => p.globString() === pattern.globString())) {
|
||||
subs.push(pattern);
|
||||
}
|
||||
}
|
||||
else
|
||||
this.store.set(target, [pattern]);
|
||||
}
|
||||
get(target) {
|
||||
const subs = this.store.get(target);
|
||||
/* c8 ignore start */
|
||||
if (!subs) {
|
||||
throw new Error('attempting to walk unknown path');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
return subs;
|
||||
}
|
||||
entries() {
|
||||
return this.keys().map(k => [k, this.store.get(k)]);
|
||||
}
|
||||
keys() {
|
||||
return [...this.store.keys()].filter(t => t.canReaddir());
|
||||
}
|
||||
}
|
||||
exports.SubWalks = SubWalks;
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
class Processor {
|
||||
hasWalkedCache;
|
||||
matches = new MatchRecord();
|
||||
subwalks = new SubWalks();
|
||||
patterns;
|
||||
follow;
|
||||
dot;
|
||||
opts;
|
||||
constructor(opts, hasWalkedCache) {
|
||||
this.opts = opts;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.hasWalkedCache =
|
||||
hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();
|
||||
}
|
||||
processPatterns(target, patterns) {
|
||||
this.patterns = patterns;
|
||||
const processingSet = patterns.map(p => [target, p]);
|
||||
// map of paths to the magic-starting subwalks they need to walk
|
||||
// first item in patterns is the filter
|
||||
for (let [t, pattern] of processingSet) {
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
const root = pattern.root();
|
||||
const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
|
||||
// start absolute patterns at root
|
||||
if (root) {
|
||||
t = t.resolve(root === '/' && this.opts.root !== undefined ?
|
||||
this.opts.root
|
||||
: root);
|
||||
const rest = pattern.rest();
|
||||
if (!rest) {
|
||||
this.matches.add(t, true, false);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
pattern = rest;
|
||||
}
|
||||
}
|
||||
if (t.isENOENT())
|
||||
continue;
|
||||
let p;
|
||||
let rest;
|
||||
let changed = false;
|
||||
while (typeof (p = pattern.pattern()) === 'string' &&
|
||||
(rest = pattern.rest())) {
|
||||
const c = t.resolve(p);
|
||||
t = c;
|
||||
pattern = rest;
|
||||
changed = true;
|
||||
}
|
||||
p = pattern.pattern();
|
||||
rest = pattern.rest();
|
||||
if (changed) {
|
||||
if (this.hasWalkedCache.hasWalked(t, pattern))
|
||||
continue;
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
}
|
||||
// now we have either a final string for a known entry,
|
||||
// more strings for an unknown entry,
|
||||
// or a pattern starting with magic, mounted on t.
|
||||
if (typeof p === 'string') {
|
||||
// must not be final entry, otherwise we would have
|
||||
// concatenated it earlier.
|
||||
const ifDir = p === '..' || p === '' || p === '.';
|
||||
this.matches.add(t.resolve(p), absolute, ifDir);
|
||||
continue;
|
||||
}
|
||||
else if (p === minimatch_1.GLOBSTAR) {
|
||||
// if no rest, match and subwalk pattern
|
||||
// if rest, process rest and subwalk pattern
|
||||
// if it's a symlink, but we didn't get here by way of a
|
||||
// globstar match (meaning it's the first time THIS globstar
|
||||
// has traversed a symlink), then we follow it. Otherwise, stop.
|
||||
if (!t.isSymbolicLink() ||
|
||||
this.follow ||
|
||||
pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
const rp = rest?.pattern();
|
||||
const rrest = rest?.rest();
|
||||
if (!rest || ((rp === '' || rp === '.') && !rrest)) {
|
||||
// only HAS to be a dir if it ends in **/ or **/.
|
||||
// but ending in ** will match files as well.
|
||||
this.matches.add(t, absolute, rp === '' || rp === '.');
|
||||
}
|
||||
else {
|
||||
if (rp === '..') {
|
||||
// this would mean you're matching **/.. at the fs root,
|
||||
// and no thanks, I'm not gonna test that specific case.
|
||||
/* c8 ignore start */
|
||||
const tp = t.parent || t;
|
||||
/* c8 ignore stop */
|
||||
if (!rrest)
|
||||
this.matches.add(tp, absolute, true);
|
||||
else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
|
||||
this.subwalks.add(tp, rrest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
subwalkTargets() {
|
||||
return this.subwalks.keys();
|
||||
}
|
||||
child() {
|
||||
return new Processor(this.opts, this.hasWalkedCache);
|
||||
}
|
||||
// return a new Processor containing the subwalks for each
|
||||
// child entry, and a set of matches, and
|
||||
// a hasWalkedCache that's a copy of this one
|
||||
// then we're going to call
|
||||
filterEntries(parent, entries) {
|
||||
const patterns = this.subwalks.get(parent);
|
||||
// put matches and entry walks into the results processor
|
||||
const results = this.child();
|
||||
for (const e of entries) {
|
||||
for (const pattern of patterns) {
|
||||
const absolute = pattern.isAbsolute();
|
||||
const p = pattern.pattern();
|
||||
const rest = pattern.rest();
|
||||
if (p === minimatch_1.GLOBSTAR) {
|
||||
results.testGlobstar(e, pattern, rest, absolute);
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
results.testRegExp(e, p, rest, absolute);
|
||||
}
|
||||
else {
|
||||
results.testString(e, p, rest, absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
testGlobstar(e, pattern, rest, absolute) {
|
||||
if (this.dot || !e.name.startsWith('.')) {
|
||||
if (!pattern.hasMore()) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
if (e.canReaddir()) {
|
||||
// if we're in follow mode or it's not a symlink, just keep
|
||||
// testing the same pattern. If there's more after the globstar,
|
||||
// then this symlink consumes the globstar. If not, then we can
|
||||
// follow at most ONE symlink along the way, so we mark it, which
|
||||
// also checks to ensure that it wasn't already marked.
|
||||
if (this.follow || !e.isSymbolicLink()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
else if (e.isSymbolicLink()) {
|
||||
if (rest && pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
else if (pattern.markFollowGlobstar()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if the NEXT thing matches this entry, then also add
|
||||
// the rest.
|
||||
if (rest) {
|
||||
const rp = rest.pattern();
|
||||
if (typeof rp === 'string' &&
|
||||
// dots and empty were handled already
|
||||
rp !== '..' &&
|
||||
rp !== '' &&
|
||||
rp !== '.') {
|
||||
this.testString(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
else if (rp === '..') {
|
||||
/* c8 ignore start */
|
||||
const ep = e.parent || e;
|
||||
/* c8 ignore stop */
|
||||
this.subwalks.add(ep, rest);
|
||||
}
|
||||
else if (rp instanceof RegExp) {
|
||||
this.testRegExp(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
testRegExp(e, p, rest, absolute) {
|
||||
if (!p.test(e.name))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
testString(e, p, rest, absolute) {
|
||||
// should never happen?
|
||||
if (!e.isNamed(p))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Processor = Processor;
|
||||
//# sourceMappingURL=processor.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/processor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
97
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.d.ts
generated
vendored
Normal file
97
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
import { Minipass } from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { Processor } from './processor.js';
|
||||
export interface GlobWalkerOpts {
|
||||
absolute?: boolean;
|
||||
allowWindowsEscape?: boolean;
|
||||
cwd?: string | URL;
|
||||
dot?: boolean;
|
||||
dotRelative?: boolean;
|
||||
follow?: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
mark?: boolean;
|
||||
matchBase?: boolean;
|
||||
maxDepth?: number;
|
||||
nobrace?: boolean;
|
||||
nocase?: boolean;
|
||||
nodir?: boolean;
|
||||
noext?: boolean;
|
||||
noglobstar?: boolean;
|
||||
platform?: NodeJS.Platform;
|
||||
posix?: boolean;
|
||||
realpath?: boolean;
|
||||
root?: string;
|
||||
stat?: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape?: boolean;
|
||||
withFileTypes?: boolean;
|
||||
includeChildMatches?: boolean;
|
||||
}
|
||||
export type GWOFileTypesTrue = GlobWalkerOpts & {
|
||||
withFileTypes: true;
|
||||
};
|
||||
export type GWOFileTypesFalse = GlobWalkerOpts & {
|
||||
withFileTypes: false;
|
||||
};
|
||||
export type GWOFileTypesUnset = GlobWalkerOpts & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
|
||||
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
||||
export type MatchStream<O extends GlobWalkerOpts> = Minipass<Result<O>, Result<O>>;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {
|
||||
#private;
|
||||
path: Path;
|
||||
patterns: Pattern[];
|
||||
opts: O;
|
||||
seen: Set<Path>;
|
||||
paused: boolean;
|
||||
aborted: boolean;
|
||||
signal?: AbortSignal;
|
||||
maxDepth: number;
|
||||
includeChildMatches: boolean;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
onResume(fn: () => any): void;
|
||||
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
|
||||
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
|
||||
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
|
||||
abstract matchEmit(p: Result<O>): void;
|
||||
abstract matchEmit(p: string | Path): void;
|
||||
matchFinish(e: Path, absolute: boolean): void;
|
||||
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
|
||||
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
|
||||
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
}
|
||||
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
matches: Set<Result<O>>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
walk(): Promise<Set<Result<O>>>;
|
||||
walkSync(): Set<Result<O>>;
|
||||
}
|
||||
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
results: Minipass<Result<O>, Result<O>>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
stream(): MatchStream<O>;
|
||||
streamSync(): MatchStream<O>;
|
||||
}
|
||||
//# sourceMappingURL=walker.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAA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,OAAO,EAAE,IAAI,EAAE,EACf,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,MAAM,GAAG;CAoBhB;AAED,qBAAa,UAAU,CACrB,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,OAAO,iBAAuB;gBAElB,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAIpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAIvB,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAiBrC,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAW3B;AAED,qBAAa,UAAU,CACrB,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;gBAE3B,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAUpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAK7B,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;IAYxB,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC;CAO7B"}
|
||||
387
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.js
generated
vendored
Normal file
387
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.js
generated
vendored
Normal file
@@ -0,0 +1,387 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0;
|
||||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
const minipass_1 = require("minipass");
|
||||
const ignore_js_1 = require("./ignore.js");
|
||||
const processor_js_1 = require("./processor.js");
|
||||
const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts)
|
||||
: Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts)
|
||||
: ignore;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
class GlobUtil {
|
||||
path;
|
||||
patterns;
|
||||
opts;
|
||||
seen = new Set();
|
||||
paused = false;
|
||||
aborted = false;
|
||||
#onResume = [];
|
||||
#ignore;
|
||||
#sep;
|
||||
signal;
|
||||
maxDepth;
|
||||
includeChildMatches;
|
||||
constructor(patterns, path, opts) {
|
||||
this.patterns = patterns;
|
||||
this.path = path;
|
||||
this.opts = opts;
|
||||
this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
if (opts.ignore || !this.includeChildMatches) {
|
||||
this.#ignore = makeIgnore(opts.ignore ?? [], opts);
|
||||
if (!this.includeChildMatches &&
|
||||
typeof this.#ignore.add !== 'function') {
|
||||
const m = 'cannot ignore child matches, ignore lacks add() method.';
|
||||
throw new Error(m);
|
||||
}
|
||||
}
|
||||
// ignore, always set with maxDepth, but it's optional on the
|
||||
// GlobOptions type
|
||||
/* c8 ignore start */
|
||||
this.maxDepth = opts.maxDepth || Infinity;
|
||||
/* c8 ignore stop */
|
||||
if (opts.signal) {
|
||||
this.signal = opts.signal;
|
||||
this.signal.addEventListener('abort', () => {
|
||||
this.#onResume.length = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
#ignored(path) {
|
||||
return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
|
||||
}
|
||||
#childrenIgnored(path) {
|
||||
return !!this.#ignore?.childrenIgnored?.(path);
|
||||
}
|
||||
// backpressure mechanism
|
||||
pause() {
|
||||
this.paused = true;
|
||||
}
|
||||
resume() {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore stop */
|
||||
this.paused = false;
|
||||
let fn = undefined;
|
||||
while (!this.paused && (fn = this.#onResume.shift())) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
onResume(fn) {
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore start */
|
||||
if (!this.paused) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
/* c8 ignore stop */
|
||||
this.#onResume.push(fn);
|
||||
}
|
||||
}
|
||||
// do the requisite realpath/stat checking, and return the path
|
||||
// to add or undefined to filter it out.
|
||||
async matchCheck(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || (await e.realpath());
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
const s = needStat ? await e.lstat() : e;
|
||||
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
||||
const target = await s.realpath();
|
||||
/* c8 ignore start */
|
||||
if (target && (target.isUnknown() || this.opts.stat)) {
|
||||
await target.lstat();
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
return this.matchCheckTest(s, ifDir);
|
||||
}
|
||||
matchCheckTest(e, ifDir) {
|
||||
return (e &&
|
||||
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
|
||||
(!ifDir || e.canReaddir()) &&
|
||||
(!this.opts.nodir || !e.isDirectory()) &&
|
||||
(!this.opts.nodir ||
|
||||
!this.opts.follow ||
|
||||
!e.isSymbolicLink() ||
|
||||
!e.realpathCached()?.isDirectory()) &&
|
||||
!this.#ignored(e)) ?
|
||||
e
|
||||
: undefined;
|
||||
}
|
||||
matchCheckSync(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || e.realpathSync();
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
const s = needStat ? e.lstatSync() : e;
|
||||
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
||||
const target = s.realpathSync();
|
||||
if (target && (target?.isUnknown() || this.opts.stat)) {
|
||||
target.lstatSync();
|
||||
}
|
||||
}
|
||||
return this.matchCheckTest(s, ifDir);
|
||||
}
|
||||
matchFinish(e, absolute) {
|
||||
if (this.#ignored(e))
|
||||
return;
|
||||
// we know we have an ignore if this is false, but TS doesn't
|
||||
if (!this.includeChildMatches && this.#ignore?.add) {
|
||||
const ign = `${e.relativePosix()}/**`;
|
||||
this.#ignore.add(ign);
|
||||
}
|
||||
const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
|
||||
this.seen.add(e);
|
||||
const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
|
||||
// ok, we have what we need!
|
||||
if (this.opts.withFileTypes) {
|
||||
this.matchEmit(e);
|
||||
}
|
||||
else if (abs) {
|
||||
const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();
|
||||
this.matchEmit(abs + mark);
|
||||
}
|
||||
else {
|
||||
const rel = this.opts.posix ? e.relativePosix() : e.relative();
|
||||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?
|
||||
'.' + this.#sep
|
||||
: '';
|
||||
this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
|
||||
}
|
||||
}
|
||||
async match(e, absolute, ifDir) {
|
||||
const p = await this.matchCheck(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
matchSync(e, absolute, ifDir) {
|
||||
const p = this.matchCheckSync(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
walkCB(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2(target, patterns, new processor_js_1.Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const childrenCached = t.readdirCached();
|
||||
if (t.calledReaddir())
|
||||
this.walkCB3(t, childrenCached, processor, next);
|
||||
else {
|
||||
t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
|
||||
}
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCBSync(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2Sync(target, patterns, new processor_js_1.Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2Sync(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const children = t.readdirSync();
|
||||
this.walkCB3Sync(t, children, processor, next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3Sync(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2Sync(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
}
|
||||
exports.GlobUtil = GlobUtil;
|
||||
class GlobWalker extends GlobUtil {
|
||||
matches = new Set();
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.matches.add(e);
|
||||
}
|
||||
async walk() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
await this.path.lstat();
|
||||
}
|
||||
await new Promise((res, rej) => {
|
||||
this.walkCB(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted) {
|
||||
rej(this.signal.reason);
|
||||
}
|
||||
else {
|
||||
res(this.matches);
|
||||
}
|
||||
});
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
walkSync() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
// nothing for the callback to do, because this never pauses
|
||||
this.walkCBSync(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
}
|
||||
exports.GlobWalker = GlobWalker;
|
||||
class GlobStream extends GlobUtil {
|
||||
results;
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
this.results = new minipass_1.Minipass({
|
||||
signal: this.signal,
|
||||
objectMode: true,
|
||||
});
|
||||
this.results.on('drain', () => this.resume());
|
||||
this.results.on('resume', () => this.resume());
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.results.write(e);
|
||||
if (!this.results.flowing)
|
||||
this.pause();
|
||||
}
|
||||
stream() {
|
||||
const target = this.path;
|
||||
if (target.isUnknown()) {
|
||||
target.lstat().then(() => {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
}
|
||||
return this.results;
|
||||
}
|
||||
streamSync() {
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
this.walkCBSync(this.path, this.patterns, () => this.results.end());
|
||||
return this.results;
|
||||
}
|
||||
}
|
||||
exports.GlobStream = GlobStream;
|
||||
//# sourceMappingURL=walker.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/commonjs/walker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
388
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.d.ts
generated
vendored
Normal file
388
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.d.ts
generated
vendored
Normal file
@@ -0,0 +1,388 @@
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Minipass } from 'minipass';
|
||||
import { FSOption, Path, PathScurry } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
export type MatchSet = Minimatch['set'];
|
||||
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
|
||||
/**
|
||||
* A `GlobOptions` object may be provided to any of the exported methods, and
|
||||
* must be provided to the `Glob` constructor.
|
||||
*
|
||||
* All options are optional, boolean, and false by default, unless otherwise
|
||||
* noted.
|
||||
*
|
||||
* All resolved options are added to the Glob object as properties.
|
||||
*
|
||||
* If you are running many `glob` operations, you can pass a Glob object as the
|
||||
* `options` argument to a subsequent operation to share the previously loaded
|
||||
* cache.
|
||||
*/
|
||||
export interface GlobOptions {
|
||||
/**
|
||||
* Set to `true` to always receive absolute paths for
|
||||
* matched files. Set to `false` to always return relative paths.
|
||||
*
|
||||
* When this option is not set, absolute paths are returned for patterns
|
||||
* that are absolute, and otherwise paths are returned that are relative
|
||||
* to the `cwd` setting.
|
||||
*
|
||||
* This does _not_ make an extra system call to get
|
||||
* the realpath, it only does string path resolution.
|
||||
*
|
||||
* Conflicts with {@link withFileTypes}
|
||||
*/
|
||||
absolute?: boolean;
|
||||
/**
|
||||
* Set to false to enable {@link windowsPathsNoEscape}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
allowWindowsEscape?: boolean;
|
||||
/**
|
||||
* The current working directory in which to search. Defaults to
|
||||
* `process.cwd()`.
|
||||
*
|
||||
* May be eiher a string path or a `file://` URL object or string.
|
||||
*/
|
||||
cwd?: string | URL;
|
||||
/**
|
||||
* Include `.dot` files in normal matches and `globstar`
|
||||
* matches. Note that an explicit dot in a portion of the pattern
|
||||
* will always match dot files.
|
||||
*/
|
||||
dot?: boolean;
|
||||
/**
|
||||
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
||||
*
|
||||
* Without this option, returned relative paths are "bare", so instead of
|
||||
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
||||
*
|
||||
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
||||
* if this option is set.
|
||||
*/
|
||||
dotRelative?: boolean;
|
||||
/**
|
||||
* Follow symlinked directories when expanding `**`
|
||||
* patterns. This can result in a lot of duplicate references in
|
||||
* the presence of cyclic links, and make performance quite bad.
|
||||
*
|
||||
* By default, a `**` in a pattern will follow 1 symbolic link if
|
||||
* it is not the first item in the pattern, or none if it is the
|
||||
* first item in the pattern, following the same behavior as Bash.
|
||||
*/
|
||||
follow?: boolean;
|
||||
/**
|
||||
* string or string[], or an object with `ignored` and `childrenIgnored`
|
||||
* methods.
|
||||
*
|
||||
* If a string or string[] is provided, then this is treated as a glob
|
||||
* pattern or array of glob patterns to exclude from matches. To ignore all
|
||||
* children within a directory, as well as the entry itself, append `'/**'`
|
||||
* to the ignore pattern.
|
||||
*
|
||||
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
||||
* any other settings.
|
||||
*
|
||||
* If an object is provided that has `ignored(path)` and/or
|
||||
* `childrenIgnored(path)` methods, then these methods will be called to
|
||||
* determine whether any Path is a match or if its children should be
|
||||
* traversed, respectively.
|
||||
*/
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
/**
|
||||
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
||||
* effect if {@link nobrace} is set.
|
||||
*
|
||||
* Only has effect on the {@link hasMagic} function.
|
||||
*/
|
||||
magicalBraces?: boolean;
|
||||
/**
|
||||
* Add a `/` character to directory matches. Note that this requires
|
||||
* additional stat calls in some cases.
|
||||
*/
|
||||
mark?: boolean;
|
||||
/**
|
||||
* Perform a basename-only match if the pattern does not contain any slash
|
||||
* characters. That is, `*.js` would be treated as equivalent to
|
||||
* `**\/*.js`, matching all js files in all directories.
|
||||
*/
|
||||
matchBase?: boolean;
|
||||
/**
|
||||
* Limit the directory traversal to a given depth below the cwd.
|
||||
* Note that this does NOT prevent traversal to sibling folders,
|
||||
* root patterns, and so on. It only limits the maximum folder depth
|
||||
* that the walk will descend, relative to the cwd.
|
||||
*/
|
||||
maxDepth?: number;
|
||||
/**
|
||||
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
*/
|
||||
nobrace?: boolean;
|
||||
/**
|
||||
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
||||
* Windows systems, and `false` on all others.
|
||||
*
|
||||
* **Note** `nocase` should only be explicitly set when it is
|
||||
* known that the filesystem's case sensitivity differs from the
|
||||
* platform default. If set `true` on case-sensitive file
|
||||
* systems, or `false` on case-insensitive file systems, then the
|
||||
* walk may return more or less results than expected.
|
||||
*/
|
||||
nocase?: boolean;
|
||||
/**
|
||||
* Do not match directories, only files. (Note: to match
|
||||
* _only_ directories, put a `/` at the end of the pattern.)
|
||||
*/
|
||||
nodir?: boolean;
|
||||
/**
|
||||
* Do not match "extglob" patterns such as `+(a|b)`.
|
||||
*/
|
||||
noext?: boolean;
|
||||
/**
|
||||
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
||||
* `*` instead.)
|
||||
*
|
||||
* Conflicts with {@link matchBase}
|
||||
*/
|
||||
noglobstar?: boolean;
|
||||
/**
|
||||
* Defaults to value of `process.platform` if available, or `'linux'` if
|
||||
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
||||
* behavior.
|
||||
*/
|
||||
platform?: NodeJS.Platform;
|
||||
/**
|
||||
* Set to true to call `fs.realpath` on all of the
|
||||
* results. In the case of an entry that cannot be resolved, the
|
||||
* entry is omitted. This incurs a slight performance penalty, of
|
||||
* course, because of the added system calls.
|
||||
*/
|
||||
realpath?: boolean;
|
||||
/**
|
||||
*
|
||||
* A string path resolved against the `cwd` option, which
|
||||
* is used as the starting point for absolute patterns that start
|
||||
* with `/`, (but not drive letters or UNC paths on Windows).
|
||||
*
|
||||
* Note that this _doesn't_ necessarily limit the walk to the
|
||||
* `root` directory, and doesn't affect the cwd starting point for
|
||||
* non-absolute patterns. A pattern containing `..` will still be
|
||||
* able to traverse out of the root directory, if it is not an
|
||||
* actual root directory on the filesystem, and any non-absolute
|
||||
* patterns will be matched in the `cwd`. For example, the
|
||||
* pattern `/../*` with `{root:'/some/path'}` will return all
|
||||
* files in `/some`, not all files in `/some/path`. The pattern
|
||||
* `*` with `{root:'/some/path'}` will return all the entries in
|
||||
* the cwd, not the entries in `/some/path`.
|
||||
*
|
||||
* To start absolute and non-absolute patterns in the same
|
||||
* path, you can use `{root:''}`. However, be aware that on
|
||||
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
||||
* _always_ start in the `x:/` or `//host/share` directory,
|
||||
* regardless of the `root` setting.
|
||||
*/
|
||||
root?: string;
|
||||
/**
|
||||
* A [PathScurry](http://npm.im/path-scurry) object used
|
||||
* to traverse the file system. If the `nocase` option is set
|
||||
* explicitly, then any provided `scurry` object must match this
|
||||
* setting.
|
||||
*/
|
||||
scurry?: PathScurry;
|
||||
/**
|
||||
* Call `lstat()` on all entries, whether required or not to determine
|
||||
* if it's a valid match. When used with {@link withFileTypes}, this means
|
||||
* that matches will include data such as modified time, permissions, and
|
||||
* so on. Note that this will incur a performance cost due to the added
|
||||
* system calls.
|
||||
*/
|
||||
stat?: boolean;
|
||||
/**
|
||||
* An AbortSignal which will cancel the Glob walk when
|
||||
* triggered.
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* Use `\\` as a path separator _only_, and
|
||||
* _never_ as an escape character. If set, all `\\` characters are
|
||||
* replaced with `/` in the pattern.
|
||||
*
|
||||
* Note that this makes it **impossible** to match against paths
|
||||
* containing literal glob pattern characters, but allows matching
|
||||
* with patterns constructed using `path.join()` and
|
||||
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
* behavior of Glob v7 and before on Windows. Please use with
|
||||
* caution, and be mindful of [the caveat below about Windows
|
||||
* paths](#windows). (For legacy reasons, this is also set if
|
||||
* `allowWindowsEscape` is set to the exact value `false`.)
|
||||
*/
|
||||
windowsPathsNoEscape?: boolean;
|
||||
/**
|
||||
* Return [PathScurry](http://npm.im/path-scurry)
|
||||
* `Path` objects instead of strings. These are similar to a
|
||||
* NodeJS `Dirent` object, but with additional methods and
|
||||
* properties.
|
||||
*
|
||||
* Conflicts with {@link absolute}
|
||||
*/
|
||||
withFileTypes?: boolean;
|
||||
/**
|
||||
* An fs implementation to override some or all of the defaults. See
|
||||
* http://npm.im/path-scurry for details about what can be overridden.
|
||||
*/
|
||||
fs?: FSOption;
|
||||
/**
|
||||
* Just passed along to Minimatch. Note that this makes all pattern
|
||||
* matching operations slower and *extremely* noisy.
|
||||
*/
|
||||
debug?: boolean;
|
||||
/**
|
||||
* Return `/` delimited paths, even on Windows.
|
||||
*
|
||||
* On posix systems, this has no effect. But, on Windows, it means that
|
||||
* paths will be `/` delimited, and absolute paths will be their full
|
||||
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
||||
* `'//?/C:/foo/bar'`
|
||||
*/
|
||||
posix?: boolean;
|
||||
/**
|
||||
* Do not match any children of any matches. For example, the pattern
|
||||
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
||||
*
|
||||
* This is especially useful for cases like "find all `node_modules`
|
||||
* folders, but not the ones in `node_modules`".
|
||||
*
|
||||
* In order to support this, the `Ignore` implementation must support an
|
||||
* `add(pattern: string)` method. If using the default `Ignore` class, then
|
||||
* this is fine, but if this is set to `false`, and a custom `Ignore` is
|
||||
* provided that does not have an `add()` method, then it will throw an
|
||||
* error.
|
||||
*
|
||||
* **Caveat** It *only* ignores matches that would be a descendant of a
|
||||
* previous match, and only if that descendant is matched *after* the
|
||||
* ancestor is encountered. Since the file system walk happens in
|
||||
* indeterminate order, it's possible that a match will already be added
|
||||
* before its ancestor, if multiple or braced patterns are used.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* ```ts
|
||||
* const results = await glob([
|
||||
* // likely to match first, since it's just a stat
|
||||
* 'a/b/c/d/e/f',
|
||||
*
|
||||
* // this pattern is more complicated! It must to various readdir()
|
||||
* // calls and test the results against a regular expression, and that
|
||||
* // is certainly going to take a little bit longer.
|
||||
* //
|
||||
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
||||
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
|
||||
* 'a/[bdf]/?/[a-z]/*',
|
||||
* ], { includeChildMatches: false })
|
||||
* ```
|
||||
*
|
||||
* It's best to only set this to `false` if you can be reasonably sure that
|
||||
* no components of the pattern will potentially match one another's file
|
||||
* system descendants, or if the occasional included child entry will not
|
||||
* cause problems.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
includeChildMatches?: boolean;
|
||||
}
|
||||
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
||||
withFileTypes: true;
|
||||
absolute?: undefined;
|
||||
mark?: undefined;
|
||||
posix?: undefined;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
||||
withFileTypes?: false;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
||||
export type Results<Opts> = Result<Opts>[];
|
||||
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
||||
absolute?: boolean;
|
||||
cwd: string;
|
||||
root?: string;
|
||||
dot: boolean;
|
||||
dotRelative: boolean;
|
||||
follow: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
magicalBraces: boolean;
|
||||
mark?: boolean;
|
||||
matchBase: boolean;
|
||||
maxDepth: number;
|
||||
nobrace: boolean;
|
||||
nocase: boolean;
|
||||
nodir: boolean;
|
||||
noext: boolean;
|
||||
noglobstar: boolean;
|
||||
pattern: string[];
|
||||
platform: NodeJS.Platform;
|
||||
realpath: boolean;
|
||||
scurry: PathScurry;
|
||||
stat: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape: boolean;
|
||||
withFileTypes: FileTypes<Opts>;
|
||||
includeChildMatches: boolean;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts: Opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns: Pattern[];
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern: string | string[], opts: Opts);
|
||||
/**
|
||||
* Returns a Promise that resolves to the results array.
|
||||
*/
|
||||
walk(): Promise<Results<Opts>>;
|
||||
/**
|
||||
* synchronous {@link Glob.walk}
|
||||
*/
|
||||
walkSync(): Results<Opts>;
|
||||
/**
|
||||
* Stream results asynchronously.
|
||||
*/
|
||||
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Stream results synchronously.
|
||||
*/
|
||||
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync(): Generator<Result<Opts>, void, void>;
|
||||
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
||||
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
||||
}
|
||||
//# sourceMappingURL=glob.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAalE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,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IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}
|
||||
243
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.js
generated
vendored
Normal file
243
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.js
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { GlobStream, GlobWalker } from './walker.js';
|
||||
// if no process global, just call it linux.
|
||||
// so we default to case-sensitive, / separators
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
export class Glob {
|
||||
absolute;
|
||||
cwd;
|
||||
root;
|
||||
dot;
|
||||
dotRelative;
|
||||
follow;
|
||||
ignore;
|
||||
magicalBraces;
|
||||
mark;
|
||||
matchBase;
|
||||
maxDepth;
|
||||
nobrace;
|
||||
nocase;
|
||||
nodir;
|
||||
noext;
|
||||
noglobstar;
|
||||
pattern;
|
||||
platform;
|
||||
realpath;
|
||||
scurry;
|
||||
stat;
|
||||
signal;
|
||||
windowsPathsNoEscape;
|
||||
withFileTypes;
|
||||
includeChildMatches;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns;
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern, opts) {
|
||||
/* c8 ignore start */
|
||||
if (!opts)
|
||||
throw new TypeError('glob options required');
|
||||
/* c8 ignore stop */
|
||||
this.withFileTypes = !!opts.withFileTypes;
|
||||
this.signal = opts.signal;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.dotRelative = !!opts.dotRelative;
|
||||
this.nodir = !!opts.nodir;
|
||||
this.mark = !!opts.mark;
|
||||
if (!opts.cwd) {
|
||||
this.cwd = '';
|
||||
}
|
||||
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
||||
opts.cwd = fileURLToPath(opts.cwd);
|
||||
}
|
||||
this.cwd = opts.cwd || '';
|
||||
this.root = opts.root;
|
||||
this.magicalBraces = !!opts.magicalBraces;
|
||||
this.nobrace = !!opts.nobrace;
|
||||
this.noext = !!opts.noext;
|
||||
this.realpath = !!opts.realpath;
|
||||
this.absolute = opts.absolute;
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
this.noglobstar = !!opts.noglobstar;
|
||||
this.matchBase = !!opts.matchBase;
|
||||
this.maxDepth =
|
||||
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
|
||||
this.stat = !!opts.stat;
|
||||
this.ignore = opts.ignore;
|
||||
if (this.withFileTypes && this.absolute !== undefined) {
|
||||
throw new Error('cannot set absolute and withFileTypes:true');
|
||||
}
|
||||
if (typeof pattern === 'string') {
|
||||
pattern = [pattern];
|
||||
}
|
||||
this.windowsPathsNoEscape =
|
||||
!!opts.windowsPathsNoEscape ||
|
||||
opts.allowWindowsEscape ===
|
||||
false;
|
||||
if (this.windowsPathsNoEscape) {
|
||||
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
||||
}
|
||||
if (this.matchBase) {
|
||||
if (opts.noglobstar) {
|
||||
throw new TypeError('base matching requires globstar');
|
||||
}
|
||||
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
|
||||
}
|
||||
this.pattern = pattern;
|
||||
this.platform = opts.platform || defaultPlatform;
|
||||
this.opts = { ...opts, platform: this.platform };
|
||||
if (opts.scurry) {
|
||||
this.scurry = opts.scurry;
|
||||
if (opts.nocase !== undefined &&
|
||||
opts.nocase !== opts.scurry.nocase) {
|
||||
throw new Error('nocase option contradicts provided scurry option');
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Scurry = opts.platform === 'win32' ? PathScurryWin32
|
||||
: opts.platform === 'darwin' ? PathScurryDarwin
|
||||
: opts.platform ? PathScurryPosix
|
||||
: PathScurry;
|
||||
this.scurry = new Scurry(this.cwd, {
|
||||
nocase: opts.nocase,
|
||||
fs: opts.fs,
|
||||
});
|
||||
}
|
||||
this.nocase = this.scurry.nocase;
|
||||
// If you do nocase:true on a case-sensitive file system, then
|
||||
// we need to use regexps instead of strings for non-magic
|
||||
// path portions, because statting `aBc` won't return results
|
||||
// for the file `AbC` for example.
|
||||
const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
|
||||
const mmo = {
|
||||
// default nocase based on platform
|
||||
...opts,
|
||||
dot: this.dot,
|
||||
matchBase: this.matchBase,
|
||||
nobrace: this.nobrace,
|
||||
nocase: this.nocase,
|
||||
nocaseMagicOnly,
|
||||
nocomment: true,
|
||||
noext: this.noext,
|
||||
nonegate: true,
|
||||
optimizationLevel: 2,
|
||||
platform: this.platform,
|
||||
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
||||
debug: !!this.opts.debug,
|
||||
};
|
||||
const mms = this.pattern.map(p => new Minimatch(p, mmo));
|
||||
const [matchSet, globParts] = mms.reduce((set, m) => {
|
||||
set[0].push(...m.set);
|
||||
set[1].push(...m.globParts);
|
||||
return set;
|
||||
}, [[], []]);
|
||||
this.patterns = matchSet.map((set, i) => {
|
||||
const g = globParts[i];
|
||||
/* c8 ignore start */
|
||||
if (!g)
|
||||
throw new Error('invalid pattern object');
|
||||
/* c8 ignore stop */
|
||||
return new Pattern(set, g, 0, this.platform);
|
||||
});
|
||||
}
|
||||
async walk() {
|
||||
// Walkers always return array of Path objects, so we just have to
|
||||
// coerce them into the right shape. It will have already called
|
||||
// realpath() if the option was set to do so, so we know that's cached.
|
||||
// start out knowing the cwd, at least
|
||||
return [
|
||||
...(await new GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walk()),
|
||||
];
|
||||
}
|
||||
walkSync() {
|
||||
return [
|
||||
...new GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walkSync(),
|
||||
];
|
||||
}
|
||||
stream() {
|
||||
return new GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).stream();
|
||||
}
|
||||
streamSync() {
|
||||
return new GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).streamSync();
|
||||
}
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync() {
|
||||
return this.streamSync()[Symbol.iterator]();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.iterateSync();
|
||||
}
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate() {
|
||||
return this.stream()[Symbol.asyncIterator]();
|
||||
}
|
||||
[Symbol.asyncIterator]() {
|
||||
return this.iterate();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=glob.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/glob.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.d.ts
generated
vendored
Normal file
14
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { GlobOptions } from './glob.js';
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
//# sourceMappingURL=has-magic.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAS,WAAgB,KACxB,OAQF,CAAA"}
|
||||
23
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.js
generated
vendored
Normal file
23
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Minimatch } from 'minimatch';
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
export const hasMagic = (pattern, options = {}) => {
|
||||
if (!Array.isArray(pattern)) {
|
||||
pattern = [pattern];
|
||||
}
|
||||
for (const p of pattern) {
|
||||
if (new Minimatch(p, options).hasMagic())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
//# sourceMappingURL=has-magic.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/has-magic.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAGrC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}
|
||||
24
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.d.ts
generated
vendored
Normal file
24
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Minimatch, MinimatchOptions } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
export interface IgnoreLike {
|
||||
ignored?: (p: Path) => boolean;
|
||||
childrenIgnored?: (p: Path) => boolean;
|
||||
add?: (ignore: string) => void;
|
||||
}
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
export declare class Ignore implements IgnoreLike {
|
||||
relative: Minimatch[];
|
||||
relativeChildren: Minimatch[];
|
||||
absolute: Minimatch[];
|
||||
absoluteChildren: Minimatch[];
|
||||
platform: NodeJS.Platform;
|
||||
mmopts: MinimatchOptions;
|
||||
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
|
||||
add(ign: string): void;
|
||||
ignored(p: Path): boolean;
|
||||
childrenIgnored(p: Path): boolean;
|
||||
}
|
||||
//# sourceMappingURL=ignore.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}
|
||||
115
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.js
generated
vendored
Normal file
115
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
// give it a pattern, and it'll be able to tell you if
|
||||
// a given path should be ignored.
|
||||
// Ignoring a path ignores its children if the pattern ends in /**
|
||||
// Ignores are always parsed in dot:true mode
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Pattern } from './pattern.js';
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
export class Ignore {
|
||||
relative;
|
||||
relativeChildren;
|
||||
absolute;
|
||||
absoluteChildren;
|
||||
platform;
|
||||
mmopts;
|
||||
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
|
||||
this.relative = [];
|
||||
this.absolute = [];
|
||||
this.relativeChildren = [];
|
||||
this.absoluteChildren = [];
|
||||
this.platform = platform;
|
||||
this.mmopts = {
|
||||
dot: true,
|
||||
nobrace,
|
||||
nocase,
|
||||
noext,
|
||||
noglobstar,
|
||||
optimizationLevel: 2,
|
||||
platform,
|
||||
nocomment: true,
|
||||
nonegate: true,
|
||||
};
|
||||
for (const ign of ignored)
|
||||
this.add(ign);
|
||||
}
|
||||
add(ign) {
|
||||
// this is a little weird, but it gives us a clean set of optimized
|
||||
// minimatch matchers, without getting tripped up if one of them
|
||||
// ends in /** inside a brace section, and it's only inefficient at
|
||||
// the start of the walk, not along it.
|
||||
// It'd be nice if the Pattern class just had a .test() method, but
|
||||
// handling globstars is a bit of a pita, and that code already lives
|
||||
// in minimatch anyway.
|
||||
// Another way would be if maybe Minimatch could take its set/globParts
|
||||
// as an option, and then we could at least just use Pattern to test
|
||||
// for absolute-ness.
|
||||
// Yet another way, Minimatch could take an array of glob strings, and
|
||||
// a cwd option, and do the right thing.
|
||||
const mm = new Minimatch(ign, this.mmopts);
|
||||
for (let i = 0; i < mm.set.length; i++) {
|
||||
const parsed = mm.set[i];
|
||||
const globParts = mm.globParts[i];
|
||||
/* c8 ignore start */
|
||||
if (!parsed || !globParts) {
|
||||
throw new Error('invalid pattern object');
|
||||
}
|
||||
// strip off leading ./ portions
|
||||
// https://github.com/isaacs/node-glob/issues/570
|
||||
while (parsed[0] === '.' && globParts[0] === '.') {
|
||||
parsed.shift();
|
||||
globParts.shift();
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const p = new Pattern(parsed, globParts, 0, this.platform);
|
||||
const m = new Minimatch(p.globString(), this.mmopts);
|
||||
const children = globParts[globParts.length - 1] === '**';
|
||||
const absolute = p.isAbsolute();
|
||||
if (absolute)
|
||||
this.absolute.push(m);
|
||||
else
|
||||
this.relative.push(m);
|
||||
if (children) {
|
||||
if (absolute)
|
||||
this.absoluteChildren.push(m);
|
||||
else
|
||||
this.relativeChildren.push(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
ignored(p) {
|
||||
const fullpath = p.fullpath();
|
||||
const fullpaths = `${fullpath}/`;
|
||||
const relative = p.relative() || '.';
|
||||
const relatives = `${relative}/`;
|
||||
for (const m of this.relative) {
|
||||
if (m.match(relative) || m.match(relatives))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absolute) {
|
||||
if (m.match(fullpath) || m.match(fullpaths))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
childrenIgnored(p) {
|
||||
const fullpath = p.fullpath() + '/';
|
||||
const relative = (p.relative() || '.') + '/';
|
||||
for (const m of this.relativeChildren) {
|
||||
if (m.match(relative))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absoluteChildren) {
|
||||
if (m.match(fullpath))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=ignore.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/ignore.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
97
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.d.ts
generated
vendored
Normal file
97
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
import { Minipass } from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
|
||||
import { Glob } from './glob.js';
|
||||
export { escape, unescape } from 'minimatch';
|
||||
export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry';
|
||||
export { Glob } from './glob.js';
|
||||
export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
|
||||
export { hasMagic } from './has-magic.js';
|
||||
export { Ignore } from './ignore.js';
|
||||
export type { IgnoreLike } from './ignore.js';
|
||||
export type { MatchStream } from './walker.js';
|
||||
/**
|
||||
* Syncronous form of {@link globStream}. Will read all the matches as fast as
|
||||
* you consume them, even all in a single tick if you consume them immediately,
|
||||
* but will still respond to backpressure if they're not consumed immediately.
|
||||
*/
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Return a stream that emits all the strings or `Path` objects and
|
||||
* then emits `end` when completed.
|
||||
*/
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Synchronous form of {@link glob}
|
||||
*/
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
|
||||
export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
|
||||
/**
|
||||
* Perform an asynchronous glob search for the pattern(s) specified. Returns
|
||||
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
|
||||
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
|
||||
* full option descriptions.
|
||||
*/
|
||||
declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
|
||||
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
|
||||
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
|
||||
declare function glob_(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
|
||||
/**
|
||||
* Return a sync iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
|
||||
/**
|
||||
* Return an async iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
|
||||
export declare const streamSync: typeof globStreamSync;
|
||||
export declare const stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
export declare const iterateSync: typeof globIterateSync;
|
||||
export declare const iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
export declare const sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
export declare const glob: typeof glob_ & {
|
||||
glob: typeof glob_;
|
||||
globSync: typeof globSync;
|
||||
sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
globStream: typeof globStream;
|
||||
stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof globStreamSync;
|
||||
streamSync: typeof globStreamSync;
|
||||
globIterate: typeof globIterate;
|
||||
iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof globIterateSync;
|
||||
iterateSync: typeof globIterateSync;
|
||||
Glob: typeof Glob;
|
||||
hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,YAAY,EACV,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,4BAA4B,EAC5B,6B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AAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACnC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACrC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,WAAW,GACnB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AASxE,eAAO,MAAM,UAAU,uBAAiB,CAAA;AACxC,eAAO,MAAM,MAAM;;CAAsD,CAAA;AACzE,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,OAAO;;CAElB,CAAA;AACF,eAAO,MAAM,IAAI;;;CAGf,CAAA;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAgBf,CAAA"}
|
||||
55
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.js
generated
vendored
Normal file
55
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { escape, unescape } from 'minimatch';
|
||||
import { Glob } from './glob.js';
|
||||
import { hasMagic } from './has-magic.js';
|
||||
export { escape, unescape } from 'minimatch';
|
||||
export { Glob } from './glob.js';
|
||||
export { hasMagic } from './has-magic.js';
|
||||
export { Ignore } from './ignore.js';
|
||||
export function globStreamSync(pattern, options = {}) {
|
||||
return new Glob(pattern, options).streamSync();
|
||||
}
|
||||
export function globStream(pattern, options = {}) {
|
||||
return new Glob(pattern, options).stream();
|
||||
}
|
||||
export function globSync(pattern, options = {}) {
|
||||
return new Glob(pattern, options).walkSync();
|
||||
}
|
||||
async function glob_(pattern, options = {}) {
|
||||
return new Glob(pattern, options).walk();
|
||||
}
|
||||
export function globIterateSync(pattern, options = {}) {
|
||||
return new Glob(pattern, options).iterateSync();
|
||||
}
|
||||
export function globIterate(pattern, options = {}) {
|
||||
return new Glob(pattern, options).iterate();
|
||||
}
|
||||
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
|
||||
export const streamSync = globStreamSync;
|
||||
export const stream = Object.assign(globStream, { sync: globStreamSync });
|
||||
export const iterateSync = globIterateSync;
|
||||
export const iterate = Object.assign(globIterate, {
|
||||
sync: globIterateSync,
|
||||
});
|
||||
export const sync = Object.assign(globSync, {
|
||||
stream: globStreamSync,
|
||||
iterate: globIterateSync,
|
||||
});
|
||||
export const glob = Object.assign(glob_, {
|
||||
glob: glob_,
|
||||
globSync,
|
||||
sync,
|
||||
globStream,
|
||||
stream,
|
||||
globStreamSync,
|
||||
streamSync,
|
||||
globIterate,
|
||||
iterate,
|
||||
globIterateSync,
|
||||
iterateSync,
|
||||
Glob,
|
||||
hasMagic,
|
||||
escape,
|
||||
unescape,
|
||||
});
|
||||
glob.glob = glob;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/package.json
generated
vendored
Normal file
3
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
76
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.d.ts
generated
vendored
Normal file
76
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.d.ts
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
export type MMPattern = string | RegExp | typeof GLOBSTAR;
|
||||
export type PatternList = [p: MMPattern, ...rest: MMPattern[]];
|
||||
export type UNCPatternList = [
|
||||
p0: '',
|
||||
p1: '',
|
||||
p2: string,
|
||||
p3: string,
|
||||
...rest: MMPattern[]
|
||||
];
|
||||
export type DrivePatternList = [p0: string, ...rest: MMPattern[]];
|
||||
export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]];
|
||||
export type GlobList = [p: string, ...rest: string[]];
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
export declare class Pattern {
|
||||
#private;
|
||||
readonly length: number;
|
||||
constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform);
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern(): MMPattern;
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString(): boolean;
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar(): boolean;
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp(): boolean;
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString(): string;
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore(): boolean;
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest(): Pattern | null;
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC(): boolean;
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive(): boolean;
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute(): boolean;
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root(): string;
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar(): boolean;
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar(): boolean;
|
||||
}
|
||||
//# sourceMappingURL=pattern.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ,CAAA;AAGzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,GAAG,IAAI,EAAE,SAAS,EAAE;CACrB,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AACjE,MAAM,MAAM,mBAAmB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAChE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAMrD;;;GAGG;AACH,qBAAa,OAAO;;IAIlB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAUrB,WAAW,EAAE,SAAS,EAAE,EACxB,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,CAAC,QAAQ;IA6D3B;;OAEG;IACH,OAAO,IAAI,SAAS;IAIpB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAGnB;;OAEG;IACH,UAAU,IAAI,OAAO;IAGrB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,UAAU,IAAI,MAAM;IAUpB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,IAAI,IAAI,OAAO,GAAG,IAAI;IAetB;;OAEG;IACH,KAAK,IAAI,OAAO;IAoBhB;;OAEG;IACH,OAAO,IAAI,OAAO;IAelB;;OAEG;IACH,UAAU,IAAI,OAAO;IAUrB;;OAEG;IACH,IAAI,IAAI,MAAM;IASd;;;OAGG;IACH,mBAAmB,IAAI,OAAO;IAQ9B;;OAEG;IACH,kBAAkB,IAAI,OAAO;CAM9B"}
|
||||
215
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.js
generated
vendored
Normal file
215
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.js
generated
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
// this is just a very light wrapper around 2 arrays with an offset index
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
const isPatternList = (pl) => pl.length >= 1;
|
||||
const isGlobList = (gl) => gl.length >= 1;
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
export class Pattern {
|
||||
#patternList;
|
||||
#globList;
|
||||
#index;
|
||||
length;
|
||||
#platform;
|
||||
#rest;
|
||||
#globString;
|
||||
#isDrive;
|
||||
#isUNC;
|
||||
#isAbsolute;
|
||||
#followGlobstar = true;
|
||||
constructor(patternList, globList, index, platform) {
|
||||
if (!isPatternList(patternList)) {
|
||||
throw new TypeError('empty pattern list');
|
||||
}
|
||||
if (!isGlobList(globList)) {
|
||||
throw new TypeError('empty glob list');
|
||||
}
|
||||
if (globList.length !== patternList.length) {
|
||||
throw new TypeError('mismatched pattern list and glob list lengths');
|
||||
}
|
||||
this.length = patternList.length;
|
||||
if (index < 0 || index >= this.length) {
|
||||
throw new TypeError('index out of range');
|
||||
}
|
||||
this.#patternList = patternList;
|
||||
this.#globList = globList;
|
||||
this.#index = index;
|
||||
this.#platform = platform;
|
||||
// normalize root entries of absolute patterns on initial creation.
|
||||
if (this.#index === 0) {
|
||||
// c: => ['c:/']
|
||||
// C:/ => ['C:/']
|
||||
// C:/x => ['C:/', 'x']
|
||||
// //host/share => ['//host/share/']
|
||||
// //host/share/ => ['//host/share/']
|
||||
// //host/share/x => ['//host/share/', 'x']
|
||||
// /etc => ['/', 'etc']
|
||||
// / => ['/']
|
||||
if (this.isUNC()) {
|
||||
// '' / '' / 'host' / 'share'
|
||||
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
||||
const [g0, g1, g2, g3, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = [p0, p1, p2, p3, ''].join('/');
|
||||
const g = [g0, g1, g2, g3, ''].join('/');
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
else if (this.isDrive() || this.isAbsolute()) {
|
||||
const [p1, ...prest] = this.#patternList;
|
||||
const [g1, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = p1 + '/';
|
||||
const g = g1 + '/';
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern() {
|
||||
return this.#patternList[this.#index];
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString() {
|
||||
return typeof this.#patternList[this.#index] === 'string';
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar() {
|
||||
return this.#patternList[this.#index] === GLOBSTAR;
|
||||
}
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp() {
|
||||
return this.#patternList[this.#index] instanceof RegExp;
|
||||
}
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString() {
|
||||
return (this.#globString =
|
||||
this.#globString ||
|
||||
(this.#index === 0 ?
|
||||
this.isAbsolute() ?
|
||||
this.#globList[0] + this.#globList.slice(1).join('/')
|
||||
: this.#globList.join('/')
|
||||
: this.#globList.slice(this.#index).join('/')));
|
||||
}
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore() {
|
||||
return this.length > this.#index + 1;
|
||||
}
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest() {
|
||||
if (this.#rest !== undefined)
|
||||
return this.#rest;
|
||||
if (!this.hasMore())
|
||||
return (this.#rest = null);
|
||||
this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
|
||||
this.#rest.#isAbsolute = this.#isAbsolute;
|
||||
this.#rest.#isUNC = this.#isUNC;
|
||||
this.#rest.#isDrive = this.#isDrive;
|
||||
return this.#rest;
|
||||
}
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isUNC !== undefined ?
|
||||
this.#isUNC
|
||||
: (this.#isUNC =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
pl[0] === '' &&
|
||||
pl[1] === '' &&
|
||||
typeof pl[2] === 'string' &&
|
||||
!!pl[2] &&
|
||||
typeof pl[3] === 'string' &&
|
||||
!!pl[3]);
|
||||
}
|
||||
// pattern like C:/...
|
||||
// split = ['C:', ...]
|
||||
// XXX: would be nice to handle patterns like `c:*` to test the cwd
|
||||
// in c: for *, but I don't know of a way to even figure out what that
|
||||
// cwd is without actually chdir'ing into it?
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isDrive !== undefined ?
|
||||
this.#isDrive
|
||||
: (this.#isDrive =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
this.length > 1 &&
|
||||
typeof pl[0] === 'string' &&
|
||||
/^[a-z]:$/i.test(pl[0]));
|
||||
}
|
||||
// pattern = '/' or '/...' or '/x/...'
|
||||
// split = ['', ''] or ['', ...] or ['', 'x', ...]
|
||||
// Drive and UNC both considered absolute on windows
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isAbsolute !== undefined ?
|
||||
this.#isAbsolute
|
||||
: (this.#isAbsolute =
|
||||
(pl[0] === '' && pl.length > 1) ||
|
||||
this.isDrive() ||
|
||||
this.isUNC());
|
||||
}
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root() {
|
||||
const p = this.#patternList[0];
|
||||
return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
|
||||
p
|
||||
: '';
|
||||
}
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar() {
|
||||
return !(this.#index === 0 ||
|
||||
!this.isGlobstar() ||
|
||||
!this.#followGlobstar);
|
||||
}
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar() {
|
||||
if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
|
||||
return false;
|
||||
this.#followGlobstar = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=pattern.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/pattern.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.d.ts
generated
vendored
Normal file
59
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { MMRegExp } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
export declare class HasWalkedCache {
|
||||
store: Map<string, Set<string>>;
|
||||
constructor(store?: Map<string, Set<string>>);
|
||||
copy(): HasWalkedCache;
|
||||
hasWalked(target: Path, pattern: Pattern): boolean | undefined;
|
||||
storeWalked(target: Path, pattern: Pattern): void;
|
||||
}
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
export declare class MatchRecord {
|
||||
store: Map<Path, number>;
|
||||
add(target: Path, absolute: boolean, ifDir: boolean): void;
|
||||
entries(): [Path, boolean, boolean][];
|
||||
}
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
export declare class SubWalks {
|
||||
store: Map<Path, Pattern[]>;
|
||||
add(target: Path, pattern: Pattern): void;
|
||||
get(target: Path): Pattern[];
|
||||
entries(): [Path, Pattern[]][];
|
||||
keys(): Path[];
|
||||
}
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
export declare class Processor {
|
||||
hasWalkedCache: HasWalkedCache;
|
||||
matches: MatchRecord;
|
||||
subwalks: SubWalks;
|
||||
patterns?: Pattern[];
|
||||
follow: boolean;
|
||||
dot: boolean;
|
||||
opts: GlobWalkerOpts;
|
||||
constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache);
|
||||
processPatterns(target: Path, patterns: Pattern[]): this;
|
||||
subwalkTargets(): Path[];
|
||||
child(): Processor;
|
||||
filterEntries(parent: Path, entries: Path[]): Processor;
|
||||
testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void;
|
||||
testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void;
|
||||
testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void;
|
||||
}
|
||||
//# sourceMappingURL=processor.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAa,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,qBAAa,cAAc;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;gBACnB,KAAK,GAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAGvD,IAAI;IAGJ,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;IAGxC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;CAM3C;AAED;;;;GAIG;AACH,qBAAa,WAAW;IACtB,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAY;IACpC,GAAG,CAAC,MAAM,EAAE,IAAI,EAA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I,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"}
|
||||
294
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.js
generated
vendored
Normal file
294
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.js
generated
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
// synchronous utility for filtering entries and calculating subwalks
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
export class HasWalkedCache {
|
||||
store;
|
||||
constructor(store = new Map()) {
|
||||
this.store = store;
|
||||
}
|
||||
copy() {
|
||||
return new HasWalkedCache(new Map(this.store));
|
||||
}
|
||||
hasWalked(target, pattern) {
|
||||
return this.store.get(target.fullpath())?.has(pattern.globString());
|
||||
}
|
||||
storeWalked(target, pattern) {
|
||||
const fullpath = target.fullpath();
|
||||
const cached = this.store.get(fullpath);
|
||||
if (cached)
|
||||
cached.add(pattern.globString());
|
||||
else
|
||||
this.store.set(fullpath, new Set([pattern.globString()]));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
export class MatchRecord {
|
||||
store = new Map();
|
||||
add(target, absolute, ifDir) {
|
||||
const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
|
||||
const current = this.store.get(target);
|
||||
this.store.set(target, current === undefined ? n : n & current);
|
||||
}
|
||||
// match, absolute, ifdir
|
||||
entries() {
|
||||
return [...this.store.entries()].map(([path, n]) => [
|
||||
path,
|
||||
!!(n & 2),
|
||||
!!(n & 1),
|
||||
]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
export class SubWalks {
|
||||
store = new Map();
|
||||
add(target, pattern) {
|
||||
if (!target.canReaddir()) {
|
||||
return;
|
||||
}
|
||||
const subs = this.store.get(target);
|
||||
if (subs) {
|
||||
if (!subs.find(p => p.globString() === pattern.globString())) {
|
||||
subs.push(pattern);
|
||||
}
|
||||
}
|
||||
else
|
||||
this.store.set(target, [pattern]);
|
||||
}
|
||||
get(target) {
|
||||
const subs = this.store.get(target);
|
||||
/* c8 ignore start */
|
||||
if (!subs) {
|
||||
throw new Error('attempting to walk unknown path');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
return subs;
|
||||
}
|
||||
entries() {
|
||||
return this.keys().map(k => [k, this.store.get(k)]);
|
||||
}
|
||||
keys() {
|
||||
return [...this.store.keys()].filter(t => t.canReaddir());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
export class Processor {
|
||||
hasWalkedCache;
|
||||
matches = new MatchRecord();
|
||||
subwalks = new SubWalks();
|
||||
patterns;
|
||||
follow;
|
||||
dot;
|
||||
opts;
|
||||
constructor(opts, hasWalkedCache) {
|
||||
this.opts = opts;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.hasWalkedCache =
|
||||
hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();
|
||||
}
|
||||
processPatterns(target, patterns) {
|
||||
this.patterns = patterns;
|
||||
const processingSet = patterns.map(p => [target, p]);
|
||||
// map of paths to the magic-starting subwalks they need to walk
|
||||
// first item in patterns is the filter
|
||||
for (let [t, pattern] of processingSet) {
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
const root = pattern.root();
|
||||
const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
|
||||
// start absolute patterns at root
|
||||
if (root) {
|
||||
t = t.resolve(root === '/' && this.opts.root !== undefined ?
|
||||
this.opts.root
|
||||
: root);
|
||||
const rest = pattern.rest();
|
||||
if (!rest) {
|
||||
this.matches.add(t, true, false);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
pattern = rest;
|
||||
}
|
||||
}
|
||||
if (t.isENOENT())
|
||||
continue;
|
||||
let p;
|
||||
let rest;
|
||||
let changed = false;
|
||||
while (typeof (p = pattern.pattern()) === 'string' &&
|
||||
(rest = pattern.rest())) {
|
||||
const c = t.resolve(p);
|
||||
t = c;
|
||||
pattern = rest;
|
||||
changed = true;
|
||||
}
|
||||
p = pattern.pattern();
|
||||
rest = pattern.rest();
|
||||
if (changed) {
|
||||
if (this.hasWalkedCache.hasWalked(t, pattern))
|
||||
continue;
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
}
|
||||
// now we have either a final string for a known entry,
|
||||
// more strings for an unknown entry,
|
||||
// or a pattern starting with magic, mounted on t.
|
||||
if (typeof p === 'string') {
|
||||
// must not be final entry, otherwise we would have
|
||||
// concatenated it earlier.
|
||||
const ifDir = p === '..' || p === '' || p === '.';
|
||||
this.matches.add(t.resolve(p), absolute, ifDir);
|
||||
continue;
|
||||
}
|
||||
else if (p === GLOBSTAR) {
|
||||
// if no rest, match and subwalk pattern
|
||||
// if rest, process rest and subwalk pattern
|
||||
// if it's a symlink, but we didn't get here by way of a
|
||||
// globstar match (meaning it's the first time THIS globstar
|
||||
// has traversed a symlink), then we follow it. Otherwise, stop.
|
||||
if (!t.isSymbolicLink() ||
|
||||
this.follow ||
|
||||
pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
const rp = rest?.pattern();
|
||||
const rrest = rest?.rest();
|
||||
if (!rest || ((rp === '' || rp === '.') && !rrest)) {
|
||||
// only HAS to be a dir if it ends in **/ or **/.
|
||||
// but ending in ** will match files as well.
|
||||
this.matches.add(t, absolute, rp === '' || rp === '.');
|
||||
}
|
||||
else {
|
||||
if (rp === '..') {
|
||||
// this would mean you're matching **/.. at the fs root,
|
||||
// and no thanks, I'm not gonna test that specific case.
|
||||
/* c8 ignore start */
|
||||
const tp = t.parent || t;
|
||||
/* c8 ignore stop */
|
||||
if (!rrest)
|
||||
this.matches.add(tp, absolute, true);
|
||||
else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
|
||||
this.subwalks.add(tp, rrest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
subwalkTargets() {
|
||||
return this.subwalks.keys();
|
||||
}
|
||||
child() {
|
||||
return new Processor(this.opts, this.hasWalkedCache);
|
||||
}
|
||||
// return a new Processor containing the subwalks for each
|
||||
// child entry, and a set of matches, and
|
||||
// a hasWalkedCache that's a copy of this one
|
||||
// then we're going to call
|
||||
filterEntries(parent, entries) {
|
||||
const patterns = this.subwalks.get(parent);
|
||||
// put matches and entry walks into the results processor
|
||||
const results = this.child();
|
||||
for (const e of entries) {
|
||||
for (const pattern of patterns) {
|
||||
const absolute = pattern.isAbsolute();
|
||||
const p = pattern.pattern();
|
||||
const rest = pattern.rest();
|
||||
if (p === GLOBSTAR) {
|
||||
results.testGlobstar(e, pattern, rest, absolute);
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
results.testRegExp(e, p, rest, absolute);
|
||||
}
|
||||
else {
|
||||
results.testString(e, p, rest, absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
testGlobstar(e, pattern, rest, absolute) {
|
||||
if (this.dot || !e.name.startsWith('.')) {
|
||||
if (!pattern.hasMore()) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
if (e.canReaddir()) {
|
||||
// if we're in follow mode or it's not a symlink, just keep
|
||||
// testing the same pattern. If there's more after the globstar,
|
||||
// then this symlink consumes the globstar. If not, then we can
|
||||
// follow at most ONE symlink along the way, so we mark it, which
|
||||
// also checks to ensure that it wasn't already marked.
|
||||
if (this.follow || !e.isSymbolicLink()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
else if (e.isSymbolicLink()) {
|
||||
if (rest && pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
else if (pattern.markFollowGlobstar()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if the NEXT thing matches this entry, then also add
|
||||
// the rest.
|
||||
if (rest) {
|
||||
const rp = rest.pattern();
|
||||
if (typeof rp === 'string' &&
|
||||
// dots and empty were handled already
|
||||
rp !== '..' &&
|
||||
rp !== '' &&
|
||||
rp !== '.') {
|
||||
this.testString(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
else if (rp === '..') {
|
||||
/* c8 ignore start */
|
||||
const ep = e.parent || e;
|
||||
/* c8 ignore stop */
|
||||
this.subwalks.add(ep, rest);
|
||||
}
|
||||
else if (rp instanceof RegExp) {
|
||||
this.testRegExp(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
testRegExp(e, p, rest, absolute) {
|
||||
if (!p.test(e.name))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
testString(e, p, rest, absolute) {
|
||||
// should never happen?
|
||||
if (!e.isNamed(p))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=processor.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/processor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
97
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.d.ts
generated
vendored
Normal file
97
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
import { Minipass } from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { Processor } from './processor.js';
|
||||
export interface GlobWalkerOpts {
|
||||
absolute?: boolean;
|
||||
allowWindowsEscape?: boolean;
|
||||
cwd?: string | URL;
|
||||
dot?: boolean;
|
||||
dotRelative?: boolean;
|
||||
follow?: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
mark?: boolean;
|
||||
matchBase?: boolean;
|
||||
maxDepth?: number;
|
||||
nobrace?: boolean;
|
||||
nocase?: boolean;
|
||||
nodir?: boolean;
|
||||
noext?: boolean;
|
||||
noglobstar?: boolean;
|
||||
platform?: NodeJS.Platform;
|
||||
posix?: boolean;
|
||||
realpath?: boolean;
|
||||
root?: string;
|
||||
stat?: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape?: boolean;
|
||||
withFileTypes?: boolean;
|
||||
includeChildMatches?: boolean;
|
||||
}
|
||||
export type GWOFileTypesTrue = GlobWalkerOpts & {
|
||||
withFileTypes: true;
|
||||
};
|
||||
export type GWOFileTypesFalse = GlobWalkerOpts & {
|
||||
withFileTypes: false;
|
||||
};
|
||||
export type GWOFileTypesUnset = GlobWalkerOpts & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
|
||||
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
||||
export type MatchStream<O extends GlobWalkerOpts> = Minipass<Result<O>, Result<O>>;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {
|
||||
#private;
|
||||
path: Path;
|
||||
patterns: Pattern[];
|
||||
opts: O;
|
||||
seen: Set<Path>;
|
||||
paused: boolean;
|
||||
aborted: boolean;
|
||||
signal?: AbortSignal;
|
||||
maxDepth: number;
|
||||
includeChildMatches: boolean;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
onResume(fn: () => any): void;
|
||||
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
|
||||
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
|
||||
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
|
||||
abstract matchEmit(p: Result<O>): void;
|
||||
abstract matchEmit(p: string | Path): void;
|
||||
matchFinish(e: Path, absolute: boolean): void;
|
||||
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
|
||||
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
|
||||
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
}
|
||||
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
matches: Set<Result<O>>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
walk(): Promise<Set<Result<O>>>;
|
||||
walkSync(): Set<Result<O>>;
|
||||
}
|
||||
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
results: Minipass<Result<O>, Result<O>>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
stream(): MatchStream<O>;
|
||||
streamSync(): MatchStream<O>;
|
||||
}
|
||||
//# sourceMappingURL=walker.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAA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M,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;gBAE3B,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAUpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAK7B,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;IAYxB,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC;CAO7B"}
|
||||
381
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.js
generated
vendored
Normal file
381
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.js
generated
vendored
Normal file
@@ -0,0 +1,381 @@
|
||||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
import { Minipass } from 'minipass';
|
||||
import { Ignore } from './ignore.js';
|
||||
import { Processor } from './processor.js';
|
||||
const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new Ignore([ignore], opts)
|
||||
: Array.isArray(ignore) ? new Ignore(ignore, opts)
|
||||
: ignore;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
export class GlobUtil {
|
||||
path;
|
||||
patterns;
|
||||
opts;
|
||||
seen = new Set();
|
||||
paused = false;
|
||||
aborted = false;
|
||||
#onResume = [];
|
||||
#ignore;
|
||||
#sep;
|
||||
signal;
|
||||
maxDepth;
|
||||
includeChildMatches;
|
||||
constructor(patterns, path, opts) {
|
||||
this.patterns = patterns;
|
||||
this.path = path;
|
||||
this.opts = opts;
|
||||
this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
if (opts.ignore || !this.includeChildMatches) {
|
||||
this.#ignore = makeIgnore(opts.ignore ?? [], opts);
|
||||
if (!this.includeChildMatches &&
|
||||
typeof this.#ignore.add !== 'function') {
|
||||
const m = 'cannot ignore child matches, ignore lacks add() method.';
|
||||
throw new Error(m);
|
||||
}
|
||||
}
|
||||
// ignore, always set with maxDepth, but it's optional on the
|
||||
// GlobOptions type
|
||||
/* c8 ignore start */
|
||||
this.maxDepth = opts.maxDepth || Infinity;
|
||||
/* c8 ignore stop */
|
||||
if (opts.signal) {
|
||||
this.signal = opts.signal;
|
||||
this.signal.addEventListener('abort', () => {
|
||||
this.#onResume.length = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
#ignored(path) {
|
||||
return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
|
||||
}
|
||||
#childrenIgnored(path) {
|
||||
return !!this.#ignore?.childrenIgnored?.(path);
|
||||
}
|
||||
// backpressure mechanism
|
||||
pause() {
|
||||
this.paused = true;
|
||||
}
|
||||
resume() {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore stop */
|
||||
this.paused = false;
|
||||
let fn = undefined;
|
||||
while (!this.paused && (fn = this.#onResume.shift())) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
onResume(fn) {
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore start */
|
||||
if (!this.paused) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
/* c8 ignore stop */
|
||||
this.#onResume.push(fn);
|
||||
}
|
||||
}
|
||||
// do the requisite realpath/stat checking, and return the path
|
||||
// to add or undefined to filter it out.
|
||||
async matchCheck(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || (await e.realpath());
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
const s = needStat ? await e.lstat() : e;
|
||||
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
||||
const target = await s.realpath();
|
||||
/* c8 ignore start */
|
||||
if (target && (target.isUnknown() || this.opts.stat)) {
|
||||
await target.lstat();
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
return this.matchCheckTest(s, ifDir);
|
||||
}
|
||||
matchCheckTest(e, ifDir) {
|
||||
return (e &&
|
||||
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
|
||||
(!ifDir || e.canReaddir()) &&
|
||||
(!this.opts.nodir || !e.isDirectory()) &&
|
||||
(!this.opts.nodir ||
|
||||
!this.opts.follow ||
|
||||
!e.isSymbolicLink() ||
|
||||
!e.realpathCached()?.isDirectory()) &&
|
||||
!this.#ignored(e)) ?
|
||||
e
|
||||
: undefined;
|
||||
}
|
||||
matchCheckSync(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || e.realpathSync();
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
const s = needStat ? e.lstatSync() : e;
|
||||
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
||||
const target = s.realpathSync();
|
||||
if (target && (target?.isUnknown() || this.opts.stat)) {
|
||||
target.lstatSync();
|
||||
}
|
||||
}
|
||||
return this.matchCheckTest(s, ifDir);
|
||||
}
|
||||
matchFinish(e, absolute) {
|
||||
if (this.#ignored(e))
|
||||
return;
|
||||
// we know we have an ignore if this is false, but TS doesn't
|
||||
if (!this.includeChildMatches && this.#ignore?.add) {
|
||||
const ign = `${e.relativePosix()}/**`;
|
||||
this.#ignore.add(ign);
|
||||
}
|
||||
const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
|
||||
this.seen.add(e);
|
||||
const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
|
||||
// ok, we have what we need!
|
||||
if (this.opts.withFileTypes) {
|
||||
this.matchEmit(e);
|
||||
}
|
||||
else if (abs) {
|
||||
const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();
|
||||
this.matchEmit(abs + mark);
|
||||
}
|
||||
else {
|
||||
const rel = this.opts.posix ? e.relativePosix() : e.relative();
|
||||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?
|
||||
'.' + this.#sep
|
||||
: '';
|
||||
this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
|
||||
}
|
||||
}
|
||||
async match(e, absolute, ifDir) {
|
||||
const p = await this.matchCheck(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
matchSync(e, absolute, ifDir) {
|
||||
const p = this.matchCheckSync(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
walkCB(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2(target, patterns, new Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const childrenCached = t.readdirCached();
|
||||
if (t.calledReaddir())
|
||||
this.walkCB3(t, childrenCached, processor, next);
|
||||
else {
|
||||
t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
|
||||
}
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCBSync(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2Sync(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const children = t.readdirSync();
|
||||
this.walkCB3Sync(t, children, processor, next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3Sync(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2Sync(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
}
|
||||
export class GlobWalker extends GlobUtil {
|
||||
matches = new Set();
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.matches.add(e);
|
||||
}
|
||||
async walk() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
await this.path.lstat();
|
||||
}
|
||||
await new Promise((res, rej) => {
|
||||
this.walkCB(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted) {
|
||||
rej(this.signal.reason);
|
||||
}
|
||||
else {
|
||||
res(this.matches);
|
||||
}
|
||||
});
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
walkSync() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
// nothing for the callback to do, because this never pauses
|
||||
this.walkCBSync(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
}
|
||||
export class GlobStream extends GlobUtil {
|
||||
results;
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
this.results = new Minipass({
|
||||
signal: this.signal,
|
||||
objectMode: true,
|
||||
});
|
||||
this.results.on('drain', () => this.resume());
|
||||
this.results.on('resume', () => this.resume());
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.results.write(e);
|
||||
if (!this.results.flowing)
|
||||
this.pause();
|
||||
}
|
||||
stream() {
|
||||
const target = this.path;
|
||||
if (target.isUnknown()) {
|
||||
target.lstat().then(() => {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
}
|
||||
return this.results;
|
||||
}
|
||||
streamSync() {
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
this.walkCBSync(this.path, this.patterns, () => this.results.end());
|
||||
return this.results;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=walker.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/glob/dist/esm/walker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
93
backend/node_modules/@fastify/static/node_modules/glob/package.json
generated
vendored
Normal file
93
backend/node_modules/@fastify/static/node_modules/glob/package.json
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me/)",
|
||||
"name": "glob",
|
||||
"description": "the most correct and second fastest glob implementation in JavaScript",
|
||||
"version": "13.0.0",
|
||||
"type": "module",
|
||||
"tshy": {
|
||||
"main": true,
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./src/index.ts"
|
||||
}
|
||||
},
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:isaacs/node-glob.git"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "npm run benchclean; git push origin --follow-tags",
|
||||
"prepare": "tshy",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"format": "prettier --write . --log-level warn",
|
||||
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
|
||||
"profclean": "rm -f v8.log profile.txt",
|
||||
"test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts",
|
||||
"prebench": "npm run prepare",
|
||||
"bench": "bash benchmark.sh",
|
||||
"preprof": "npm run prepare",
|
||||
"prof": "bash prof.sh",
|
||||
"benchclean": "node benchclean.cjs"
|
||||
},
|
||||
"prettier": {
|
||||
"experimentalTernaries": true,
|
||||
"semi": false,
|
||||
"printWidth": 75,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": false,
|
||||
"bracketSameLine": true,
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "lf"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimatch": "^10.1.1",
|
||||
"minipass": "^7.1.2",
|
||||
"path-scurry": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.10.0",
|
||||
"memfs": "^4.50.0",
|
||||
"mkdirp": "^3.0.1",
|
||||
"prettier": "^3.6.2",
|
||||
"rimraf": "^6.1.0",
|
||||
"tap": "^21.1.3",
|
||||
"tshy": "^3.0.3",
|
||||
"typedoc": "^0.28.14"
|
||||
},
|
||||
"tap": {
|
||||
"before": "test/00-setup.ts"
|
||||
},
|
||||
"license": "BlueOak-1.0.0",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"module": "./dist/esm/index.js"
|
||||
}
|
||||
55
backend/node_modules/@fastify/static/node_modules/lru-cache/LICENSE.md
generated
vendored
Normal file
55
backend/node_modules/@fastify/static/node_modules/lru-cache/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# Blue Oak Model License
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
## Purpose
|
||||
|
||||
This license gives everyone as much permission to work with
|
||||
this software as possible, while protecting contributors
|
||||
from liability.
|
||||
|
||||
## Acceptance
|
||||
|
||||
In order to receive this license, you must agree to its
|
||||
rules. The rules of this license are both obligations
|
||||
under that agreement and conditions to your license.
|
||||
You must not do anything with this software that triggers
|
||||
a rule that you cannot or will not follow.
|
||||
|
||||
## Copyright
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe that contributor's
|
||||
copyright in it.
|
||||
|
||||
## Notices
|
||||
|
||||
You must ensure that everyone who gets a copy of
|
||||
any part of this software from you, with or without
|
||||
changes, also gets the text of this license or a link to
|
||||
<https://blueoakcouncil.org/license/1.0.0>.
|
||||
|
||||
## Excuse
|
||||
|
||||
If anyone notifies you in writing that you have not
|
||||
complied with [Notices](#notices), you can keep your
|
||||
license by taking all practical steps to comply within 30
|
||||
days after the notice. If you do not do so, your license
|
||||
ends immediately.
|
||||
|
||||
## Patent
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe any patent claims
|
||||
they can license or become able to license.
|
||||
|
||||
## Reliability
|
||||
|
||||
No contributor can revoke this license.
|
||||
|
||||
## No Liability
|
||||
|
||||
***As far as the law allows, this software comes as is,
|
||||
without any warranty or condition, and no contributor
|
||||
will be liable to anyone for any damages related to this
|
||||
software or this license, under any kind of legal claim.***
|
||||
334
backend/node_modules/@fastify/static/node_modules/lru-cache/README.md
generated
vendored
Normal file
334
backend/node_modules/@fastify/static/node_modules/lru-cache/README.md
generated
vendored
Normal file
@@ -0,0 +1,334 @@
|
||||
# lru-cache
|
||||
|
||||
A cache object that deletes the least-recently-used items.
|
||||
|
||||
Specify a max number of the most recently used items that you
|
||||
want to keep, and this cache will keep that many of the most
|
||||
recently accessed items.
|
||||
|
||||
This is not primarily a TTL cache, and does not make strong TTL
|
||||
guarantees. There is no preemptive pruning of expired items by
|
||||
default, but you _may_ set a TTL on the cache or on a single
|
||||
`set`. If you do so, it will treat expired items as missing, and
|
||||
delete them when fetched. If you are more interested in TTL
|
||||
caching than LRU caching, check out
|
||||
[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache).
|
||||
|
||||
As of version 7, this is one of the most performant LRU
|
||||
implementations available in JavaScript, and supports a wide
|
||||
diversity of use cases. However, note that using some of the
|
||||
features will necessarily impact performance, by causing the
|
||||
cache to have to do more work. See the "Performance" section
|
||||
below.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install lru-cache --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// hybrid module, either works
|
||||
import { LRUCache } from 'lru-cache'
|
||||
// or:
|
||||
const { LRUCache } = require('lru-cache')
|
||||
// or in minified form for web browsers:
|
||||
import { LRUCache } from 'http://unpkg.com/lru-cache@9/dist/mjs/index.min.mjs'
|
||||
|
||||
// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent
|
||||
// unsafe unbounded storage.
|
||||
//
|
||||
// In most cases, it's best to specify a max for performance, so all
|
||||
// the required memory allocation is done up-front.
|
||||
//
|
||||
// All the other options are optional, see the sections below for
|
||||
// documentation on what each one does. Most of them can be
|
||||
// overridden for specific items in get()/set()
|
||||
const options = {
|
||||
max: 500,
|
||||
|
||||
// for use with tracking overall storage size
|
||||
maxSize: 5000,
|
||||
sizeCalculation: (value, key) => {
|
||||
return 1
|
||||
},
|
||||
|
||||
// for use when you need to clean up something when objects
|
||||
// are evicted from the cache
|
||||
dispose: (value, key, reason) => {
|
||||
freeFromMemoryOrWhatever(value)
|
||||
},
|
||||
|
||||
// for use when you need to know that an item is being inserted
|
||||
// note that this does NOT allow you to prevent the insertion,
|
||||
// it just allows you to know about it.
|
||||
onInsert: (value, key, reason) => {
|
||||
logInsertionOrWhatever(key, value)
|
||||
},
|
||||
|
||||
// how long to live in ms
|
||||
ttl: 1000 * 60 * 5,
|
||||
|
||||
// return stale items before removing from cache?
|
||||
allowStale: false,
|
||||
|
||||
updateAgeOnGet: false,
|
||||
updateAgeOnHas: false,
|
||||
|
||||
// async method to use for cache.fetch(), for
|
||||
// stale-while-revalidate type of behavior
|
||||
fetchMethod: async (key, staleValue, { options, signal, context }) => {},
|
||||
}
|
||||
|
||||
const cache = new LRUCache(options)
|
||||
|
||||
cache.set('key', 'value')
|
||||
cache.get('key') // "value"
|
||||
|
||||
// non-string keys ARE fully supported
|
||||
// but note that it must be THE SAME object, not
|
||||
// just a JSON-equivalent object.
|
||||
var someObject = { a: 1 }
|
||||
cache.set(someObject, 'a value')
|
||||
// Object keys are not toString()-ed
|
||||
cache.set('[object Object]', 'a different value')
|
||||
assert.equal(cache.get(someObject), 'a value')
|
||||
// A similar object with same keys/values won't work,
|
||||
// because it's a different object identity
|
||||
assert.equal(cache.get({ a: 1 }), undefined)
|
||||
|
||||
cache.clear() // empty the cache
|
||||
```
|
||||
|
||||
If you put more stuff in the cache, then less recently used items
|
||||
will fall out. That's what an LRU cache is.
|
||||
|
||||
For full description of the API and all options, please see [the
|
||||
LRUCache typedocs](https://isaacs.github.io/node-lru-cache/)
|
||||
|
||||
## Storage Bounds Safety
|
||||
|
||||
This implementation aims to be as flexible as possible, within
|
||||
the limits of safe memory consumption and optimal performance.
|
||||
|
||||
At initial object creation, storage is allocated for `max` items.
|
||||
If `max` is set to zero, then some performance is lost, and item
|
||||
count is unbounded. Either `maxSize` or `ttl` _must_ be set if
|
||||
`max` is not specified.
|
||||
|
||||
If `maxSize` is set, then this creates a safe limit on the
|
||||
maximum storage consumed, but without the performance benefits of
|
||||
pre-allocation. When `maxSize` is set, every item _must_ provide
|
||||
a size, either via the `sizeCalculation` method provided to the
|
||||
constructor, or via a `size` or `sizeCalculation` option provided
|
||||
to `cache.set()`. The size of every item _must_ be a positive
|
||||
integer.
|
||||
|
||||
If neither `max` nor `maxSize` are set, then `ttl` tracking must
|
||||
be enabled. Note that, even when tracking item `ttl`, items are
|
||||
_not_ preemptively deleted when they become stale, unless
|
||||
`ttlAutopurge` is enabled. Instead, they are only purged the
|
||||
next time the key is requested. Thus, if `ttlAutopurge`, `max`,
|
||||
and `maxSize` are all not set, then the cache will potentially
|
||||
grow unbounded.
|
||||
|
||||
In this case, a warning is printed to standard error. Future
|
||||
versions may require the use of `ttlAutopurge` if `max` and
|
||||
`maxSize` are not specified.
|
||||
|
||||
If you truly wish to use a cache that is bound _only_ by TTL
|
||||
expiration, consider using a `Map` object, and calling
|
||||
`setTimeout` to delete entries when they expire. It will perform
|
||||
much better than an LRU cache.
|
||||
|
||||
Here is an implementation you may use, under the same
|
||||
[license](./LICENSE) as this package:
|
||||
|
||||
```js
|
||||
// a storage-unbounded ttl cache that is not an lru-cache
|
||||
const cache = {
|
||||
data: new Map(),
|
||||
timers: new Map(),
|
||||
set: (k, v, ttl) => {
|
||||
if (cache.timers.has(k)) {
|
||||
clearTimeout(cache.timers.get(k))
|
||||
}
|
||||
cache.timers.set(
|
||||
k,
|
||||
setTimeout(() => cache.delete(k), ttl),
|
||||
)
|
||||
cache.data.set(k, v)
|
||||
},
|
||||
get: k => cache.data.get(k),
|
||||
has: k => cache.data.has(k),
|
||||
delete: k => {
|
||||
if (cache.timers.has(k)) {
|
||||
clearTimeout(cache.timers.get(k))
|
||||
}
|
||||
cache.timers.delete(k)
|
||||
return cache.data.delete(k)
|
||||
},
|
||||
clear: () => {
|
||||
cache.data.clear()
|
||||
for (const v of cache.timers.values()) {
|
||||
clearTimeout(v)
|
||||
}
|
||||
cache.timers.clear()
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
If that isn't to your liking, check out
|
||||
[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache).
|
||||
|
||||
## Storing Undefined Values
|
||||
|
||||
This cache never stores undefined values, as `undefined` is used
|
||||
internally in a few places to indicate that a key is not in the
|
||||
cache.
|
||||
|
||||
You may call `cache.set(key, undefined)`, but this is just
|
||||
an alias for `cache.delete(key)`. Note that this has the effect
|
||||
that `cache.has(key)` will return _false_ after setting it to
|
||||
undefined.
|
||||
|
||||
```js
|
||||
cache.set(myKey, undefined)
|
||||
cache.has(myKey) // false!
|
||||
```
|
||||
|
||||
If you need to track `undefined` values, and still note that the
|
||||
key is in the cache, an easy workaround is to use a sigil object
|
||||
of your own.
|
||||
|
||||
```js
|
||||
import { LRUCache } from 'lru-cache'
|
||||
const undefinedValue = Symbol('undefined')
|
||||
const cache = new LRUCache(...)
|
||||
const mySet = (key, value) =>
|
||||
cache.set(key, value === undefined ? undefinedValue : value)
|
||||
const myGet = (key, value) => {
|
||||
const v = cache.get(key)
|
||||
return v === undefinedValue ? undefined : v
|
||||
}
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
As of January 2022, version 7 of this library is one of the most
|
||||
performant LRU cache implementations in JavaScript.
|
||||
|
||||
Benchmarks can be extremely difficult to get right. In
|
||||
particular, the performance of set/get/delete operations on
|
||||
objects will vary _wildly_ depending on the type of key used. V8
|
||||
is highly optimized for objects with keys that are short strings,
|
||||
especially integer numeric strings. Thus any benchmark which
|
||||
tests _solely_ using numbers as keys will tend to find that an
|
||||
object-based approach performs the best.
|
||||
|
||||
Note that coercing _anything_ to strings to use as object keys is
|
||||
unsafe, unless you can be 100% certain that no other type of
|
||||
value will be used. For example:
|
||||
|
||||
```js
|
||||
const myCache = {}
|
||||
const set = (k, v) => (myCache[k] = v)
|
||||
const get = k => myCache[k]
|
||||
|
||||
set({}, 'please hang onto this for me')
|
||||
set('[object Object]', 'oopsie')
|
||||
```
|
||||
|
||||
Also beware of "Just So" stories regarding performance. Garbage
|
||||
collection of large (especially: deep) object graphs can be
|
||||
incredibly costly, with several "tipping points" where it
|
||||
increases exponentially. As a result, putting that off until
|
||||
later can make it much worse, and less predictable. If a library
|
||||
performs well, but only in a scenario where the object graph is
|
||||
kept shallow, then that won't help you if you are using large
|
||||
objects as keys.
|
||||
|
||||
In general, when attempting to use a library to improve
|
||||
performance (such as a cache like this one), it's best to choose
|
||||
an option that will perform well in the sorts of scenarios where
|
||||
you'll actually use it.
|
||||
|
||||
This library is optimized for repeated gets and minimizing
|
||||
eviction time, since that is the expected need of a LRU. Set
|
||||
operations are somewhat slower on average than a few other
|
||||
options, in part because of that optimization. It is assumed
|
||||
that you'll be caching some costly operation, ideally as rarely
|
||||
as possible, so optimizing set over get would be unwise.
|
||||
|
||||
If performance matters to you:
|
||||
|
||||
1. If it's at all possible to use small integer values as keys,
|
||||
and you can guarantee that no other types of values will be
|
||||
used as keys, then do that, and use a cache such as
|
||||
[lru-fast](https://npmjs.com/package/lru-fast), or
|
||||
[mnemonist's
|
||||
LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache)
|
||||
which uses an Object as its data store.
|
||||
|
||||
2. Failing that, if at all possible, use short non-numeric
|
||||
strings (ie, less than 256 characters) as your keys, and use
|
||||
[mnemonist's
|
||||
LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache).
|
||||
|
||||
3. If the types of your keys will be anything else, especially
|
||||
long strings, strings that look like floats, objects, or some
|
||||
mix of types, or if you aren't sure, then this library will
|
||||
work well for you.
|
||||
|
||||
If you do not need the features that this library provides
|
||||
(like asynchronous fetching, a variety of TTL staleness
|
||||
options, and so on), then [mnemonist's
|
||||
LRUMap](https://yomguithereal.github.io/mnemonist/lru-map) is
|
||||
a very good option, and just slightly faster than this module
|
||||
(since it does considerably less).
|
||||
|
||||
4. Do not use a `dispose` function, size tracking, or especially
|
||||
ttl behavior, unless absolutely needed. These features are
|
||||
convenient, and necessary in some use cases, and every attempt
|
||||
has been made to make the performance impact minimal, but it
|
||||
isn't nothing.
|
||||
|
||||
## Breaking Changes in Version 7
|
||||
|
||||
This library changed to a different algorithm and internal data
|
||||
structure in version 7, yielding significantly better
|
||||
performance, albeit with some subtle changes as a result.
|
||||
|
||||
If you were relying on the internals of LRUCache in version 6 or
|
||||
before, it probably will not work in version 7 and above.
|
||||
|
||||
## Breaking Changes in Version 8
|
||||
|
||||
- The `fetchContext` option was renamed to `context`, and may no
|
||||
longer be set on the cache instance itself.
|
||||
- Rewritten in TypeScript, so pretty much all the types moved
|
||||
around a lot.
|
||||
- The AbortController/AbortSignal polyfill was removed. For this
|
||||
reason, **Node version 16.14.0 or higher is now required**.
|
||||
- Internal properties were moved to actual private class
|
||||
properties.
|
||||
- Keys and values must not be `null` or `undefined`.
|
||||
- Minified export available at `'lru-cache/min'`, for both CJS
|
||||
and MJS builds.
|
||||
|
||||
## Breaking Changes in Version 9
|
||||
|
||||
- Named export only, no default export.
|
||||
- AbortController polyfill returned, albeit with a warning when
|
||||
used.
|
||||
|
||||
## Breaking Changes in Version 10
|
||||
|
||||
- `cache.fetch()` return type is now `Promise<V | undefined>`
|
||||
instead of `Promise<V | void>`. This is an irrelevant change
|
||||
practically speaking, but can require changes for TypeScript
|
||||
users.
|
||||
|
||||
For more info, see the [change log](CHANGELOG.md).
|
||||
1323
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.d.ts
generated
vendored
Normal file
1323
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1585
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.js
generated
vendored
Normal file
1585
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.min.js
generated
vendored
Normal file
2
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.min.js.map
generated
vendored
Normal file
7
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/index.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/package.json
generated
vendored
Normal file
3
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/commonjs/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
1323
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.d.ts
generated
vendored
Normal file
1323
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1581
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.js
generated
vendored
Normal file
1581
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.min.js
generated
vendored
Normal file
2
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.min.js.map
generated
vendored
Normal file
7
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/index.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/package.json
generated
vendored
Normal file
3
backend/node_modules/@fastify/static/node_modules/lru-cache/dist/esm/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
101
backend/node_modules/@fastify/static/node_modules/lru-cache/package.json
generated
vendored
Normal file
101
backend/node_modules/@fastify/static/node_modules/lru-cache/package.json
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"name": "lru-cache",
|
||||
"description": "A cache object that deletes the least-recently-used items.",
|
||||
"version": "11.2.4",
|
||||
"author": "Isaac Z. Schlueter <i@izs.me>",
|
||||
"keywords": [
|
||||
"mru",
|
||||
"lru",
|
||||
"cache"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "npm run prepare",
|
||||
"prepare": "tshy && bash fixup.sh",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"format": "prettier --write .",
|
||||
"typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts",
|
||||
"benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh",
|
||||
"prebenchmark": "npm run prepare",
|
||||
"benchmark": "make -C benchmark",
|
||||
"preprofile": "npm run prepare",
|
||||
"profile": "make -C benchmark profile"
|
||||
},
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"tshy": {
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./min": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.min.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.min.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/node-lru-cache.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.3.0",
|
||||
"benchmark": "^2.1.4",
|
||||
"esbuild": "^0.25.9",
|
||||
"marked": "^4.2.12",
|
||||
"mkdirp": "^3.0.1",
|
||||
"prettier": "^3.6.2",
|
||||
"tap": "^21.1.0",
|
||||
"tshy": "^3.0.2",
|
||||
"typedoc": "^0.28.12"
|
||||
},
|
||||
"license": "BlueOak-1.0.0",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"tap": {
|
||||
"node-arg": [
|
||||
"--expose-gc"
|
||||
],
|
||||
"plugin": [
|
||||
"@tapjs/clock"
|
||||
]
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
},
|
||||
"./min": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.min.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.min.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "module",
|
||||
"module": "./dist/esm/index.js"
|
||||
}
|
||||
55
backend/node_modules/@fastify/static/node_modules/minimatch/LICENSE.md
generated
vendored
Normal file
55
backend/node_modules/@fastify/static/node_modules/minimatch/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# Blue Oak Model License
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
## Purpose
|
||||
|
||||
This license gives everyone as much permission to work with
|
||||
this software as possible, while protecting contributors
|
||||
from liability.
|
||||
|
||||
## Acceptance
|
||||
|
||||
In order to receive this license, you must agree to its
|
||||
rules. The rules of this license are both obligations
|
||||
under that agreement and conditions to your license.
|
||||
You must not do anything with this software that triggers
|
||||
a rule that you cannot or will not follow.
|
||||
|
||||
## Copyright
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe that contributor's
|
||||
copyright in it.
|
||||
|
||||
## Notices
|
||||
|
||||
You must ensure that everyone who gets a copy of
|
||||
any part of this software from you, with or without
|
||||
changes, also gets the text of this license or a link to
|
||||
<https://blueoakcouncil.org/license/1.0.0>.
|
||||
|
||||
## Excuse
|
||||
|
||||
If anyone notifies you in writing that you have not
|
||||
complied with [Notices](#notices), you can keep your
|
||||
license by taking all practical steps to comply within 30
|
||||
days after the notice. If you do not do so, your license
|
||||
ends immediately.
|
||||
|
||||
## Patent
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe any patent claims
|
||||
they can license or become able to license.
|
||||
|
||||
## Reliability
|
||||
|
||||
No contributor can revoke this license.
|
||||
|
||||
## No Liability
|
||||
|
||||
**_As far as the law allows, this software comes as is,
|
||||
without any warranty or condition, and no contributor
|
||||
will be liable to anyone for any damages related to this
|
||||
software or this license, under any kind of legal claim._**
|
||||
453
backend/node_modules/@fastify/static/node_modules/minimatch/README.md
generated
vendored
Normal file
453
backend/node_modules/@fastify/static/node_modules/minimatch/README.md
generated
vendored
Normal file
@@ -0,0 +1,453 @@
|
||||
# minimatch
|
||||
|
||||
A minimal matching utility.
|
||||
|
||||
This is the matching library used internally by npm.
|
||||
|
||||
It works by converting glob expressions into JavaScript `RegExp`
|
||||
objects.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// hybrid module, load with require() or import
|
||||
import { minimatch } from 'minimatch'
|
||||
// or:
|
||||
const { minimatch } = require('minimatch')
|
||||
|
||||
minimatch('bar.foo', '*.foo') // true!
|
||||
minimatch('bar.foo', '*.bar') // false!
|
||||
minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy!
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
Supports these glob features:
|
||||
|
||||
- Brace Expansion
|
||||
- Extended glob matching
|
||||
- "Globstar" `**` matching
|
||||
- [Posix character
|
||||
classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html),
|
||||
like `[[:alpha:]]`, supporting the full range of Unicode
|
||||
characters. For example, `[[:alpha:]]` will match against
|
||||
`'é'`, though `[a-zA-Z]` will not. Collating symbol and set
|
||||
matching is not supported, so `[[=e=]]` will _not_ match `'é'`
|
||||
and `[[.ch.]]` will not match `'ch'` in locales where `ch` is
|
||||
considered a single character.
|
||||
|
||||
See:
|
||||
|
||||
- `man sh`
|
||||
- `man bash` [Pattern
|
||||
Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)
|
||||
- `man 3 fnmatch`
|
||||
- `man 5 gitignore`
|
||||
|
||||
## Windows
|
||||
|
||||
**Please only use forward-slashes in glob expressions.**
|
||||
|
||||
Though windows uses either `/` or `\` as its path separator, only `/`
|
||||
characters are used by this glob implementation. You must use
|
||||
forward-slashes **only** in glob expressions. Back-slashes in patterns
|
||||
will always be interpreted as escape characters, not path separators.
|
||||
|
||||
Note that `\` or `/` _will_ be interpreted as path separators in paths on
|
||||
Windows, and will match against `/` in glob expressions.
|
||||
|
||||
So just always use `/` in patterns.
|
||||
|
||||
### UNC Paths
|
||||
|
||||
On Windows, UNC paths like `//?/c:/...` or
|
||||
`//ComputerName/Share/...` are handled specially.
|
||||
|
||||
- Patterns starting with a double-slash followed by some
|
||||
non-slash characters will preserve their double-slash. As a
|
||||
result, a pattern like `//*` will match `//x`, but not `/x`.
|
||||
- Patterns staring with `//?/<drive letter>:` will _not_ treat
|
||||
the `?` as a wildcard character. Instead, it will be treated
|
||||
as a normal string.
|
||||
- Patterns starting with `//?/<drive letter>:/...` will match
|
||||
file paths starting with `<drive letter>:/...`, and vice versa,
|
||||
as if the `//?/` was not present. This behavior only is
|
||||
present when the drive letters are a case-insensitive match to
|
||||
one another. The remaining portions of the path/pattern are
|
||||
compared case sensitively, unless `nocase:true` is set.
|
||||
|
||||
Note that specifying a UNC path using `\` characters as path
|
||||
separators is always allowed in the file path argument, but only
|
||||
allowed in the pattern argument when `windowsPathsNoEscape: true`
|
||||
is set in the options.
|
||||
|
||||
## Minimatch Class
|
||||
|
||||
Create a minimatch object by instantiating the `minimatch.Minimatch` class.
|
||||
|
||||
```javascript
|
||||
var Minimatch = require('minimatch').Minimatch
|
||||
var mm = new Minimatch(pattern, options)
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
- `pattern` The original pattern the minimatch object represents.
|
||||
- `options` The options supplied to the constructor.
|
||||
- `set` A 2-dimensional array of regexp or string expressions.
|
||||
Each row in the
|
||||
array corresponds to a brace-expanded pattern. Each item in the row
|
||||
corresponds to a single path-part. For example, the pattern
|
||||
`{a,b/c}/d` would expand to a set of patterns like:
|
||||
|
||||
[ [ a, d ]
|
||||
, [ b, c, d ] ]
|
||||
|
||||
If a portion of the pattern doesn't have any "magic" in it
|
||||
(that is, it's something like `"foo"` rather than `fo*o?`), then it
|
||||
will be left as a string rather than converted to a regular
|
||||
expression.
|
||||
|
||||
- `regexp` Created by the `makeRe` method. A single regular expression
|
||||
expressing the entire pattern. This is useful in cases where you wish
|
||||
to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
|
||||
- `negate` True if the pattern is negated.
|
||||
- `comment` True if the pattern is a comment.
|
||||
- `empty` True if the pattern is `""`.
|
||||
|
||||
### Methods
|
||||
|
||||
- `makeRe()` Generate the `regexp` member if necessary, and return it.
|
||||
Will return `false` if the pattern is invalid.
|
||||
- `match(fname)` Return true if the filename matches the pattern, or
|
||||
false otherwise.
|
||||
- `matchOne(fileArray, patternArray, partial)` Take a `/`-split
|
||||
filename, and match it against a single row in the `regExpSet`. This
|
||||
method is mainly for internal use, but is exposed so that it can be
|
||||
used by a glob-walker that needs to avoid excessive filesystem calls.
|
||||
- `hasMagic()` Returns true if the parsed pattern contains any
|
||||
magic characters. Returns false if all comparator parts are
|
||||
string literals. If the `magicalBraces` option is set on the
|
||||
constructor, then it will consider brace expansions which are
|
||||
not otherwise magical to be magic. If not set, then a pattern
|
||||
like `a{b,c}d` will return `false`, because neither `abd` nor
|
||||
`acd` contain any special glob characters.
|
||||
|
||||
This does **not** mean that the pattern string can be used as a
|
||||
literal filename, as it may contain magic glob characters that
|
||||
are escaped. For example, the pattern `\\*` or `[*]` would not
|
||||
be considered to have magic, as the matching portion parses to
|
||||
the literal string `'*'` and would match a path named `'*'`,
|
||||
not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may
|
||||
be used to remove escape characters.
|
||||
|
||||
All other methods are internal, and will be called as necessary.
|
||||
|
||||
### minimatch(path, pattern, options)
|
||||
|
||||
Main export. Tests a path against the pattern using the options.
|
||||
|
||||
```javascript
|
||||
var isJS = minimatch(file, '*.js', { matchBase: true })
|
||||
```
|
||||
|
||||
### minimatch.filter(pattern, options)
|
||||
|
||||
Returns a function that tests its
|
||||
supplied argument, suitable for use with `Array.filter`. Example:
|
||||
|
||||
```javascript
|
||||
var javascripts = fileList.filter(minimatch.filter('*.js', { matchBase: true }))
|
||||
```
|
||||
|
||||
### minimatch.escape(pattern, options = {})
|
||||
|
||||
Escape all magic characters in a glob pattern, so that it will
|
||||
only ever match literal strings.
|
||||
|
||||
If the `windowsPathsNoEscape` option is used, then characters are
|
||||
escaped by wrapping in `[]`, because a magic character wrapped in
|
||||
a character class can only be satisfied by that exact character.
|
||||
|
||||
Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
|
||||
be escaped or unescaped.
|
||||
|
||||
### minimatch.unescape(pattern, options = {})
|
||||
|
||||
Un-escape a glob string that may contain some escaped characters.
|
||||
|
||||
If the `windowsPathsNoEscape` option is used, then square-brace
|
||||
escapes are removed, but not backslash escapes. For example, it
|
||||
will turn the string `'[*]'` into `*`, but it will not turn
|
||||
`'\\*'` into `'*'`, because `\` is a path separator in
|
||||
`windowsPathsNoEscape` mode.
|
||||
|
||||
When `windowsPathsNoEscape` is not set, then both brace escapes
|
||||
and backslash escapes are removed.
|
||||
|
||||
Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
|
||||
be escaped or unescaped.
|
||||
|
||||
### minimatch.match(list, pattern, options)
|
||||
|
||||
Match against the list of
|
||||
files, in the style of fnmatch or glob. If nothing is matched, and
|
||||
options.nonull is set, then return a list containing the pattern itself.
|
||||
|
||||
```javascript
|
||||
var javascripts = minimatch.match(fileList, '*.js', { matchBase: true })
|
||||
```
|
||||
|
||||
### minimatch.makeRe(pattern, options)
|
||||
|
||||
Make a regular expression object from the pattern.
|
||||
|
||||
## Options
|
||||
|
||||
All options are `false` by default.
|
||||
|
||||
### debug
|
||||
|
||||
Dump a ton of stuff to stderr.
|
||||
|
||||
### nobrace
|
||||
|
||||
Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
|
||||
### noglobstar
|
||||
|
||||
Disable `**` matching against multiple folder names.
|
||||
|
||||
### dot
|
||||
|
||||
Allow patterns to match filenames starting with a period, even if
|
||||
the pattern does not explicitly have a period in that spot.
|
||||
|
||||
Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
|
||||
is set.
|
||||
|
||||
### noext
|
||||
|
||||
Disable "extglob" style patterns like `+(a|b)`.
|
||||
|
||||
### nocase
|
||||
|
||||
Perform a case-insensitive match.
|
||||
|
||||
### nocaseMagicOnly
|
||||
|
||||
When used with `{nocase: true}`, create regular expressions that
|
||||
are case-insensitive, but leave string match portions untouched.
|
||||
Has no effect when used without `{nocase: true}`.
|
||||
|
||||
Useful when some other form of case-insensitive matching is used,
|
||||
or if the original string representation is useful in some other
|
||||
way.
|
||||
|
||||
### nonull
|
||||
|
||||
When a match is not found by `minimatch.match`, return a list containing
|
||||
the pattern itself if this option is set. When not set, an empty list
|
||||
is returned if there are no matches.
|
||||
|
||||
### magicalBraces
|
||||
|
||||
This only affects the results of the `Minimatch.hasMagic` method.
|
||||
|
||||
If the pattern contains brace expansions, such as `a{b,c}d`, but
|
||||
no other magic characters, then the `Minimatch.hasMagic()` method
|
||||
will return `false` by default. When this option set, it will
|
||||
return `true` for brace expansion as well as other magic glob
|
||||
characters.
|
||||
|
||||
### matchBase
|
||||
|
||||
If set, then patterns without slashes will be matched
|
||||
against the basename of the path if it contains slashes. For example,
|
||||
`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
|
||||
|
||||
### nocomment
|
||||
|
||||
Suppress the behavior of treating `#` at the start of a pattern as a
|
||||
comment.
|
||||
|
||||
### nonegate
|
||||
|
||||
Suppress the behavior of treating a leading `!` character as negation.
|
||||
|
||||
### flipNegate
|
||||
|
||||
Returns from negate expressions the same as if they were not negated.
|
||||
(Ie, true on a hit, false on a miss.)
|
||||
|
||||
### partial
|
||||
|
||||
Compare a partial path to a pattern. As long as the parts of the path that
|
||||
are present are not contradicted by the pattern, it will be treated as a
|
||||
match. This is useful in applications where you're walking through a
|
||||
folder structure, and don't yet have the full path, but want to ensure that
|
||||
you do not walk down paths that can never be a match.
|
||||
|
||||
For example,
|
||||
|
||||
```js
|
||||
minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d
|
||||
minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d
|
||||
minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a
|
||||
```
|
||||
|
||||
### windowsPathsNoEscape
|
||||
|
||||
Use `\\` as a path separator _only_, and _never_ as an escape
|
||||
character. If set, all `\\` characters are replaced with `/` in
|
||||
the pattern. Note that this makes it **impossible** to match
|
||||
against paths containing literal glob pattern characters, but
|
||||
allows matching with patterns constructed using `path.join()` and
|
||||
`path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
behavior of earlier versions on Windows. Please use with
|
||||
caution, and be mindful of [the caveat about Windows
|
||||
paths](#windows).
|
||||
|
||||
For legacy reasons, this is also set if
|
||||
`options.allowWindowsEscape` is set to the exact value `false`.
|
||||
|
||||
### windowsNoMagicRoot
|
||||
|
||||
When a pattern starts with a UNC path or drive letter, and in
|
||||
`nocase:true` mode, do not convert the root portions of the
|
||||
pattern into a case-insensitive regular expression, and instead
|
||||
leave them as strings.
|
||||
|
||||
This is the default when the platform is `win32` and
|
||||
`nocase:true` is set.
|
||||
|
||||
### preserveMultipleSlashes
|
||||
|
||||
By default, multiple `/` characters (other than the leading `//`
|
||||
in a UNC path, see "UNC Paths" above) are treated as a single
|
||||
`/`.
|
||||
|
||||
That is, a pattern like `a///b` will match the file path `a/b`.
|
||||
|
||||
Set `preserveMultipleSlashes: true` to suppress this behavior.
|
||||
|
||||
### optimizationLevel
|
||||
|
||||
A number indicating the level of optimization that should be done
|
||||
to the pattern prior to parsing and using it for matches.
|
||||
|
||||
Globstar parts `**` are always converted to `*` when `noglobstar`
|
||||
is set, and multiple adjacent `**` parts are converted into a
|
||||
single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this
|
||||
is equivalent in all cases).
|
||||
|
||||
- `0` - Make no further changes. In this mode, `.` and `..` are
|
||||
maintained in the pattern, meaning that they must also appear
|
||||
in the same position in the test path string. Eg, a pattern
|
||||
like `a/*/../c` will match the string `a/b/../c` but not the
|
||||
string `a/c`.
|
||||
- `1` - (default) Remove cases where a double-dot `..` follows a
|
||||
pattern portion that is not `**`, `.`, `..`, or empty `''`. For
|
||||
example, the pattern `./a/b/../*` is converted to `./a/*`, and
|
||||
so it will match the path string `./a/c`, but not the path
|
||||
string `./a/b/../c`. Dots and empty path portions in the
|
||||
pattern are preserved.
|
||||
- `2` (or higher) - Much more aggressive optimizations, suitable
|
||||
for use with file-walking cases:
|
||||
- Remove cases where a double-dot `..` follows a pattern
|
||||
portion that is not `**`, `.`, or empty `''`. Remove empty
|
||||
and `.` portions of the pattern, where safe to do so (ie,
|
||||
anywhere other than the last position, the first position, or
|
||||
the second position in a pattern starting with `/`, as this
|
||||
may indicate a UNC path on Windows).
|
||||
- Convert patterns containing `<pre>/**/../<p>/<rest>` into the
|
||||
equivalent `<pre>/{..,**}/<p>/<rest>`, where `<p>` is a
|
||||
a pattern portion other than `.`, `..`, `**`, or empty
|
||||
`''`.
|
||||
- Dedupe patterns where a `**` portion is present in one and
|
||||
omitted in another, and it is not the final path portion, and
|
||||
they are otherwise equivalent. So `{a/**/b,a/b}` becomes
|
||||
`a/**/b`, because `**` matches against an empty path portion.
|
||||
- Dedupe patterns where a `*` portion is present in one, and a
|
||||
non-dot pattern other than `**`, `.`, `..`, or `''` is in the
|
||||
same position in the other. So `a/{*,x}/b` becomes `a/*/b`,
|
||||
because `*` can match against `x`.
|
||||
|
||||
While these optimizations improve the performance of
|
||||
file-walking use cases such as [glob](http://npm.im/glob) (ie,
|
||||
the reason this module exists), there are cases where it will
|
||||
fail to match a literal string that would have been matched in
|
||||
optimization level 1 or 0.
|
||||
|
||||
Specifically, while the `Minimatch.match()` method will
|
||||
optimize the file path string in the same ways, resulting in
|
||||
the same matches, it will fail when tested with the regular
|
||||
expression provided by `Minimatch.makeRe()`, unless the path
|
||||
string is first processed with
|
||||
`minimatch.levelTwoFileOptimize()` or similar.
|
||||
|
||||
### platform
|
||||
|
||||
When set to `win32`, this will trigger all windows-specific
|
||||
behaviors (special handling for UNC paths, and treating `\` as
|
||||
separators in file paths for comparison.)
|
||||
|
||||
Defaults to the value of `process.platform`.
|
||||
|
||||
## Comparisons to other fnmatch/glob implementations
|
||||
|
||||
While strict compliance with the existing standards is a
|
||||
worthwhile goal, some discrepancies exist between minimatch and
|
||||
other implementations. Some are intentional, and some are
|
||||
unavoidable.
|
||||
|
||||
If the pattern starts with a `!` character, then it is negated. Set the
|
||||
`nonegate` flag to suppress this behavior, and treat leading `!`
|
||||
characters normally. This is perhaps relevant if you wish to start the
|
||||
pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`
|
||||
characters at the start of a pattern will negate the pattern multiple
|
||||
times.
|
||||
|
||||
If a pattern starts with `#`, then it is treated as a comment, and
|
||||
will not match anything. Use `\#` to match a literal `#` at the
|
||||
start of a line, or set the `nocomment` flag to suppress this behavior.
|
||||
|
||||
The double-star character `**` is supported by default, unless the
|
||||
`noglobstar` flag is set. This is supported in the manner of bsdglob
|
||||
and bash 4.1, where `**` only has special significance if it is the only
|
||||
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
|
||||
`a/**b` will not.
|
||||
|
||||
If an escaped pattern has no matches, and the `nonull` flag is set,
|
||||
then minimatch.match returns the pattern as-provided, rather than
|
||||
interpreting the character escapes. For example,
|
||||
`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
|
||||
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
|
||||
that it does not resolve escaped pattern characters.
|
||||
|
||||
If brace expansion is not disabled, then it is performed before any
|
||||
other interpretation of the glob pattern. Thus, a pattern like
|
||||
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
|
||||
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
|
||||
checked for validity. Since those two are valid, matching proceeds.
|
||||
|
||||
Negated extglob patterns are handled as closely as possible to
|
||||
Bash semantics, but there are some cases with negative extglobs
|
||||
which are exceedingly difficult to express in a JavaScript
|
||||
regular expression. In particular the negated pattern
|
||||
`<start>!(<pattern>*|)*` will in bash match anything that does
|
||||
not start with `<start><pattern>`. However,
|
||||
`<start>!(<pattern>*)*` _will_ match paths starting with
|
||||
`<start><pattern>`, because the empty string can match against
|
||||
the negated portion. In this library, `<start>!(<pattern>*|)*`
|
||||
will _not_ match any pattern starting with `<start>`, due to a
|
||||
difference in precisely which patterns are considered "greedy" in
|
||||
Regular Expressions vs bash path expansion. This may be fixable,
|
||||
but not without incurring some complexity and performance costs,
|
||||
and the trade-off seems to not be worth pursuing.
|
||||
|
||||
Note that `fnmatch(3)` in libc is an extremely naive string comparison
|
||||
matcher, which does not do anything special for slashes. This library is
|
||||
designed to be used in glob searching and file walkers, and so it does do
|
||||
special things with `/`. Thus, `foo*` will not match `foo/bar` in this
|
||||
library, even though it would in `fnmatch(3)`.
|
||||
2
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts
generated
vendored
Normal file
2
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare const assertValidPattern: (pattern: any) => void;
|
||||
//# sourceMappingURL=assert-valid-pattern.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAUlD,CAAA"}
|
||||
14
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js
generated
vendored
Normal file
14
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.assertValidPattern = void 0;
|
||||
const MAX_PATTERN_LENGTH = 1024 * 64;
|
||||
const assertValidPattern = (pattern) => {
|
||||
if (typeof pattern !== 'string') {
|
||||
throw new TypeError('invalid pattern');
|
||||
}
|
||||
if (pattern.length > MAX_PATTERN_LENGTH) {
|
||||
throw new TypeError('pattern is too long');
|
||||
}
|
||||
};
|
||||
exports.assertValidPattern = assertValidPattern;
|
||||
//# sourceMappingURL=assert-valid-pattern.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA2B,CACxD,OAAY,EACe,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n pattern: any,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]}
|
||||
20
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.d.ts
generated
vendored
Normal file
20
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { MinimatchOptions, MMRegExp } from './index.js';
|
||||
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
|
||||
export declare class AST {
|
||||
#private;
|
||||
type: ExtglobType | null;
|
||||
constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
|
||||
get hasMagic(): boolean | undefined;
|
||||
toString(): string;
|
||||
push(...parts: (string | AST)[]): void;
|
||||
toJSON(): any[];
|
||||
isStart(): boolean;
|
||||
isEnd(): boolean;
|
||||
copyIn(part: AST | string): void;
|
||||
clone(parent: AST): AST;
|
||||
static fromGlob(pattern: string, options?: MinimatchOptions): AST;
|
||||
toMMPattern(): MMRegExp | string;
|
||||
get options(): MinimatchOptions;
|
||||
toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
|
||||
}
|
||||
//# sourceMappingURL=ast.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwCvD,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAkCrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;gBAiBtB,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IA+ClB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAY/B,MAAM;IAgBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsIjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CAmMjE"}
|
||||
591
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.js
generated
vendored
Normal file
591
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.js
generated
vendored
Normal file
@@ -0,0 +1,591 @@
|
||||
"use strict";
|
||||
// parse a single path portion
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AST = void 0;
|
||||
const brace_expressions_js_1 = require("./brace-expressions.js");
|
||||
const unescape_js_1 = require("./unescape.js");
|
||||
const types = new Set(['!', '?', '+', '*', '@']);
|
||||
const isExtglobType = (c) => types.has(c);
|
||||
// Patterns that get prepended to bind to the start of either the
|
||||
// entire string, or just a single path portion, to prevent dots
|
||||
// and/or traversal patterns, when needed.
|
||||
// Exts don't need the ^ or / bit, because the root binds that already.
|
||||
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
|
||||
const startNoDot = '(?!\\.)';
|
||||
// characters that indicate a start of pattern needs the "no dots" bit,
|
||||
// because a dot *might* be matched. ( is not in the list, because in
|
||||
// the case of a child extglob, it will handle the prevention itself.
|
||||
const addPatternStart = new Set(['[', '.']);
|
||||
// cases where traversal is A-OK, no dot prevention needed
|
||||
const justDots = new Set(['..', '.']);
|
||||
const reSpecials = new Set('().*{}+?[]^$\\!');
|
||||
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
// any single thing other than /
|
||||
const qmark = '[^/]';
|
||||
// * => any number of characters
|
||||
const star = qmark + '*?';
|
||||
// use + when we need to ensure that *something* matches, because the * is
|
||||
// the only thing in the path portion.
|
||||
const starNoEmpty = qmark + '+?';
|
||||
// remove the \ chars that we added if we end up doing a nonmagic compare
|
||||
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
|
||||
class AST {
|
||||
type;
|
||||
#root;
|
||||
#hasMagic;
|
||||
#uflag = false;
|
||||
#parts = [];
|
||||
#parent;
|
||||
#parentIndex;
|
||||
#negs;
|
||||
#filledNegs = false;
|
||||
#options;
|
||||
#toString;
|
||||
// set to true if it's an extglob with no children
|
||||
// (which really means one child of '')
|
||||
#emptyExt = false;
|
||||
constructor(type, parent, options = {}) {
|
||||
this.type = type;
|
||||
// extglobs are inherently magical
|
||||
if (type)
|
||||
this.#hasMagic = true;
|
||||
this.#parent = parent;
|
||||
this.#root = this.#parent ? this.#parent.#root : this;
|
||||
this.#options = this.#root === this ? options : this.#root.#options;
|
||||
this.#negs = this.#root === this ? [] : this.#root.#negs;
|
||||
if (type === '!' && !this.#root.#filledNegs)
|
||||
this.#negs.push(this);
|
||||
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
|
||||
}
|
||||
get hasMagic() {
|
||||
/* c8 ignore start */
|
||||
if (this.#hasMagic !== undefined)
|
||||
return this.#hasMagic;
|
||||
/* c8 ignore stop */
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === 'string')
|
||||
continue;
|
||||
if (p.type || p.hasMagic)
|
||||
return (this.#hasMagic = true);
|
||||
}
|
||||
// note: will be undefined until we generate the regexp src and find out
|
||||
return this.#hasMagic;
|
||||
}
|
||||
// reconstructs the pattern
|
||||
toString() {
|
||||
if (this.#toString !== undefined)
|
||||
return this.#toString;
|
||||
if (!this.type) {
|
||||
return (this.#toString = this.#parts.map(p => String(p)).join(''));
|
||||
}
|
||||
else {
|
||||
return (this.#toString =
|
||||
this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
|
||||
}
|
||||
}
|
||||
#fillNegs() {
|
||||
/* c8 ignore start */
|
||||
if (this !== this.#root)
|
||||
throw new Error('should only call on root');
|
||||
if (this.#filledNegs)
|
||||
return this;
|
||||
/* c8 ignore stop */
|
||||
// call toString() once to fill this out
|
||||
this.toString();
|
||||
this.#filledNegs = true;
|
||||
let n;
|
||||
while ((n = this.#negs.pop())) {
|
||||
if (n.type !== '!')
|
||||
continue;
|
||||
// walk up the tree, appending everthing that comes AFTER parentIndex
|
||||
let p = n;
|
||||
let pp = p.#parent;
|
||||
while (pp) {
|
||||
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
|
||||
for (const part of n.#parts) {
|
||||
/* c8 ignore start */
|
||||
if (typeof part === 'string') {
|
||||
throw new Error('string part in extglob AST??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
part.copyIn(pp.#parts[i]);
|
||||
}
|
||||
}
|
||||
p = pp;
|
||||
pp = p.#parent;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
push(...parts) {
|
||||
for (const p of parts) {
|
||||
if (p === '')
|
||||
continue;
|
||||
/* c8 ignore start */
|
||||
if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
|
||||
throw new Error('invalid part: ' + p);
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
this.#parts.push(p);
|
||||
}
|
||||
}
|
||||
toJSON() {
|
||||
const ret = this.type === null
|
||||
? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))
|
||||
: [this.type, ...this.#parts.map(p => p.toJSON())];
|
||||
if (this.isStart() && !this.type)
|
||||
ret.unshift([]);
|
||||
if (this.isEnd() &&
|
||||
(this === this.#root ||
|
||||
(this.#root.#filledNegs && this.#parent?.type === '!'))) {
|
||||
ret.push({});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
isStart() {
|
||||
if (this.#root === this)
|
||||
return true;
|
||||
// if (this.type) return !!this.#parent?.isStart()
|
||||
if (!this.#parent?.isStart())
|
||||
return false;
|
||||
if (this.#parentIndex === 0)
|
||||
return true;
|
||||
// if everything AHEAD of this is a negation, then it's still the "start"
|
||||
const p = this.#parent;
|
||||
for (let i = 0; i < this.#parentIndex; i++) {
|
||||
const pp = p.#parts[i];
|
||||
if (!(pp instanceof AST && pp.type === '!')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
isEnd() {
|
||||
if (this.#root === this)
|
||||
return true;
|
||||
if (this.#parent?.type === '!')
|
||||
return true;
|
||||
if (!this.#parent?.isEnd())
|
||||
return false;
|
||||
if (!this.type)
|
||||
return this.#parent?.isEnd();
|
||||
// if not root, it'll always have a parent
|
||||
/* c8 ignore start */
|
||||
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
||||
/* c8 ignore stop */
|
||||
return this.#parentIndex === pl - 1;
|
||||
}
|
||||
copyIn(part) {
|
||||
if (typeof part === 'string')
|
||||
this.push(part);
|
||||
else
|
||||
this.push(part.clone(this));
|
||||
}
|
||||
clone(parent) {
|
||||
const c = new AST(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str, ast, pos, opt) {
|
||||
let escaping = false;
|
||||
let inBrace = false;
|
||||
let braceStart = -1;
|
||||
let braceNeg = false;
|
||||
if (ast.type === null) {
|
||||
// outside of a extglob, append until we find a start
|
||||
let i = pos;
|
||||
let acc = '';
|
||||
while (i < str.length) {
|
||||
const c = str.charAt(i++);
|
||||
// still accumulate escapes at this point, but we do ignore
|
||||
// starts that are escaped
|
||||
if (escaping || c === '\\') {
|
||||
escaping = !escaping;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (inBrace) {
|
||||
if (i === braceStart + 1) {
|
||||
if (c === '^' || c === '!') {
|
||||
braceNeg = true;
|
||||
}
|
||||
}
|
||||
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
||||
inBrace = false;
|
||||
}
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
else if (c === '[') {
|
||||
inBrace = true;
|
||||
braceStart = i;
|
||||
braceNeg = false;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
|
||||
ast.push(acc);
|
||||
acc = '';
|
||||
const ext = new AST(c, ast);
|
||||
i = AST.#parseAST(str, ext, i, opt);
|
||||
ast.push(ext);
|
||||
continue;
|
||||
}
|
||||
acc += c;
|
||||
}
|
||||
ast.push(acc);
|
||||
return i;
|
||||
}
|
||||
// some kind of extglob, pos is at the (
|
||||
// find the next | or )
|
||||
let i = pos + 1;
|
||||
let part = new AST(null, ast);
|
||||
const parts = [];
|
||||
let acc = '';
|
||||
while (i < str.length) {
|
||||
const c = str.charAt(i++);
|
||||
// still accumulate escapes at this point, but we do ignore
|
||||
// starts that are escaped
|
||||
if (escaping || c === '\\') {
|
||||
escaping = !escaping;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (inBrace) {
|
||||
if (i === braceStart + 1) {
|
||||
if (c === '^' || c === '!') {
|
||||
braceNeg = true;
|
||||
}
|
||||
}
|
||||
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
||||
inBrace = false;
|
||||
}
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
else if (c === '[') {
|
||||
inBrace = true;
|
||||
braceStart = i;
|
||||
braceNeg = false;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (isExtglobType(c) && str.charAt(i) === '(') {
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
const ext = new AST(c, part);
|
||||
part.push(ext);
|
||||
i = AST.#parseAST(str, ext, i, opt);
|
||||
continue;
|
||||
}
|
||||
if (c === '|') {
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
parts.push(part);
|
||||
part = new AST(null, ast);
|
||||
continue;
|
||||
}
|
||||
if (c === ')') {
|
||||
if (acc === '' && ast.#parts.length === 0) {
|
||||
ast.#emptyExt = true;
|
||||
}
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
ast.push(...parts, part);
|
||||
return i;
|
||||
}
|
||||
acc += c;
|
||||
}
|
||||
// unfinished extglob
|
||||
// if we got here, it was a malformed extglob! not an extglob, but
|
||||
// maybe something else in there.
|
||||
ast.type = null;
|
||||
ast.#hasMagic = undefined;
|
||||
ast.#parts = [str.substring(pos - 1)];
|
||||
return i;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new AST(null, undefined, options);
|
||||
AST.#parseAST(pattern, ast, 0, options);
|
||||
return ast;
|
||||
}
|
||||
// returns the regular expression if there's magic, or the unescaped
|
||||
// string if not.
|
||||
toMMPattern() {
|
||||
// should only be called on root
|
||||
/* c8 ignore start */
|
||||
if (this !== this.#root)
|
||||
return this.#root.toMMPattern();
|
||||
/* c8 ignore stop */
|
||||
const glob = this.toString();
|
||||
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
||||
// if we're in nocase mode, and not nocaseMagicOnly, then we do
|
||||
// still need a regular expression if we have to case-insensitively
|
||||
// match capital/lowercase characters.
|
||||
const anyMagic = hasMagic ||
|
||||
this.#hasMagic ||
|
||||
(this.#options.nocase &&
|
||||
!this.#options.nocaseMagicOnly &&
|
||||
glob.toUpperCase() !== glob.toLowerCase());
|
||||
if (!anyMagic) {
|
||||
return body;
|
||||
}
|
||||
const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
|
||||
return Object.assign(new RegExp(`^${re}$`, flags), {
|
||||
_src: re,
|
||||
_glob: glob,
|
||||
});
|
||||
}
|
||||
get options() {
|
||||
return this.#options;
|
||||
}
|
||||
// returns the string match, the regexp source, whether there's magic
|
||||
// in the regexp (so a regular expression is required) and whether or
|
||||
// not the uflag is needed for the regular expression (for posix classes)
|
||||
// TODO: instead of injecting the start/end at this point, just return
|
||||
// the BODY of the regexp, along with the start/end portions suitable
|
||||
// for binding the start/end in either a joined full-path makeRe context
|
||||
// (where we bind to (^|/), or a standalone matchPart context (where
|
||||
// we bind to ^, and not /). Otherwise slashes get duped!
|
||||
//
|
||||
// In part-matching mode, the start is:
|
||||
// - if not isStart: nothing
|
||||
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
||||
// - if dots allowed or not possible: ^
|
||||
// - if dots possible and not allowed: ^(?!\.)
|
||||
// end is:
|
||||
// - if not isEnd(): nothing
|
||||
// - else: $
|
||||
//
|
||||
// In full-path matching mode, we put the slash at the START of the
|
||||
// pattern, so start is:
|
||||
// - if first pattern: same as part-matching mode
|
||||
// - if not isStart(): nothing
|
||||
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
||||
// - if dots allowed or not possible: /
|
||||
// - if dots possible and not allowed: /(?!\.)
|
||||
// end is:
|
||||
// - if last pattern, same as part-matching mode
|
||||
// - else nothing
|
||||
//
|
||||
// Always put the (?:$|/) on negated tails, though, because that has to be
|
||||
// there to bind the end of the negated pattern portion, and it's easier to
|
||||
// just stick it in now rather than try to inject it later in the middle of
|
||||
// the pattern.
|
||||
//
|
||||
// We can just always return the same end, and leave it up to the caller
|
||||
// to know whether it's going to be used joined or in parts.
|
||||
// And, if the start is adjusted slightly, can do the same there:
|
||||
// - if not isStart: nothing
|
||||
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
||||
// - if dots allowed or not possible: (?:/|^)
|
||||
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
||||
//
|
||||
// But it's better to have a simpler binding without a conditional, for
|
||||
// performance, so probably better to return both start options.
|
||||
//
|
||||
// Then the caller just ignores the end if it's not the first pattern,
|
||||
// and the start always gets applied.
|
||||
//
|
||||
// But that's always going to be $ if it's the ending pattern, or nothing,
|
||||
// so the caller can just attach $ at the end of the pattern when building.
|
||||
//
|
||||
// So the todo is:
|
||||
// - better detect what kind of start is needed
|
||||
// - return both flavors of starting pattern
|
||||
// - attach $ at the end of the pattern when creating the actual RegExp
|
||||
//
|
||||
// Ah, but wait, no, that all only applies to the root when the first pattern
|
||||
// is not an extglob. If the first pattern IS an extglob, then we need all
|
||||
// that dot prevention biz to live in the extglob portions, because eg
|
||||
// +(*|.x*) can match .xy but not .yx.
|
||||
//
|
||||
// So, return the two flavors if it's #root and the first child is not an
|
||||
// AST, otherwise leave it to the child AST to handle it, and there,
|
||||
// use the (?:^|/) style of start binding.
|
||||
//
|
||||
// Even simplified further:
|
||||
// - Since the start for a join is eg /(?!\.) and the start for a part
|
||||
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this)
|
||||
this.#fillNegs();
|
||||
if (!this.type) {
|
||||
const noEmpty = this.isStart() &&
|
||||
this.isEnd() &&
|
||||
!this.#parts.some(s => typeof s !== 'string');
|
||||
const src = this.#parts
|
||||
.map(p => {
|
||||
const [re, _, hasMagic, uflag] = typeof p === 'string'
|
||||
? AST.#parseGlob(p, this.#hasMagic, noEmpty)
|
||||
: p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.join('');
|
||||
let start = '';
|
||||
if (this.isStart()) {
|
||||
if (typeof this.#parts[0] === 'string') {
|
||||
// this is the string that will match the start of the pattern,
|
||||
// so we need to protect against dots and such.
|
||||
// '.' and '..' cannot match unless the pattern is that exactly,
|
||||
// even if it starts with . or dot:true is set.
|
||||
const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
|
||||
if (!dotTravAllowed) {
|
||||
const aps = addPatternStart;
|
||||
// check if we have a possibility of matching . or ..,
|
||||
// and prevent that.
|
||||
const needNoTrav =
|
||||
// dots are allowed, and the pattern starts with [ or .
|
||||
(dot && aps.has(src.charAt(0))) ||
|
||||
// the pattern starts with \., and then [ or .
|
||||
(src.startsWith('\\.') && aps.has(src.charAt(2))) ||
|
||||
// the pattern starts with \.\., and then [ or .
|
||||
(src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
|
||||
// no need to prevent dots if it can't match a dot, or if a
|
||||
// sub-pattern will be preventing it anyway.
|
||||
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
||||
start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
// append the "end of path portion" pattern to negation tails
|
||||
let end = '';
|
||||
if (this.isEnd() &&
|
||||
this.#root.#filledNegs &&
|
||||
this.#parent?.type === '!') {
|
||||
end = '(?:$|\\/)';
|
||||
}
|
||||
const final = start + src + end;
|
||||
return [
|
||||
final,
|
||||
(0, unescape_js_1.unescape)(src),
|
||||
(this.#hasMagic = !!this.#hasMagic),
|
||||
this.#uflag,
|
||||
];
|
||||
}
|
||||
// We need to calculate the body *twice* if it's a repeat pattern
|
||||
// at the start, once in nodot mode, then again in dot mode, so a
|
||||
// pattern like *(?) can match 'x.y'
|
||||
const repeated = this.type === '*' || this.type === '+';
|
||||
// some kind of extglob
|
||||
const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
|
||||
// invalid extglob, has to at least be *something* present, if it's
|
||||
// the entire path portion.
|
||||
const s = this.toString();
|
||||
this.#parts = [s];
|
||||
this.type = null;
|
||||
this.#hasMagic = undefined;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
// XXX abstract out this map method
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
|
||||
? ''
|
||||
: this.#partsToRegExp(true);
|
||||
if (bodyDotAllowed === body) {
|
||||
bodyDotAllowed = '';
|
||||
}
|
||||
if (bodyDotAllowed) {
|
||||
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
||||
}
|
||||
// an empty !() is exactly equivalent to a starNoEmpty
|
||||
let final = '';
|
||||
if (this.type === '!' && this.#emptyExt) {
|
||||
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
|
||||
}
|
||||
else {
|
||||
const close = this.type === '!'
|
||||
? // !() must match something,but !(x) can match ''
|
||||
'))' +
|
||||
(this.isStart() && !dot && !allowDot ? startNoDot : '') +
|
||||
star +
|
||||
')'
|
||||
: this.type === '@'
|
||||
? ')'
|
||||
: this.type === '?'
|
||||
? ')?'
|
||||
: this.type === '+' && bodyDotAllowed
|
||||
? ')'
|
||||
: this.type === '*' && bodyDotAllowed
|
||||
? `)?`
|
||||
: `)${this.type}`;
|
||||
final = start + body + close;
|
||||
}
|
||||
return [
|
||||
final,
|
||||
(0, unescape_js_1.unescape)(body),
|
||||
(this.#hasMagic = !!this.#hasMagic),
|
||||
this.#uflag,
|
||||
];
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts
|
||||
.map(p => {
|
||||
// extglob ASTs should only contain parent ASTs
|
||||
/* c8 ignore start */
|
||||
if (typeof p === 'string') {
|
||||
throw new Error('string type in extglob ast??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
// can ignore hasMagic, because extglobs are already always magic
|
||||
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.filter(p => !(this.isStart() && this.isEnd()) || !!p)
|
||||
.join('|');
|
||||
}
|
||||
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
||||
let escaping = false;
|
||||
let re = '';
|
||||
let uflag = false;
|
||||
for (let i = 0; i < glob.length; i++) {
|
||||
const c = glob.charAt(i);
|
||||
if (escaping) {
|
||||
escaping = false;
|
||||
re += (reSpecials.has(c) ? '\\' : '') + c;
|
||||
continue;
|
||||
}
|
||||
if (c === '\\') {
|
||||
if (i === glob.length - 1) {
|
||||
re += '\\\\';
|
||||
}
|
||||
else {
|
||||
escaping = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (c === '[') {
|
||||
const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);
|
||||
if (consumed) {
|
||||
re += src;
|
||||
uflag = uflag || needUflag;
|
||||
i += consumed - 1;
|
||||
hasMagic = hasMagic || magic;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (c === '*') {
|
||||
re += noEmpty && glob === '*' ? starNoEmpty : star;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
if (c === '?') {
|
||||
re += qmark;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
re += regExpEscape(c);
|
||||
}
|
||||
return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
|
||||
}
|
||||
}
|
||||
exports.AST = AST;
|
||||
//# sourceMappingURL=ast.js.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.js.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/ast.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts
generated
vendored
Normal file
8
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export type ParseClassResult = [
|
||||
src: string,
|
||||
uFlag: boolean,
|
||||
consumed: number,
|
||||
hasMagic: boolean
|
||||
];
|
||||
export declare const parseClass: (glob: string, position: number) => ParseClassResult;
|
||||
//# sourceMappingURL=brace-expressions.d.ts.map
|
||||
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map
generated
vendored
Normal file
1
backend/node_modules/@fastify/static/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AA+BA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,SACf,MAAM,YACF,MAAM,KACf,gBA6HF,CAAA"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user