Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
21
Frontend-Learner/node_modules/mlly/LICENSE
generated
vendored
Normal file
21
Frontend-Learner/node_modules/mlly/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Pooya Parsa <pooya@pi0.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
561
Frontend-Learner/node_modules/mlly/README.md
generated
vendored
Normal file
561
Frontend-Learner/node_modules/mlly/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,561 @@
|
|||
# mlly
|
||||
|
||||
[![npm version][npm-version-src]][npm-version-href]
|
||||
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
||||
[![Codecov][codecov-src]][codecov-href]
|
||||
|
||||
> Missing [ECMAScript module](https://nodejs.org/api/esm.html) utils for Node.js
|
||||
|
||||
While ESM Modules are evolving in Node.js ecosystem, there are still
|
||||
many required features that are still experimental or missing or needed to support ESM. This package tries to fill in the gap.
|
||||
|
||||
## Usage
|
||||
|
||||
Install npm package:
|
||||
|
||||
```sh
|
||||
# using yarn
|
||||
yarn add mlly
|
||||
|
||||
# using npm
|
||||
npm install mlly
|
||||
```
|
||||
|
||||
**Note:** Node.js 14+ is recommended.
|
||||
|
||||
Import utils:
|
||||
|
||||
```js
|
||||
// ESM
|
||||
import {} from "mlly";
|
||||
|
||||
// CommonJS
|
||||
const {} = require("mlly");
|
||||
```
|
||||
|
||||
## Resolving ESM modules
|
||||
|
||||
Several utilities to make ESM resolution easier:
|
||||
|
||||
- Respecting [ECMAScript Resolver algorithm](https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm)
|
||||
- Exposed from Node.js implementation
|
||||
- Windows paths normalized
|
||||
- Supporting custom `extensions` and `/index` resolution
|
||||
- Supporting custom `conditions`
|
||||
- Support resolving from multiple paths or urls
|
||||
|
||||
### `resolve` / `resolveSync`
|
||||
|
||||
Resolve a module by respecting [ECMAScript Resolver algorithm](https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm)
|
||||
(using [wooorm/import-meta-resolve](https://github.com/wooorm/import-meta-resolve)).
|
||||
|
||||
Additionally supports resolving without extension and `/index` similar to CommonJS.
|
||||
|
||||
```js
|
||||
import { resolve, resolveSync } from "mlly";
|
||||
|
||||
// file:///home/user/project/module.mjs
|
||||
console.log(await resolve("./module.mjs", { url: import.meta.url }));
|
||||
```
|
||||
|
||||
**Resolve options:**
|
||||
|
||||
- `url`: URL or string to resolve from (default is `pwd()`)
|
||||
- `conditions`: Array of conditions used for resolution algorithm (default is `['node', 'import']`)
|
||||
- `extensions`: Array of additional extensions to check if import failed (default is `['.mjs', '.cjs', '.js', '.json']`)
|
||||
|
||||
### `resolvePath` / `resolvePathSync`
|
||||
|
||||
Similar to `resolve` but returns a path instead of URL using `fileURLToPath`.
|
||||
|
||||
```js
|
||||
import { resolvePath, resolveSync } from "mlly";
|
||||
|
||||
// /home/user/project/module.mjs
|
||||
console.log(await resolvePath("./module.mjs", { url: import.meta.url }));
|
||||
```
|
||||
|
||||
### `createResolve`
|
||||
|
||||
Create a `resolve` function with defaults.
|
||||
|
||||
```js
|
||||
import { createResolve } from "mlly";
|
||||
|
||||
const _resolve = createResolve({ url: import.meta.url });
|
||||
|
||||
// file:///home/user/project/module.mjs
|
||||
console.log(await _resolve("./module.mjs"));
|
||||
```
|
||||
|
||||
**Example:** Ponyfill [import.meta.resolve](https://nodejs.org/api/esm.html#esm_import_meta_resolve_specifier_parent):
|
||||
|
||||
```js
|
||||
import { createResolve } from "mlly";
|
||||
|
||||
import.meta.resolve = createResolve({ url: import.meta.url });
|
||||
```
|
||||
|
||||
### `resolveImports`
|
||||
|
||||
Resolve all static and dynamic imports with relative paths to full resolved path.
|
||||
|
||||
```js
|
||||
import { resolveImports } from "mlly";
|
||||
|
||||
// import foo from 'file:///home/user/project/bar.mjs'
|
||||
console.log(
|
||||
await resolveImports(`import foo from './bar.mjs'`, { url: import.meta.url }),
|
||||
);
|
||||
```
|
||||
|
||||
## Syntax Analyzes
|
||||
|
||||
### `isValidNodeImport`
|
||||
|
||||
Using various syntax detection and heuristics, this method can determine if import is a valid import or not to be imported using dynamic `import()` before hitting an error!
|
||||
|
||||
When result is `false`, we usually need a to create a CommonJS require context or add specific rules to the bundler to transform dependency.
|
||||
|
||||
```js
|
||||
import { isValidNodeImport } from "mlly";
|
||||
|
||||
// If returns true, we are safe to use `import('some-lib')`
|
||||
await isValidNodeImport("some-lib", {});
|
||||
```
|
||||
|
||||
**Algorithm:**
|
||||
|
||||
- Check import protocol - If is `data:` return `true` (✅ valid) - If is not `node:`, `file:` or `data:`, return `false` (
|
||||
❌ invalid)
|
||||
- Resolve full path of import using Node.js [Resolution algorithm](https://nodejs.org/api/esm.html#resolution-algorithm)
|
||||
- Check full path extension
|
||||
- If is `.mjs`, `.cjs`, `.node` or `.wasm`, return `true` (✅ valid)
|
||||
- If is not `.js`, return `false` (❌ invalid)
|
||||
- If is matching known mixed syntax (`.esm.js`, `.es.js`, etc) return `false` (
|
||||
❌ invalid)
|
||||
- Read closest `package.json` file to resolve path
|
||||
- If `type: 'module'` field is set, return `true` (✅ valid)
|
||||
- Read source code of resolved path
|
||||
- Try to detect CommonJS syntax usage
|
||||
- If yes, return `true` (✅ valid)
|
||||
- Try to detect ESM syntax usage
|
||||
- if yes, return `false` (
|
||||
❌ invalid)
|
||||
|
||||
**Notes:**
|
||||
|
||||
- There might be still edge cases algorithm cannot cover. It is designed with best-efforts.
|
||||
- This method also allows using dynamic import of CommonJS libraries considering
|
||||
Node.js has [Interoperability with CommonJS](https://nodejs.org/api/esm.html#interoperability-with-commonjs).
|
||||
|
||||
### `hasESMSyntax`
|
||||
|
||||
Detect if code, has usage of ESM syntax (Static `import`, ESM `export` and `import.meta` usage)
|
||||
|
||||
```js
|
||||
import { hasESMSyntax } from "mlly";
|
||||
|
||||
hasESMSyntax("export default foo = 123"); // true
|
||||
```
|
||||
|
||||
### `hasCJSSyntax`
|
||||
|
||||
Detect if code, has usage of CommonJS syntax (`exports`, `module.exports`, `require` and `global` usage)
|
||||
|
||||
```js
|
||||
import { hasCJSSyntax } from "mlly";
|
||||
|
||||
hasCJSSyntax("export default foo = 123"); // false
|
||||
```
|
||||
|
||||
### `detectSyntax`
|
||||
|
||||
Tests code against both CJS and ESM.
|
||||
|
||||
`isMixed` indicates if both are detected! This is a common case with legacy packages exporting semi-compatible ESM syntax meant to be used by bundlers.
|
||||
|
||||
```js
|
||||
import { detectSyntax } from "mlly";
|
||||
|
||||
// { hasESM: true, hasCJS: true, isMixed: true }
|
||||
detectSyntax('export default require("lodash")');
|
||||
```
|
||||
|
||||
## CommonJS Context
|
||||
|
||||
### `createCommonJS`
|
||||
|
||||
This utility creates a compatible CommonJS context that is missing in ECMAScript modules.
|
||||
|
||||
```js
|
||||
import { createCommonJS } from "mlly";
|
||||
|
||||
const { __dirname, __filename, require } = createCommonJS(import.meta.url);
|
||||
```
|
||||
|
||||
Note: `require` and `require.resolve` implementation are lazy functions. [`createRequire`](https://nodejs.org/api/module.html#module_module_createrequire_filename) will be called on first usage.
|
||||
|
||||
## Import/Export Analyzes
|
||||
|
||||
Tools to quickly analyze ESM syntax and extract static `import`/`export`
|
||||
|
||||
- Super fast Regex based implementation
|
||||
- Handle most edge cases
|
||||
- Find all static ESM imports
|
||||
- Find all dynamic ESM imports
|
||||
- Parse static import statement
|
||||
- Find all named, declared and default exports
|
||||
|
||||
### `findStaticImports`
|
||||
|
||||
Find all static ESM imports.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
import { findStaticImports } from "mlly";
|
||||
|
||||
console.log(
|
||||
findStaticImports(`
|
||||
// Empty line
|
||||
import foo, { bar /* foo */ } from 'baz'
|
||||
`),
|
||||
);
|
||||
```
|
||||
|
||||
Outputs:
|
||||
|
||||
```js
|
||||
[
|
||||
{
|
||||
type: "static",
|
||||
imports: "foo, { bar /* foo */ } ",
|
||||
specifier: "baz",
|
||||
code: "import foo, { bar /* foo */ } from 'baz'",
|
||||
start: 15,
|
||||
end: 55,
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
### `parseStaticImport`
|
||||
|
||||
Parse a dynamic ESM import statement previously matched by `findStaticImports`.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
import { findStaticImports, parseStaticImport } from "mlly";
|
||||
|
||||
const [match0] = findStaticImports(`import baz, { x, y as z } from 'baz'`);
|
||||
console.log(parseStaticImport(match0));
|
||||
```
|
||||
|
||||
Outputs:
|
||||
|
||||
```js
|
||||
{
|
||||
type: 'static',
|
||||
imports: 'baz, { x, y as z } ',
|
||||
specifier: 'baz',
|
||||
code: "import baz, { x, y as z } from 'baz'",
|
||||
start: 0,
|
||||
end: 36,
|
||||
defaultImport: 'baz',
|
||||
namespacedImport: undefined,
|
||||
namedImports: { x: 'x', y: 'z' }
|
||||
}
|
||||
```
|
||||
|
||||
### `findDynamicImports`
|
||||
|
||||
Find all dynamic ESM imports.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
import { findDynamicImports } from "mlly";
|
||||
|
||||
console.log(
|
||||
findDynamicImports(`
|
||||
const foo = await import('bar')
|
||||
`),
|
||||
);
|
||||
```
|
||||
|
||||
### `findExports`
|
||||
|
||||
```js
|
||||
import { findExports } from "mlly";
|
||||
|
||||
console.log(
|
||||
findExports(`
|
||||
export const foo = 'bar'
|
||||
export { bar, baz }
|
||||
export default something
|
||||
`),
|
||||
);
|
||||
```
|
||||
|
||||
Outputs:
|
||||
|
||||
```js
|
||||
[
|
||||
{
|
||||
type: "declaration",
|
||||
declaration: "const",
|
||||
name: "foo",
|
||||
code: "export const foo",
|
||||
start: 1,
|
||||
end: 17,
|
||||
},
|
||||
{
|
||||
type: "named",
|
||||
exports: " bar, baz ",
|
||||
code: "export { bar, baz }",
|
||||
start: 26,
|
||||
end: 45,
|
||||
names: ["bar", "baz"],
|
||||
},
|
||||
{ type: "default", code: "export default ", start: 46, end: 61 },
|
||||
];
|
||||
```
|
||||
|
||||
### `findExportNames`
|
||||
|
||||
Same as `findExports` but returns array of export names.
|
||||
|
||||
```js
|
||||
import { findExportNames } from "mlly";
|
||||
|
||||
// [ "foo", "bar", "baz", "default" ]
|
||||
console.log(
|
||||
findExportNames(`
|
||||
export const foo = 'bar'
|
||||
export { bar, baz }
|
||||
export default something
|
||||
`),
|
||||
);
|
||||
```
|
||||
|
||||
## `resolveModuleExportNames`
|
||||
|
||||
Resolves module and reads its contents to extract possible export names using static analyzes.
|
||||
|
||||
```js
|
||||
import { resolveModuleExportNames } from "mlly";
|
||||
|
||||
// ["basename", "dirname", ... ]
|
||||
console.log(await resolveModuleExportNames("mlly"));
|
||||
```
|
||||
|
||||
## Evaluating Modules
|
||||
|
||||
Set of utilities to evaluate ESM modules using `data:` imports
|
||||
|
||||
- Automatic import rewrite to resolved path using static analyzes
|
||||
- Allow bypass ESM Cache
|
||||
- Stack-trace support
|
||||
- `.json` loader
|
||||
|
||||
### `evalModule`
|
||||
|
||||
Transform and evaluates module code using dynamic imports.
|
||||
|
||||
```js
|
||||
import { evalModule } from "mlly";
|
||||
|
||||
await evalModule(`console.log("Hello World!")`);
|
||||
|
||||
await evalModule(
|
||||
`
|
||||
import { reverse } from './utils.mjs'
|
||||
console.log(reverse('!emosewa si sj'))
|
||||
`,
|
||||
{ url: import.meta.url },
|
||||
);
|
||||
```
|
||||
|
||||
**Options:**
|
||||
|
||||
- all `resolve` options
|
||||
- `url`: File URL
|
||||
|
||||
### `loadModule`
|
||||
|
||||
Dynamically loads a module by evaluating source code.
|
||||
|
||||
```js
|
||||
import { loadModule } from "mlly";
|
||||
|
||||
await loadModule("./hello.mjs", { url: import.meta.url });
|
||||
```
|
||||
|
||||
Options are same as `evalModule`.
|
||||
|
||||
### `transformModule`
|
||||
|
||||
- Resolves all relative imports will be resolved
|
||||
- All usages of `import.meta.url` will be replaced with `url` or `from` option
|
||||
|
||||
```js
|
||||
import { transformModule } from "mlly";
|
||||
console.log(transformModule(`console.log(import.meta.url)`), {
|
||||
url: "test.mjs",
|
||||
});
|
||||
```
|
||||
|
||||
Options are same as `evalModule`.
|
||||
|
||||
## Other Utils
|
||||
|
||||
### `fileURLToPath`
|
||||
|
||||
Similar to [url.fileURLToPath](https://nodejs.org/api/url.html#url_url_fileurltopath_url) but also converts windows backslash `\` to unix slash `/` and handles if input is already a path.
|
||||
|
||||
```js
|
||||
import { fileURLToPath } from "mlly";
|
||||
|
||||
// /foo/bar.js
|
||||
console.log(fileURLToPath("file:///foo/bar.js"));
|
||||
|
||||
// C:/path
|
||||
console.log(fileURLToPath("file:///C:/path/"));
|
||||
```
|
||||
|
||||
### `pathToFileURL`
|
||||
|
||||
Similar to [url.pathToFileURL](https://nodejs.org/api/url.html#urlpathtofileurlpath) but also handles `URL` input and returns a **string** with `file://` protocol.
|
||||
|
||||
```js
|
||||
import { pathToFileURL } from "mlly";
|
||||
|
||||
// /foo/bar.js
|
||||
console.log(pathToFileURL("foo/bar.js"));
|
||||
|
||||
// C:/path
|
||||
console.log(pathToFileURL("C:\\path"));
|
||||
```
|
||||
|
||||
### `normalizeid`
|
||||
|
||||
Ensures id has either of `node:`, `data:`, `http:`, `https:` or `file:` protocols.
|
||||
|
||||
```js
|
||||
import { ensureProtocol } from "mlly";
|
||||
|
||||
// file:///foo/bar.js
|
||||
console.log(normalizeid("/foo/bar.js"));
|
||||
```
|
||||
|
||||
### `loadURL`
|
||||
|
||||
Read source contents of a URL. (currently only file protocol supported)
|
||||
|
||||
```js
|
||||
import { resolve, loadURL } from "mlly";
|
||||
|
||||
const url = await resolve("./index.mjs", { url: import.meta.url });
|
||||
console.log(await loadURL(url));
|
||||
```
|
||||
|
||||
### `toDataURL`
|
||||
|
||||
Convert code to [`data:`](https://nodejs.org/api/esm.html#esm_data_imports) URL using base64 encoding.
|
||||
|
||||
```js
|
||||
import { toDataURL } from "mlly";
|
||||
|
||||
console.log(
|
||||
toDataURL(`
|
||||
// This is an example
|
||||
console.log('Hello world')
|
||||
`),
|
||||
);
|
||||
```
|
||||
|
||||
### `interopDefault`
|
||||
|
||||
Return the default export of a module at the top-level, alongside any other named exports.
|
||||
|
||||
```js
|
||||
// Assuming the shape { default: { foo: 'bar' }, baz: 'qux' }
|
||||
import myModule from "my-module";
|
||||
|
||||
// Returns { foo: 'bar', baz: 'qux' }
|
||||
console.log(interopDefault(myModule));
|
||||
```
|
||||
|
||||
**Options:**
|
||||
|
||||
- `preferNamespace`: In case that `default` value exists but is not extendable (when is string for example), return input as-is (default is `false`, meaning `default`'s value is prefered even if cannot be extended)
|
||||
|
||||
### `sanitizeURIComponent`
|
||||
|
||||
Replace reserved characters from a segment of URI to make it compatible with [rfc2396](https://datatracker.ietf.org/doc/html/rfc2396).
|
||||
|
||||
```js
|
||||
import { sanitizeURIComponent } from "mlly";
|
||||
|
||||
// foo_bar
|
||||
console.log(sanitizeURIComponent(`foo:bar`));
|
||||
```
|
||||
|
||||
### `sanitizeFilePath`
|
||||
|
||||
Sanitize each path of a file name or path with `sanitizeURIComponent` for URI compatibility.
|
||||
|
||||
```js
|
||||
import { sanitizeFilePath } from "mlly";
|
||||
|
||||
// C:/te_st/_...slug_.jsx'
|
||||
console.log(sanitizeFilePath("C:\\te#st\\[...slug].jsx"));
|
||||
```
|
||||
|
||||
### `parseNodeModulePath`
|
||||
|
||||
Parses an absolute file path in `node_modules` to three segments:
|
||||
|
||||
- `dir`: Path to main directory of package
|
||||
- `name`: Package name
|
||||
- `subpath`: The optional package subpath
|
||||
|
||||
It returns an empty object (with partial keys) if parsing fails.
|
||||
|
||||
```js
|
||||
import { parseNodeModulePath } from "mlly";
|
||||
|
||||
// dir: "/src/a/node_modules/"
|
||||
// name: "lib"
|
||||
// subpath: "./dist/index.mjs"
|
||||
const { dir, name, subpath } = parseNodeModulePath(
|
||||
"/src/a/node_modules/lib/dist/index.mjs",
|
||||
);
|
||||
```
|
||||
|
||||
### `lookupNodeModuleSubpath`
|
||||
|
||||
Parses an absolute file path in `node_modules` and tries to reverse lookup (or guess) the original package exports subpath for it.
|
||||
|
||||
```js
|
||||
import { lookupNodeModuleSubpath } from "mlly";
|
||||
|
||||
// subpath: "./utils"
|
||||
const subpath = lookupNodeModuleSubpath(
|
||||
"/src/a/node_modules/lib/dist/utils.mjs",
|
||||
);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) - Made with 💛
|
||||
|
||||
<!-- Badges -->
|
||||
|
||||
[npm-version-src]: https://img.shields.io/npm/v/mlly?style=flat&colorA=18181B&colorB=F0DB4F
|
||||
[npm-version-href]: https://npmjs.com/package/mlly
|
||||
[npm-downloads-src]: https://img.shields.io/npm/dm/mlly?style=flat&colorA=18181B&colorB=F0DB4F
|
||||
[npm-downloads-href]: https://npmjs.com/package/mlly
|
||||
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/mlly/main?style=flat&colorA=18181B&colorB=F0DB4F
|
||||
[codecov-href]: https://codecov.io/gh/unjs/mlly
|
||||
2661
Frontend-Learner/node_modules/mlly/dist/index.cjs
generated
vendored
Normal file
2661
Frontend-Learner/node_modules/mlly/dist/index.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
564
Frontend-Learner/node_modules/mlly/dist/index.d.cts
generated
vendored
Normal file
564
Frontend-Learner/node_modules/mlly/dist/index.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,564 @@
|
|||
interface ResolveOptions {
|
||||
/**
|
||||
* A URL, path or array of URLs/paths to resolve against.
|
||||
*/
|
||||
url?: string | URL | (string | URL)[];
|
||||
/**
|
||||
* File extensions to consider when resolving modules.
|
||||
*/
|
||||
extensions?: string[];
|
||||
/**
|
||||
* Conditions to consider when resolving package exports.
|
||||
*/
|
||||
conditions?: string[];
|
||||
}
|
||||
/**
|
||||
* Synchronously resolves a module path based on the options provided.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
||||
* @returns {string} The resolved URL as a string.
|
||||
*/
|
||||
declare function resolveSync(id: string, options?: ResolveOptions): string;
|
||||
/**
|
||||
* Asynchronously resolves a module path based on the given options.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
|
||||
* @returns {Promise<string>} A promise to resolve the URL as a string.
|
||||
*/
|
||||
declare function resolve(id: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Synchronously resolves a module path to a local file path based on the given options.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
||||
* @returns {string} The resolved file path.
|
||||
*/
|
||||
declare function resolvePathSync(id: string, options?: ResolveOptions): string;
|
||||
/**
|
||||
* Asynchronously resolves a module path to a local file path based on the options provided.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
|
||||
* @returns {Promise<string>} A promise to resolve to the file path.
|
||||
*/
|
||||
declare function resolvePath(id: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Creates a resolver function with default options that can be used to resolve module identifiers.
|
||||
*
|
||||
* @param {ResolveOptions} [defaults] - Default options to use for all resolutions. See {@link ResolveOptions}.
|
||||
* @returns {Function} A resolver function that takes an identifier and an optional URL, and resolves the identifier using the default options and the given URL.
|
||||
*/
|
||||
declare function createResolve(defaults?: ResolveOptions): (id: string, url?: ResolveOptions["url"]) => Promise<string>;
|
||||
/**
|
||||
* Parses a node module path to extract the directory, name, and subpath.
|
||||
*
|
||||
* @param {string} path - The path to parse.
|
||||
* @returns {Object} An object containing the directory, module name, and subpath of the node module.
|
||||
*/
|
||||
declare function parseNodeModulePath(path: string): {
|
||||
dir?: undefined;
|
||||
name?: undefined;
|
||||
subpath?: undefined;
|
||||
} | {
|
||||
dir: string;
|
||||
name: string;
|
||||
subpath: string | undefined;
|
||||
};
|
||||
/**
|
||||
* Attempts to reverse engineer a subpath export within a node module.
|
||||
*
|
||||
* @param {string} path - The path within the node module.
|
||||
* @returns {Promise<string | undefined>} A promise that resolves to the detected subpath or undefined if not found.
|
||||
*/
|
||||
declare function lookupNodeModuleSubpath(path: string): Promise<string | undefined>;
|
||||
|
||||
/**
|
||||
* Represents a general structure for ECMAScript module imports.
|
||||
*/
|
||||
interface ESMImport {
|
||||
/**
|
||||
* Specifies the type of import: "static" for static imports and "dynamic" for dynamic imports.
|
||||
*/
|
||||
type: "static" | "dynamic";
|
||||
/**
|
||||
* The full import declaration code snippet as a string.
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The starting position (index) of the import declaration in the source code.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The end position (index) of the import declaration in the source code.
|
||||
*/
|
||||
end: number;
|
||||
}
|
||||
/**
|
||||
* Represents a static import declaration in an ECMAScript module.
|
||||
* Extends {@link ESMImport}.
|
||||
*/
|
||||
interface StaticImport extends ESMImport {
|
||||
/**
|
||||
* Indicates the type of import, specifically a static import.
|
||||
*/
|
||||
type: "static";
|
||||
/**
|
||||
* Contains the entire import statement as a string, excluding the module specifier.
|
||||
*/
|
||||
imports: string;
|
||||
/**
|
||||
* The module specifier from which imports are being brought in.
|
||||
*/
|
||||
specifier: string;
|
||||
}
|
||||
/**
|
||||
* Represents a parsed static import declaration with detailed components of the import.
|
||||
* Extends {@link StaticImport}.
|
||||
*/
|
||||
interface ParsedStaticImport extends StaticImport {
|
||||
/**
|
||||
* The default import name, if any.
|
||||
* @optional
|
||||
*/
|
||||
defaultImport?: string;
|
||||
/**
|
||||
* The namespace import name, if any, using the `* as` syntax.
|
||||
* @optional
|
||||
*/
|
||||
namespacedImport?: string;
|
||||
/**
|
||||
* An object representing named imports, with their local aliases if specified.
|
||||
* Each property key is the original name and its value is the alias.
|
||||
* @optional
|
||||
*/
|
||||
namedImports?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents a dynamic import declaration that is loaded at runtime.
|
||||
* Extends {@link ESMImport}.
|
||||
*/
|
||||
interface DynamicImport extends ESMImport {
|
||||
/**
|
||||
* Indicates that this is a dynamic import.
|
||||
*/
|
||||
type: "dynamic";
|
||||
/**
|
||||
* The expression or path to be dynamically imported, typically a module path or URL.
|
||||
*/
|
||||
expression: string;
|
||||
}
|
||||
/**
|
||||
* Represents a type-specific import, primarily used for importing types in TypeScript.
|
||||
* Extends {@link ESMImport} but omits the 'type' to redefine it specifically for type imports.
|
||||
*/
|
||||
interface TypeImport extends Omit<ESMImport, "type"> {
|
||||
/**
|
||||
* Specifies that this is a type import.
|
||||
*/
|
||||
type: "type";
|
||||
/**
|
||||
* Contains the entire type import statement as a string, excluding the module specifier.
|
||||
*/
|
||||
imports: string;
|
||||
/**
|
||||
* The module specifier from which to import types.
|
||||
*/
|
||||
specifier: string;
|
||||
}
|
||||
/**
|
||||
* Represents a general structure for ECMAScript module exports.
|
||||
*/
|
||||
interface ESMExport {
|
||||
/**
|
||||
* Optional explicit type for complex scenarios, often used internally.
|
||||
* @optional
|
||||
*/
|
||||
_type?: "declaration" | "named" | "default" | "star";
|
||||
/**
|
||||
* The type of export (declaration, named, default or star).
|
||||
*/
|
||||
type: "declaration" | "named" | "default" | "star";
|
||||
/**
|
||||
* The specific type of declaration being exported, if applicable.
|
||||
* @optional
|
||||
*/
|
||||
declarationType?: "let" | "var" | "const" | "enum" | "const enum" | "class" | "function" | "async function";
|
||||
/**
|
||||
* The full code snippet of the export statement.
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The starting position (index) of the export declaration in the source code.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The end position (index) of the export declaration in the source code.
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* The name of the variable, function or class being exported, if given explicitly.
|
||||
* @optional
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The name used for default exports when a specific identifier isn't given.
|
||||
* @optional
|
||||
*/
|
||||
defaultName?: string;
|
||||
/**
|
||||
* An array of names to export, applicable to named and destructured exports.
|
||||
*/
|
||||
names: string[];
|
||||
/**
|
||||
* The module specifier, if any, from which exports are being re-exported.
|
||||
* @optional
|
||||
*/
|
||||
specifier?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a declaration export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface DeclarationExport extends ESMExport {
|
||||
/**
|
||||
* Indicates that this export is a declaration export.
|
||||
*/
|
||||
type: "declaration";
|
||||
/**
|
||||
* The declaration string, such as 'let', 'const', 'class', etc., describing what is being exported.
|
||||
*/
|
||||
declaration: string;
|
||||
/**
|
||||
* The name of the declaration to be exported.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
/**
|
||||
* Represents a named export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface NamedExport extends ESMExport {
|
||||
/**
|
||||
* Specifies that this export is a named export.
|
||||
*/
|
||||
type: "named";
|
||||
/**
|
||||
* The export string, containing all exported identifiers.
|
||||
*/
|
||||
exports: string;
|
||||
/**
|
||||
* An array of names to export.
|
||||
*/
|
||||
names: string[];
|
||||
/**
|
||||
* The module specifier, if any, from which exports are being re-exported.
|
||||
* @optional
|
||||
*/
|
||||
specifier?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a standard export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface DefaultExport extends ESMExport {
|
||||
/**
|
||||
* Specifies that this export is a standard export.
|
||||
*/
|
||||
type: "default";
|
||||
}
|
||||
/**
|
||||
* Regular expression to match static import statements in JavaScript/TypeScript code.
|
||||
* @example `import { foo, bar as baz } from 'module'`
|
||||
*/
|
||||
declare const ESM_STATIC_IMPORT_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match dynamic import statements in JavaScript/TypeScript code.
|
||||
* @example `import('module')`
|
||||
*/
|
||||
declare const DYNAMIC_IMPORT_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match various types of export declarations including variables, functions, and classes.
|
||||
* @example `export const num = 1, str = 'hello'; export class Example {}`
|
||||
*/
|
||||
declare const EXPORT_DECAL_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match export declarations specifically for types, interfaces, and type aliases in TypeScript.
|
||||
* @example `export type Result = { success: boolean; }; export interface User { name: string; age: number; };`
|
||||
*/
|
||||
declare const EXPORT_DECAL_TYPE_RE: RegExp;
|
||||
/**
|
||||
* Finds all static import statements within the given code string.
|
||||
* @param {string} code - The source code to search for static imports.
|
||||
* @returns {StaticImport[]} An array of {@link StaticImport} objects representing each static import found.
|
||||
*/
|
||||
declare function findStaticImports(code: string): StaticImport[];
|
||||
/**
|
||||
* Searches for dynamic import statements in the given source code.
|
||||
* @param {string} code - The source to search for dynamic imports in.
|
||||
* @returns {DynamicImport[]} An array of {@link DynamicImport} objects representing each dynamic import found.
|
||||
*/
|
||||
declare function findDynamicImports(code: string): DynamicImport[];
|
||||
/**
|
||||
* Identifies and returns all type import statements in the given source code.
|
||||
* This function is specifically targeted at type imports used in TypeScript.
|
||||
* @param {string} code - The source code to search for type imports.
|
||||
* @returns {TypeImport[]} An array of {@link TypeImport} objects representing each type import found.
|
||||
*/
|
||||
declare function findTypeImports(code: string): TypeImport[];
|
||||
/**
|
||||
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
|
||||
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
|
||||
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
|
||||
*/
|
||||
declare function parseStaticImport(matched: StaticImport | TypeImport): ParsedStaticImport;
|
||||
/**
|
||||
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
|
||||
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
|
||||
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
|
||||
*/
|
||||
declare function parseTypeImport(matched: TypeImport | StaticImport): ParsedStaticImport;
|
||||
/**
|
||||
* Identifies all export statements in the supplied source code and categorises them into different types such as declarations, named, default and star exports.
|
||||
* This function processes the code to capture different forms of export statements and normalise their representation for further processing.
|
||||
*
|
||||
* @param {string} code - The source code containing the export statements to be analysed.
|
||||
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each export found, properly categorised and structured.
|
||||
*/
|
||||
declare function findExports(code: string): ESMExport[];
|
||||
/**
|
||||
* Searches specifically for type-related exports in TypeScript code, such as exported interfaces, types, and declarations prefixed with 'declare'.
|
||||
* This function uses specialised regular expressions to identify type exports and normalises them for consistency.
|
||||
*
|
||||
* @param {string} code - The TypeScript source code to search for type exports.
|
||||
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each type export found.
|
||||
*/
|
||||
declare function findTypeExports(code: string): ESMExport[];
|
||||
/**
|
||||
* Extracts and returns a list of all export names from the given source.
|
||||
* This function uses {@link findExports} to retrieve all types of exports and consolidates their names into a single array.
|
||||
*
|
||||
* @param {string} code - The source code to search for export names.
|
||||
* @returns {string[]} An array containing the names of all exports found in the code.
|
||||
*/
|
||||
declare function findExportNames(code: string): string[];
|
||||
/**
|
||||
* Asynchronously resolves and returns all export names from a module specified by its module identifier.
|
||||
* This function recursively resolves all explicitly named and asterisked (* as) exports to fully enumerate the exported identifiers.
|
||||
*
|
||||
* @param {string} id - The module identifier to resolve.
|
||||
* @param {ResolveOptions} [options] - Optional settings for resolving the module path, such as the base URL.
|
||||
* @returns {Promise<string[]>} A promise that resolves to an array of export names from the module.
|
||||
*/
|
||||
declare function resolveModuleExportNames(id: string, options?: ResolveOptions): Promise<string[]>;
|
||||
|
||||
/**
|
||||
* Represents the context of a CommonJS environment, providing node-like module resolution capabilities within a module.
|
||||
*/
|
||||
interface CommonjsContext {
|
||||
/**
|
||||
* The absolute path to the current module file.
|
||||
*/
|
||||
__filename: string;
|
||||
/**
|
||||
* The directory name of the current module.
|
||||
*/
|
||||
__dirname: string;
|
||||
/**
|
||||
* A function to require modules as in CommonJS.
|
||||
*/
|
||||
require: NodeRequire;
|
||||
}
|
||||
/**
|
||||
* Creates a CommonJS context for a given module URL, enabling `require`, `__filename` and `__dirname` support similar to Node.js.
|
||||
* This function dynamically generates a `require` function that is context-aware and bound to the location of the given module URL.
|
||||
*
|
||||
* @param {string} url - The URL of the module file to create a context for.
|
||||
* @returns {CommonjsContext} A context object containing `__filename`, `__dirname` and a custom `require` function. See {@link CommonjsContext}.
|
||||
*/
|
||||
declare function createCommonJS(url: string): CommonjsContext;
|
||||
declare function interopDefault(sourceModule: any, opts?: {
|
||||
preferNamespace?: boolean;
|
||||
}): any;
|
||||
|
||||
/**
|
||||
* Options for evaluating or transforming modules, extending resolution options with optional URL specifications.
|
||||
*/
|
||||
interface EvaluateOptions extends ResolveOptions {
|
||||
/**
|
||||
* The URL of the module, which can be specified to override the URL resolved from the module identifier.
|
||||
* @optional
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
/**
|
||||
* Loads a module by resolving its identifier to a URL, fetching the module's code and evaluating it.
|
||||
*
|
||||
* @param {string} id - The identifier of the module to load.
|
||||
* @param {EvaluateOptions} options - Optional parameters to resolve and load the module. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<any>} A promise to resolve to the evaluated module.
|
||||
* });
|
||||
*/
|
||||
declare function loadModule(id: string, options?: EvaluateOptions): Promise<any>;
|
||||
/**
|
||||
* Evaluates JavaScript code as a module using a dynamic import from a data URL.
|
||||
*
|
||||
* @param {string} code - The code of the module to evaluate.
|
||||
* @param {EvaluateOptions} options - Includes the original URL of the module for better error mapping. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<any>} A promise that resolves to the evaluated module or throws an error if the evaluation fails.
|
||||
*/
|
||||
declare function evalModule(code: string, options?: EvaluateOptions): Promise<any>;
|
||||
/**
|
||||
* Transform module code to handle specific scenarios, such as converting JSON to a module or rewriting import.meta.url.
|
||||
*
|
||||
* @param {string} code - The code of the module to transform.
|
||||
* @param {EvaluateOptions} options - Options to control how the code is transformed. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<string>} A promise that resolves to the transformed code.
|
||||
*/
|
||||
declare function transformModule(code: string, options?: EvaluateOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves all import URLs found within the provided code to their absolute URLs, based on the given options.
|
||||
*
|
||||
* @param {string} code - The code containing the import directives to resolve.
|
||||
* @param {EvaluateOptions} [options] - Options to use for resolving imports. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<string>} A promise that resolves to the code, replacing import URLs with resolved URLs.
|
||||
*/
|
||||
declare function resolveImports(code: string, options?: EvaluateOptions): Promise<string>;
|
||||
|
||||
/**
|
||||
* Options for detecting syntax within a code string.
|
||||
*/
|
||||
type DetectSyntaxOptions = {
|
||||
/**
|
||||
* Indicates whether comments should be stripped from the code before syntax checking.
|
||||
* @default false
|
||||
*/
|
||||
stripComments?: boolean;
|
||||
};
|
||||
/**
|
||||
* Determines if a given code string contains ECMAScript module syntax.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
|
||||
*/
|
||||
declare function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
|
||||
/**
|
||||
* Determines if a given string of code contains CommonJS syntax.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
|
||||
*/
|
||||
declare function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
|
||||
/**
|
||||
* Analyses the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
|
||||
*/
|
||||
declare function detectSyntax(code: string, opts?: DetectSyntaxOptions): {
|
||||
hasESM: boolean;
|
||||
hasCJS: boolean;
|
||||
isMixed: boolean;
|
||||
};
|
||||
interface ValidNodeImportOptions extends ResolveOptions {
|
||||
/**
|
||||
* The contents of the import, which may be analyzed to see if it contains
|
||||
* CJS or ESM syntax as a last step in checking whether it is a valid import.
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* Protocols that are allowed as valid node imports.
|
||||
*
|
||||
* @default ['node', 'file', 'data']
|
||||
*
|
||||
*/
|
||||
allowedProtocols?: Array<string>;
|
||||
/**
|
||||
* Whether to strip comments from the code before checking for ESM syntax.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
stripComments?: boolean;
|
||||
}
|
||||
/**
|
||||
* Validates whether a given identifier represents a valid node import, based on its protocol, file extension, and optionally its contents.
|
||||
*
|
||||
* @param {string} id - The identifier or URL of the import to validate.
|
||||
* @param {ValidNodeImportOptions} _options - Options for resolving and validating the import. See {@link ValidNodeImportOptions}.
|
||||
* @returns {Promise<boolean>} A promise that resolves to `true` if the import is valid, otherwise `false`.
|
||||
*/
|
||||
declare function isValidNodeImport(id: string, _options?: ValidNodeImportOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Converts a file URL to a local file system path with normalized slashes.
|
||||
*
|
||||
* @param {string | URL} id - The file URL or local path to convert.
|
||||
* @returns {string} A normalized file system path.
|
||||
*/
|
||||
declare function fileURLToPath(id: string | URL): string;
|
||||
/**
|
||||
* Converts a local file system path to a file URL.
|
||||
*
|
||||
* @param {string | URL} id - The file system path to convert.
|
||||
* @returns {string} The resulting file URL as a string.
|
||||
*/
|
||||
declare function pathToFileURL(id: string | URL): string;
|
||||
/**
|
||||
* Sanitises a component of a URI by replacing invalid characters.
|
||||
*
|
||||
* @param {string} name - The URI component to sanitise.
|
||||
* @param {string} [replacement="_"] - The string to replace invalid characters with.
|
||||
* @returns {string} The sanitised URI component.
|
||||
*/
|
||||
declare function sanitizeURIComponent(name?: string, replacement?: string): string;
|
||||
/**
|
||||
* Cleans a file path string by sanitising each component of the path.
|
||||
*
|
||||
* @param {string} filePath - The file path to sanitise.
|
||||
* @returns {string} The sanitised file path.
|
||||
*/
|
||||
declare function sanitizeFilePath(filePath?: string): string;
|
||||
/**
|
||||
* Normalises a module identifier to ensure it has a protocol if missing, handling built-in modules and file paths.
|
||||
*
|
||||
* @param {string} id - The identifier to normalise.
|
||||
* @returns {string} The normalised identifier with the appropriate protocol.
|
||||
*/
|
||||
declare function normalizeid(id: string): string;
|
||||
/**
|
||||
* Loads the contents of a file from a URL into a string.
|
||||
*
|
||||
* @param {string} url - The URL of the file to load.
|
||||
* @returns {Promise<string>} A promise that resolves to the content of the file.
|
||||
*/
|
||||
declare function loadURL(url: string): Promise<string>;
|
||||
/**
|
||||
* Converts a string of code into a data URL that can be used for dynamic imports.
|
||||
*
|
||||
* @param {string} code - The string of code to convert.
|
||||
* @returns {string} The data URL containing the encoded code.
|
||||
*/
|
||||
declare function toDataURL(code: string): string;
|
||||
/**
|
||||
* Checks if a module identifier matches a Node.js built-in module.
|
||||
*
|
||||
* @param {string} id - The identifier to check.
|
||||
* @returns {boolean} `true` if the identifier is a built-in module, otherwise `false`.
|
||||
*/
|
||||
declare function isNodeBuiltin(id?: string): boolean;
|
||||
/**
|
||||
* Extracts the protocol portion of a given identifier string.
|
||||
*
|
||||
* @param {string} id - The identifier from which to extract the log.
|
||||
* @returns {string | undefined} The protocol part of the identifier, or undefined if no protocol is present.
|
||||
*/
|
||||
declare function getProtocol(id: string): string | undefined;
|
||||
|
||||
export { DYNAMIC_IMPORT_RE, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, pathToFileURL, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule };
|
||||
export type { CommonjsContext, DeclarationExport, DefaultExport, DetectSyntaxOptions, DynamicImport, ESMExport, ESMImport, EvaluateOptions, NamedExport, ParsedStaticImport, ResolveOptions, StaticImport, TypeImport, ValidNodeImportOptions };
|
||||
564
Frontend-Learner/node_modules/mlly/dist/index.d.mts
generated
vendored
Normal file
564
Frontend-Learner/node_modules/mlly/dist/index.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,564 @@
|
|||
interface ResolveOptions {
|
||||
/**
|
||||
* A URL, path or array of URLs/paths to resolve against.
|
||||
*/
|
||||
url?: string | URL | (string | URL)[];
|
||||
/**
|
||||
* File extensions to consider when resolving modules.
|
||||
*/
|
||||
extensions?: string[];
|
||||
/**
|
||||
* Conditions to consider when resolving package exports.
|
||||
*/
|
||||
conditions?: string[];
|
||||
}
|
||||
/**
|
||||
* Synchronously resolves a module path based on the options provided.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
||||
* @returns {string} The resolved URL as a string.
|
||||
*/
|
||||
declare function resolveSync(id: string, options?: ResolveOptions): string;
|
||||
/**
|
||||
* Asynchronously resolves a module path based on the given options.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
|
||||
* @returns {Promise<string>} A promise to resolve the URL as a string.
|
||||
*/
|
||||
declare function resolve(id: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Synchronously resolves a module path to a local file path based on the given options.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
||||
* @returns {string} The resolved file path.
|
||||
*/
|
||||
declare function resolvePathSync(id: string, options?: ResolveOptions): string;
|
||||
/**
|
||||
* Asynchronously resolves a module path to a local file path based on the options provided.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
|
||||
* @returns {Promise<string>} A promise to resolve to the file path.
|
||||
*/
|
||||
declare function resolvePath(id: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Creates a resolver function with default options that can be used to resolve module identifiers.
|
||||
*
|
||||
* @param {ResolveOptions} [defaults] - Default options to use for all resolutions. See {@link ResolveOptions}.
|
||||
* @returns {Function} A resolver function that takes an identifier and an optional URL, and resolves the identifier using the default options and the given URL.
|
||||
*/
|
||||
declare function createResolve(defaults?: ResolveOptions): (id: string, url?: ResolveOptions["url"]) => Promise<string>;
|
||||
/**
|
||||
* Parses a node module path to extract the directory, name, and subpath.
|
||||
*
|
||||
* @param {string} path - The path to parse.
|
||||
* @returns {Object} An object containing the directory, module name, and subpath of the node module.
|
||||
*/
|
||||
declare function parseNodeModulePath(path: string): {
|
||||
dir?: undefined;
|
||||
name?: undefined;
|
||||
subpath?: undefined;
|
||||
} | {
|
||||
dir: string;
|
||||
name: string;
|
||||
subpath: string | undefined;
|
||||
};
|
||||
/**
|
||||
* Attempts to reverse engineer a subpath export within a node module.
|
||||
*
|
||||
* @param {string} path - The path within the node module.
|
||||
* @returns {Promise<string | undefined>} A promise that resolves to the detected subpath or undefined if not found.
|
||||
*/
|
||||
declare function lookupNodeModuleSubpath(path: string): Promise<string | undefined>;
|
||||
|
||||
/**
|
||||
* Represents a general structure for ECMAScript module imports.
|
||||
*/
|
||||
interface ESMImport {
|
||||
/**
|
||||
* Specifies the type of import: "static" for static imports and "dynamic" for dynamic imports.
|
||||
*/
|
||||
type: "static" | "dynamic";
|
||||
/**
|
||||
* The full import declaration code snippet as a string.
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The starting position (index) of the import declaration in the source code.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The end position (index) of the import declaration in the source code.
|
||||
*/
|
||||
end: number;
|
||||
}
|
||||
/**
|
||||
* Represents a static import declaration in an ECMAScript module.
|
||||
* Extends {@link ESMImport}.
|
||||
*/
|
||||
interface StaticImport extends ESMImport {
|
||||
/**
|
||||
* Indicates the type of import, specifically a static import.
|
||||
*/
|
||||
type: "static";
|
||||
/**
|
||||
* Contains the entire import statement as a string, excluding the module specifier.
|
||||
*/
|
||||
imports: string;
|
||||
/**
|
||||
* The module specifier from which imports are being brought in.
|
||||
*/
|
||||
specifier: string;
|
||||
}
|
||||
/**
|
||||
* Represents a parsed static import declaration with detailed components of the import.
|
||||
* Extends {@link StaticImport}.
|
||||
*/
|
||||
interface ParsedStaticImport extends StaticImport {
|
||||
/**
|
||||
* The default import name, if any.
|
||||
* @optional
|
||||
*/
|
||||
defaultImport?: string;
|
||||
/**
|
||||
* The namespace import name, if any, using the `* as` syntax.
|
||||
* @optional
|
||||
*/
|
||||
namespacedImport?: string;
|
||||
/**
|
||||
* An object representing named imports, with their local aliases if specified.
|
||||
* Each property key is the original name and its value is the alias.
|
||||
* @optional
|
||||
*/
|
||||
namedImports?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents a dynamic import declaration that is loaded at runtime.
|
||||
* Extends {@link ESMImport}.
|
||||
*/
|
||||
interface DynamicImport extends ESMImport {
|
||||
/**
|
||||
* Indicates that this is a dynamic import.
|
||||
*/
|
||||
type: "dynamic";
|
||||
/**
|
||||
* The expression or path to be dynamically imported, typically a module path or URL.
|
||||
*/
|
||||
expression: string;
|
||||
}
|
||||
/**
|
||||
* Represents a type-specific import, primarily used for importing types in TypeScript.
|
||||
* Extends {@link ESMImport} but omits the 'type' to redefine it specifically for type imports.
|
||||
*/
|
||||
interface TypeImport extends Omit<ESMImport, "type"> {
|
||||
/**
|
||||
* Specifies that this is a type import.
|
||||
*/
|
||||
type: "type";
|
||||
/**
|
||||
* Contains the entire type import statement as a string, excluding the module specifier.
|
||||
*/
|
||||
imports: string;
|
||||
/**
|
||||
* The module specifier from which to import types.
|
||||
*/
|
||||
specifier: string;
|
||||
}
|
||||
/**
|
||||
* Represents a general structure for ECMAScript module exports.
|
||||
*/
|
||||
interface ESMExport {
|
||||
/**
|
||||
* Optional explicit type for complex scenarios, often used internally.
|
||||
* @optional
|
||||
*/
|
||||
_type?: "declaration" | "named" | "default" | "star";
|
||||
/**
|
||||
* The type of export (declaration, named, default or star).
|
||||
*/
|
||||
type: "declaration" | "named" | "default" | "star";
|
||||
/**
|
||||
* The specific type of declaration being exported, if applicable.
|
||||
* @optional
|
||||
*/
|
||||
declarationType?: "let" | "var" | "const" | "enum" | "const enum" | "class" | "function" | "async function";
|
||||
/**
|
||||
* The full code snippet of the export statement.
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The starting position (index) of the export declaration in the source code.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The end position (index) of the export declaration in the source code.
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* The name of the variable, function or class being exported, if given explicitly.
|
||||
* @optional
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The name used for default exports when a specific identifier isn't given.
|
||||
* @optional
|
||||
*/
|
||||
defaultName?: string;
|
||||
/**
|
||||
* An array of names to export, applicable to named and destructured exports.
|
||||
*/
|
||||
names: string[];
|
||||
/**
|
||||
* The module specifier, if any, from which exports are being re-exported.
|
||||
* @optional
|
||||
*/
|
||||
specifier?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a declaration export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface DeclarationExport extends ESMExport {
|
||||
/**
|
||||
* Indicates that this export is a declaration export.
|
||||
*/
|
||||
type: "declaration";
|
||||
/**
|
||||
* The declaration string, such as 'let', 'const', 'class', etc., describing what is being exported.
|
||||
*/
|
||||
declaration: string;
|
||||
/**
|
||||
* The name of the declaration to be exported.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
/**
|
||||
* Represents a named export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface NamedExport extends ESMExport {
|
||||
/**
|
||||
* Specifies that this export is a named export.
|
||||
*/
|
||||
type: "named";
|
||||
/**
|
||||
* The export string, containing all exported identifiers.
|
||||
*/
|
||||
exports: string;
|
||||
/**
|
||||
* An array of names to export.
|
||||
*/
|
||||
names: string[];
|
||||
/**
|
||||
* The module specifier, if any, from which exports are being re-exported.
|
||||
* @optional
|
||||
*/
|
||||
specifier?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a standard export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface DefaultExport extends ESMExport {
|
||||
/**
|
||||
* Specifies that this export is a standard export.
|
||||
*/
|
||||
type: "default";
|
||||
}
|
||||
/**
|
||||
* Regular expression to match static import statements in JavaScript/TypeScript code.
|
||||
* @example `import { foo, bar as baz } from 'module'`
|
||||
*/
|
||||
declare const ESM_STATIC_IMPORT_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match dynamic import statements in JavaScript/TypeScript code.
|
||||
* @example `import('module')`
|
||||
*/
|
||||
declare const DYNAMIC_IMPORT_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match various types of export declarations including variables, functions, and classes.
|
||||
* @example `export const num = 1, str = 'hello'; export class Example {}`
|
||||
*/
|
||||
declare const EXPORT_DECAL_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match export declarations specifically for types, interfaces, and type aliases in TypeScript.
|
||||
* @example `export type Result = { success: boolean; }; export interface User { name: string; age: number; };`
|
||||
*/
|
||||
declare const EXPORT_DECAL_TYPE_RE: RegExp;
|
||||
/**
|
||||
* Finds all static import statements within the given code string.
|
||||
* @param {string} code - The source code to search for static imports.
|
||||
* @returns {StaticImport[]} An array of {@link StaticImport} objects representing each static import found.
|
||||
*/
|
||||
declare function findStaticImports(code: string): StaticImport[];
|
||||
/**
|
||||
* Searches for dynamic import statements in the given source code.
|
||||
* @param {string} code - The source to search for dynamic imports in.
|
||||
* @returns {DynamicImport[]} An array of {@link DynamicImport} objects representing each dynamic import found.
|
||||
*/
|
||||
declare function findDynamicImports(code: string): DynamicImport[];
|
||||
/**
|
||||
* Identifies and returns all type import statements in the given source code.
|
||||
* This function is specifically targeted at type imports used in TypeScript.
|
||||
* @param {string} code - The source code to search for type imports.
|
||||
* @returns {TypeImport[]} An array of {@link TypeImport} objects representing each type import found.
|
||||
*/
|
||||
declare function findTypeImports(code: string): TypeImport[];
|
||||
/**
|
||||
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
|
||||
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
|
||||
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
|
||||
*/
|
||||
declare function parseStaticImport(matched: StaticImport | TypeImport): ParsedStaticImport;
|
||||
/**
|
||||
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
|
||||
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
|
||||
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
|
||||
*/
|
||||
declare function parseTypeImport(matched: TypeImport | StaticImport): ParsedStaticImport;
|
||||
/**
|
||||
* Identifies all export statements in the supplied source code and categorises them into different types such as declarations, named, default and star exports.
|
||||
* This function processes the code to capture different forms of export statements and normalise their representation for further processing.
|
||||
*
|
||||
* @param {string} code - The source code containing the export statements to be analysed.
|
||||
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each export found, properly categorised and structured.
|
||||
*/
|
||||
declare function findExports(code: string): ESMExport[];
|
||||
/**
|
||||
* Searches specifically for type-related exports in TypeScript code, such as exported interfaces, types, and declarations prefixed with 'declare'.
|
||||
* This function uses specialised regular expressions to identify type exports and normalises them for consistency.
|
||||
*
|
||||
* @param {string} code - The TypeScript source code to search for type exports.
|
||||
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each type export found.
|
||||
*/
|
||||
declare function findTypeExports(code: string): ESMExport[];
|
||||
/**
|
||||
* Extracts and returns a list of all export names from the given source.
|
||||
* This function uses {@link findExports} to retrieve all types of exports and consolidates their names into a single array.
|
||||
*
|
||||
* @param {string} code - The source code to search for export names.
|
||||
* @returns {string[]} An array containing the names of all exports found in the code.
|
||||
*/
|
||||
declare function findExportNames(code: string): string[];
|
||||
/**
|
||||
* Asynchronously resolves and returns all export names from a module specified by its module identifier.
|
||||
* This function recursively resolves all explicitly named and asterisked (* as) exports to fully enumerate the exported identifiers.
|
||||
*
|
||||
* @param {string} id - The module identifier to resolve.
|
||||
* @param {ResolveOptions} [options] - Optional settings for resolving the module path, such as the base URL.
|
||||
* @returns {Promise<string[]>} A promise that resolves to an array of export names from the module.
|
||||
*/
|
||||
declare function resolveModuleExportNames(id: string, options?: ResolveOptions): Promise<string[]>;
|
||||
|
||||
/**
|
||||
* Represents the context of a CommonJS environment, providing node-like module resolution capabilities within a module.
|
||||
*/
|
||||
interface CommonjsContext {
|
||||
/**
|
||||
* The absolute path to the current module file.
|
||||
*/
|
||||
__filename: string;
|
||||
/**
|
||||
* The directory name of the current module.
|
||||
*/
|
||||
__dirname: string;
|
||||
/**
|
||||
* A function to require modules as in CommonJS.
|
||||
*/
|
||||
require: NodeRequire;
|
||||
}
|
||||
/**
|
||||
* Creates a CommonJS context for a given module URL, enabling `require`, `__filename` and `__dirname` support similar to Node.js.
|
||||
* This function dynamically generates a `require` function that is context-aware and bound to the location of the given module URL.
|
||||
*
|
||||
* @param {string} url - The URL of the module file to create a context for.
|
||||
* @returns {CommonjsContext} A context object containing `__filename`, `__dirname` and a custom `require` function. See {@link CommonjsContext}.
|
||||
*/
|
||||
declare function createCommonJS(url: string): CommonjsContext;
|
||||
declare function interopDefault(sourceModule: any, opts?: {
|
||||
preferNamespace?: boolean;
|
||||
}): any;
|
||||
|
||||
/**
|
||||
* Options for evaluating or transforming modules, extending resolution options with optional URL specifications.
|
||||
*/
|
||||
interface EvaluateOptions extends ResolveOptions {
|
||||
/**
|
||||
* The URL of the module, which can be specified to override the URL resolved from the module identifier.
|
||||
* @optional
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
/**
|
||||
* Loads a module by resolving its identifier to a URL, fetching the module's code and evaluating it.
|
||||
*
|
||||
* @param {string} id - The identifier of the module to load.
|
||||
* @param {EvaluateOptions} options - Optional parameters to resolve and load the module. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<any>} A promise to resolve to the evaluated module.
|
||||
* });
|
||||
*/
|
||||
declare function loadModule(id: string, options?: EvaluateOptions): Promise<any>;
|
||||
/**
|
||||
* Evaluates JavaScript code as a module using a dynamic import from a data URL.
|
||||
*
|
||||
* @param {string} code - The code of the module to evaluate.
|
||||
* @param {EvaluateOptions} options - Includes the original URL of the module for better error mapping. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<any>} A promise that resolves to the evaluated module or throws an error if the evaluation fails.
|
||||
*/
|
||||
declare function evalModule(code: string, options?: EvaluateOptions): Promise<any>;
|
||||
/**
|
||||
* Transform module code to handle specific scenarios, such as converting JSON to a module or rewriting import.meta.url.
|
||||
*
|
||||
* @param {string} code - The code of the module to transform.
|
||||
* @param {EvaluateOptions} options - Options to control how the code is transformed. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<string>} A promise that resolves to the transformed code.
|
||||
*/
|
||||
declare function transformModule(code: string, options?: EvaluateOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves all import URLs found within the provided code to their absolute URLs, based on the given options.
|
||||
*
|
||||
* @param {string} code - The code containing the import directives to resolve.
|
||||
* @param {EvaluateOptions} [options] - Options to use for resolving imports. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<string>} A promise that resolves to the code, replacing import URLs with resolved URLs.
|
||||
*/
|
||||
declare function resolveImports(code: string, options?: EvaluateOptions): Promise<string>;
|
||||
|
||||
/**
|
||||
* Options for detecting syntax within a code string.
|
||||
*/
|
||||
type DetectSyntaxOptions = {
|
||||
/**
|
||||
* Indicates whether comments should be stripped from the code before syntax checking.
|
||||
* @default false
|
||||
*/
|
||||
stripComments?: boolean;
|
||||
};
|
||||
/**
|
||||
* Determines if a given code string contains ECMAScript module syntax.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
|
||||
*/
|
||||
declare function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
|
||||
/**
|
||||
* Determines if a given string of code contains CommonJS syntax.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
|
||||
*/
|
||||
declare function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
|
||||
/**
|
||||
* Analyses the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
|
||||
*/
|
||||
declare function detectSyntax(code: string, opts?: DetectSyntaxOptions): {
|
||||
hasESM: boolean;
|
||||
hasCJS: boolean;
|
||||
isMixed: boolean;
|
||||
};
|
||||
interface ValidNodeImportOptions extends ResolveOptions {
|
||||
/**
|
||||
* The contents of the import, which may be analyzed to see if it contains
|
||||
* CJS or ESM syntax as a last step in checking whether it is a valid import.
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* Protocols that are allowed as valid node imports.
|
||||
*
|
||||
* @default ['node', 'file', 'data']
|
||||
*
|
||||
*/
|
||||
allowedProtocols?: Array<string>;
|
||||
/**
|
||||
* Whether to strip comments from the code before checking for ESM syntax.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
stripComments?: boolean;
|
||||
}
|
||||
/**
|
||||
* Validates whether a given identifier represents a valid node import, based on its protocol, file extension, and optionally its contents.
|
||||
*
|
||||
* @param {string} id - The identifier or URL of the import to validate.
|
||||
* @param {ValidNodeImportOptions} _options - Options for resolving and validating the import. See {@link ValidNodeImportOptions}.
|
||||
* @returns {Promise<boolean>} A promise that resolves to `true` if the import is valid, otherwise `false`.
|
||||
*/
|
||||
declare function isValidNodeImport(id: string, _options?: ValidNodeImportOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Converts a file URL to a local file system path with normalized slashes.
|
||||
*
|
||||
* @param {string | URL} id - The file URL or local path to convert.
|
||||
* @returns {string} A normalized file system path.
|
||||
*/
|
||||
declare function fileURLToPath(id: string | URL): string;
|
||||
/**
|
||||
* Converts a local file system path to a file URL.
|
||||
*
|
||||
* @param {string | URL} id - The file system path to convert.
|
||||
* @returns {string} The resulting file URL as a string.
|
||||
*/
|
||||
declare function pathToFileURL(id: string | URL): string;
|
||||
/**
|
||||
* Sanitises a component of a URI by replacing invalid characters.
|
||||
*
|
||||
* @param {string} name - The URI component to sanitise.
|
||||
* @param {string} [replacement="_"] - The string to replace invalid characters with.
|
||||
* @returns {string} The sanitised URI component.
|
||||
*/
|
||||
declare function sanitizeURIComponent(name?: string, replacement?: string): string;
|
||||
/**
|
||||
* Cleans a file path string by sanitising each component of the path.
|
||||
*
|
||||
* @param {string} filePath - The file path to sanitise.
|
||||
* @returns {string} The sanitised file path.
|
||||
*/
|
||||
declare function sanitizeFilePath(filePath?: string): string;
|
||||
/**
|
||||
* Normalises a module identifier to ensure it has a protocol if missing, handling built-in modules and file paths.
|
||||
*
|
||||
* @param {string} id - The identifier to normalise.
|
||||
* @returns {string} The normalised identifier with the appropriate protocol.
|
||||
*/
|
||||
declare function normalizeid(id: string): string;
|
||||
/**
|
||||
* Loads the contents of a file from a URL into a string.
|
||||
*
|
||||
* @param {string} url - The URL of the file to load.
|
||||
* @returns {Promise<string>} A promise that resolves to the content of the file.
|
||||
*/
|
||||
declare function loadURL(url: string): Promise<string>;
|
||||
/**
|
||||
* Converts a string of code into a data URL that can be used for dynamic imports.
|
||||
*
|
||||
* @param {string} code - The string of code to convert.
|
||||
* @returns {string} The data URL containing the encoded code.
|
||||
*/
|
||||
declare function toDataURL(code: string): string;
|
||||
/**
|
||||
* Checks if a module identifier matches a Node.js built-in module.
|
||||
*
|
||||
* @param {string} id - The identifier to check.
|
||||
* @returns {boolean} `true` if the identifier is a built-in module, otherwise `false`.
|
||||
*/
|
||||
declare function isNodeBuiltin(id?: string): boolean;
|
||||
/**
|
||||
* Extracts the protocol portion of a given identifier string.
|
||||
*
|
||||
* @param {string} id - The identifier from which to extract the log.
|
||||
* @returns {string | undefined} The protocol part of the identifier, or undefined if no protocol is present.
|
||||
*/
|
||||
declare function getProtocol(id: string): string | undefined;
|
||||
|
||||
export { DYNAMIC_IMPORT_RE, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, pathToFileURL, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule };
|
||||
export type { CommonjsContext, DeclarationExport, DefaultExport, DetectSyntaxOptions, DynamicImport, ESMExport, ESMImport, EvaluateOptions, NamedExport, ParsedStaticImport, ResolveOptions, StaticImport, TypeImport, ValidNodeImportOptions };
|
||||
564
Frontend-Learner/node_modules/mlly/dist/index.d.ts
generated
vendored
Normal file
564
Frontend-Learner/node_modules/mlly/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,564 @@
|
|||
interface ResolveOptions {
|
||||
/**
|
||||
* A URL, path or array of URLs/paths to resolve against.
|
||||
*/
|
||||
url?: string | URL | (string | URL)[];
|
||||
/**
|
||||
* File extensions to consider when resolving modules.
|
||||
*/
|
||||
extensions?: string[];
|
||||
/**
|
||||
* Conditions to consider when resolving package exports.
|
||||
*/
|
||||
conditions?: string[];
|
||||
}
|
||||
/**
|
||||
* Synchronously resolves a module path based on the options provided.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
||||
* @returns {string} The resolved URL as a string.
|
||||
*/
|
||||
declare function resolveSync(id: string, options?: ResolveOptions): string;
|
||||
/**
|
||||
* Asynchronously resolves a module path based on the given options.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
|
||||
* @returns {Promise<string>} A promise to resolve the URL as a string.
|
||||
*/
|
||||
declare function resolve(id: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Synchronously resolves a module path to a local file path based on the given options.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
||||
* @returns {string} The resolved file path.
|
||||
*/
|
||||
declare function resolvePathSync(id: string, options?: ResolveOptions): string;
|
||||
/**
|
||||
* Asynchronously resolves a module path to a local file path based on the options provided.
|
||||
*
|
||||
* @param {string} id - The identifier or path of the module to resolve.
|
||||
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
|
||||
* @returns {Promise<string>} A promise to resolve to the file path.
|
||||
*/
|
||||
declare function resolvePath(id: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Creates a resolver function with default options that can be used to resolve module identifiers.
|
||||
*
|
||||
* @param {ResolveOptions} [defaults] - Default options to use for all resolutions. See {@link ResolveOptions}.
|
||||
* @returns {Function} A resolver function that takes an identifier and an optional URL, and resolves the identifier using the default options and the given URL.
|
||||
*/
|
||||
declare function createResolve(defaults?: ResolveOptions): (id: string, url?: ResolveOptions["url"]) => Promise<string>;
|
||||
/**
|
||||
* Parses a node module path to extract the directory, name, and subpath.
|
||||
*
|
||||
* @param {string} path - The path to parse.
|
||||
* @returns {Object} An object containing the directory, module name, and subpath of the node module.
|
||||
*/
|
||||
declare function parseNodeModulePath(path: string): {
|
||||
dir?: undefined;
|
||||
name?: undefined;
|
||||
subpath?: undefined;
|
||||
} | {
|
||||
dir: string;
|
||||
name: string;
|
||||
subpath: string | undefined;
|
||||
};
|
||||
/**
|
||||
* Attempts to reverse engineer a subpath export within a node module.
|
||||
*
|
||||
* @param {string} path - The path within the node module.
|
||||
* @returns {Promise<string | undefined>} A promise that resolves to the detected subpath or undefined if not found.
|
||||
*/
|
||||
declare function lookupNodeModuleSubpath(path: string): Promise<string | undefined>;
|
||||
|
||||
/**
|
||||
* Represents a general structure for ECMAScript module imports.
|
||||
*/
|
||||
interface ESMImport {
|
||||
/**
|
||||
* Specifies the type of import: "static" for static imports and "dynamic" for dynamic imports.
|
||||
*/
|
||||
type: "static" | "dynamic";
|
||||
/**
|
||||
* The full import declaration code snippet as a string.
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The starting position (index) of the import declaration in the source code.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The end position (index) of the import declaration in the source code.
|
||||
*/
|
||||
end: number;
|
||||
}
|
||||
/**
|
||||
* Represents a static import declaration in an ECMAScript module.
|
||||
* Extends {@link ESMImport}.
|
||||
*/
|
||||
interface StaticImport extends ESMImport {
|
||||
/**
|
||||
* Indicates the type of import, specifically a static import.
|
||||
*/
|
||||
type: "static";
|
||||
/**
|
||||
* Contains the entire import statement as a string, excluding the module specifier.
|
||||
*/
|
||||
imports: string;
|
||||
/**
|
||||
* The module specifier from which imports are being brought in.
|
||||
*/
|
||||
specifier: string;
|
||||
}
|
||||
/**
|
||||
* Represents a parsed static import declaration with detailed components of the import.
|
||||
* Extends {@link StaticImport}.
|
||||
*/
|
||||
interface ParsedStaticImport extends StaticImport {
|
||||
/**
|
||||
* The default import name, if any.
|
||||
* @optional
|
||||
*/
|
||||
defaultImport?: string;
|
||||
/**
|
||||
* The namespace import name, if any, using the `* as` syntax.
|
||||
* @optional
|
||||
*/
|
||||
namespacedImport?: string;
|
||||
/**
|
||||
* An object representing named imports, with their local aliases if specified.
|
||||
* Each property key is the original name and its value is the alias.
|
||||
* @optional
|
||||
*/
|
||||
namedImports?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents a dynamic import declaration that is loaded at runtime.
|
||||
* Extends {@link ESMImport}.
|
||||
*/
|
||||
interface DynamicImport extends ESMImport {
|
||||
/**
|
||||
* Indicates that this is a dynamic import.
|
||||
*/
|
||||
type: "dynamic";
|
||||
/**
|
||||
* The expression or path to be dynamically imported, typically a module path or URL.
|
||||
*/
|
||||
expression: string;
|
||||
}
|
||||
/**
|
||||
* Represents a type-specific import, primarily used for importing types in TypeScript.
|
||||
* Extends {@link ESMImport} but omits the 'type' to redefine it specifically for type imports.
|
||||
*/
|
||||
interface TypeImport extends Omit<ESMImport, "type"> {
|
||||
/**
|
||||
* Specifies that this is a type import.
|
||||
*/
|
||||
type: "type";
|
||||
/**
|
||||
* Contains the entire type import statement as a string, excluding the module specifier.
|
||||
*/
|
||||
imports: string;
|
||||
/**
|
||||
* The module specifier from which to import types.
|
||||
*/
|
||||
specifier: string;
|
||||
}
|
||||
/**
|
||||
* Represents a general structure for ECMAScript module exports.
|
||||
*/
|
||||
interface ESMExport {
|
||||
/**
|
||||
* Optional explicit type for complex scenarios, often used internally.
|
||||
* @optional
|
||||
*/
|
||||
_type?: "declaration" | "named" | "default" | "star";
|
||||
/**
|
||||
* The type of export (declaration, named, default or star).
|
||||
*/
|
||||
type: "declaration" | "named" | "default" | "star";
|
||||
/**
|
||||
* The specific type of declaration being exported, if applicable.
|
||||
* @optional
|
||||
*/
|
||||
declarationType?: "let" | "var" | "const" | "enum" | "const enum" | "class" | "function" | "async function";
|
||||
/**
|
||||
* The full code snippet of the export statement.
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The starting position (index) of the export declaration in the source code.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The end position (index) of the export declaration in the source code.
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* The name of the variable, function or class being exported, if given explicitly.
|
||||
* @optional
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The name used for default exports when a specific identifier isn't given.
|
||||
* @optional
|
||||
*/
|
||||
defaultName?: string;
|
||||
/**
|
||||
* An array of names to export, applicable to named and destructured exports.
|
||||
*/
|
||||
names: string[];
|
||||
/**
|
||||
* The module specifier, if any, from which exports are being re-exported.
|
||||
* @optional
|
||||
*/
|
||||
specifier?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a declaration export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface DeclarationExport extends ESMExport {
|
||||
/**
|
||||
* Indicates that this export is a declaration export.
|
||||
*/
|
||||
type: "declaration";
|
||||
/**
|
||||
* The declaration string, such as 'let', 'const', 'class', etc., describing what is being exported.
|
||||
*/
|
||||
declaration: string;
|
||||
/**
|
||||
* The name of the declaration to be exported.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
/**
|
||||
* Represents a named export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface NamedExport extends ESMExport {
|
||||
/**
|
||||
* Specifies that this export is a named export.
|
||||
*/
|
||||
type: "named";
|
||||
/**
|
||||
* The export string, containing all exported identifiers.
|
||||
*/
|
||||
exports: string;
|
||||
/**
|
||||
* An array of names to export.
|
||||
*/
|
||||
names: string[];
|
||||
/**
|
||||
* The module specifier, if any, from which exports are being re-exported.
|
||||
* @optional
|
||||
*/
|
||||
specifier?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a standard export within an ECMAScript module.
|
||||
* Extends {@link ESMExport}.
|
||||
*/
|
||||
interface DefaultExport extends ESMExport {
|
||||
/**
|
||||
* Specifies that this export is a standard export.
|
||||
*/
|
||||
type: "default";
|
||||
}
|
||||
/**
|
||||
* Regular expression to match static import statements in JavaScript/TypeScript code.
|
||||
* @example `import { foo, bar as baz } from 'module'`
|
||||
*/
|
||||
declare const ESM_STATIC_IMPORT_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match dynamic import statements in JavaScript/TypeScript code.
|
||||
* @example `import('module')`
|
||||
*/
|
||||
declare const DYNAMIC_IMPORT_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match various types of export declarations including variables, functions, and classes.
|
||||
* @example `export const num = 1, str = 'hello'; export class Example {}`
|
||||
*/
|
||||
declare const EXPORT_DECAL_RE: RegExp;
|
||||
/**
|
||||
* Regular expression to match export declarations specifically for types, interfaces, and type aliases in TypeScript.
|
||||
* @example `export type Result = { success: boolean; }; export interface User { name: string; age: number; };`
|
||||
*/
|
||||
declare const EXPORT_DECAL_TYPE_RE: RegExp;
|
||||
/**
|
||||
* Finds all static import statements within the given code string.
|
||||
* @param {string} code - The source code to search for static imports.
|
||||
* @returns {StaticImport[]} An array of {@link StaticImport} objects representing each static import found.
|
||||
*/
|
||||
declare function findStaticImports(code: string): StaticImport[];
|
||||
/**
|
||||
* Searches for dynamic import statements in the given source code.
|
||||
* @param {string} code - The source to search for dynamic imports in.
|
||||
* @returns {DynamicImport[]} An array of {@link DynamicImport} objects representing each dynamic import found.
|
||||
*/
|
||||
declare function findDynamicImports(code: string): DynamicImport[];
|
||||
/**
|
||||
* Identifies and returns all type import statements in the given source code.
|
||||
* This function is specifically targeted at type imports used in TypeScript.
|
||||
* @param {string} code - The source code to search for type imports.
|
||||
* @returns {TypeImport[]} An array of {@link TypeImport} objects representing each type import found.
|
||||
*/
|
||||
declare function findTypeImports(code: string): TypeImport[];
|
||||
/**
|
||||
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
|
||||
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
|
||||
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
|
||||
*/
|
||||
declare function parseStaticImport(matched: StaticImport | TypeImport): ParsedStaticImport;
|
||||
/**
|
||||
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
|
||||
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
|
||||
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
|
||||
*/
|
||||
declare function parseTypeImport(matched: TypeImport | StaticImport): ParsedStaticImport;
|
||||
/**
|
||||
* Identifies all export statements in the supplied source code and categorises them into different types such as declarations, named, default and star exports.
|
||||
* This function processes the code to capture different forms of export statements and normalise their representation for further processing.
|
||||
*
|
||||
* @param {string} code - The source code containing the export statements to be analysed.
|
||||
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each export found, properly categorised and structured.
|
||||
*/
|
||||
declare function findExports(code: string): ESMExport[];
|
||||
/**
|
||||
* Searches specifically for type-related exports in TypeScript code, such as exported interfaces, types, and declarations prefixed with 'declare'.
|
||||
* This function uses specialised regular expressions to identify type exports and normalises them for consistency.
|
||||
*
|
||||
* @param {string} code - The TypeScript source code to search for type exports.
|
||||
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each type export found.
|
||||
*/
|
||||
declare function findTypeExports(code: string): ESMExport[];
|
||||
/**
|
||||
* Extracts and returns a list of all export names from the given source.
|
||||
* This function uses {@link findExports} to retrieve all types of exports and consolidates their names into a single array.
|
||||
*
|
||||
* @param {string} code - The source code to search for export names.
|
||||
* @returns {string[]} An array containing the names of all exports found in the code.
|
||||
*/
|
||||
declare function findExportNames(code: string): string[];
|
||||
/**
|
||||
* Asynchronously resolves and returns all export names from a module specified by its module identifier.
|
||||
* This function recursively resolves all explicitly named and asterisked (* as) exports to fully enumerate the exported identifiers.
|
||||
*
|
||||
* @param {string} id - The module identifier to resolve.
|
||||
* @param {ResolveOptions} [options] - Optional settings for resolving the module path, such as the base URL.
|
||||
* @returns {Promise<string[]>} A promise that resolves to an array of export names from the module.
|
||||
*/
|
||||
declare function resolveModuleExportNames(id: string, options?: ResolveOptions): Promise<string[]>;
|
||||
|
||||
/**
|
||||
* Represents the context of a CommonJS environment, providing node-like module resolution capabilities within a module.
|
||||
*/
|
||||
interface CommonjsContext {
|
||||
/**
|
||||
* The absolute path to the current module file.
|
||||
*/
|
||||
__filename: string;
|
||||
/**
|
||||
* The directory name of the current module.
|
||||
*/
|
||||
__dirname: string;
|
||||
/**
|
||||
* A function to require modules as in CommonJS.
|
||||
*/
|
||||
require: NodeRequire;
|
||||
}
|
||||
/**
|
||||
* Creates a CommonJS context for a given module URL, enabling `require`, `__filename` and `__dirname` support similar to Node.js.
|
||||
* This function dynamically generates a `require` function that is context-aware and bound to the location of the given module URL.
|
||||
*
|
||||
* @param {string} url - The URL of the module file to create a context for.
|
||||
* @returns {CommonjsContext} A context object containing `__filename`, `__dirname` and a custom `require` function. See {@link CommonjsContext}.
|
||||
*/
|
||||
declare function createCommonJS(url: string): CommonjsContext;
|
||||
declare function interopDefault(sourceModule: any, opts?: {
|
||||
preferNamespace?: boolean;
|
||||
}): any;
|
||||
|
||||
/**
|
||||
* Options for evaluating or transforming modules, extending resolution options with optional URL specifications.
|
||||
*/
|
||||
interface EvaluateOptions extends ResolveOptions {
|
||||
/**
|
||||
* The URL of the module, which can be specified to override the URL resolved from the module identifier.
|
||||
* @optional
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
/**
|
||||
* Loads a module by resolving its identifier to a URL, fetching the module's code and evaluating it.
|
||||
*
|
||||
* @param {string} id - The identifier of the module to load.
|
||||
* @param {EvaluateOptions} options - Optional parameters to resolve and load the module. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<any>} A promise to resolve to the evaluated module.
|
||||
* });
|
||||
*/
|
||||
declare function loadModule(id: string, options?: EvaluateOptions): Promise<any>;
|
||||
/**
|
||||
* Evaluates JavaScript code as a module using a dynamic import from a data URL.
|
||||
*
|
||||
* @param {string} code - The code of the module to evaluate.
|
||||
* @param {EvaluateOptions} options - Includes the original URL of the module for better error mapping. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<any>} A promise that resolves to the evaluated module or throws an error if the evaluation fails.
|
||||
*/
|
||||
declare function evalModule(code: string, options?: EvaluateOptions): Promise<any>;
|
||||
/**
|
||||
* Transform module code to handle specific scenarios, such as converting JSON to a module or rewriting import.meta.url.
|
||||
*
|
||||
* @param {string} code - The code of the module to transform.
|
||||
* @param {EvaluateOptions} options - Options to control how the code is transformed. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<string>} A promise that resolves to the transformed code.
|
||||
*/
|
||||
declare function transformModule(code: string, options?: EvaluateOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves all import URLs found within the provided code to their absolute URLs, based on the given options.
|
||||
*
|
||||
* @param {string} code - The code containing the import directives to resolve.
|
||||
* @param {EvaluateOptions} [options] - Options to use for resolving imports. See {@link EvaluateOptions}.
|
||||
* @returns {Promise<string>} A promise that resolves to the code, replacing import URLs with resolved URLs.
|
||||
*/
|
||||
declare function resolveImports(code: string, options?: EvaluateOptions): Promise<string>;
|
||||
|
||||
/**
|
||||
* Options for detecting syntax within a code string.
|
||||
*/
|
||||
type DetectSyntaxOptions = {
|
||||
/**
|
||||
* Indicates whether comments should be stripped from the code before syntax checking.
|
||||
* @default false
|
||||
*/
|
||||
stripComments?: boolean;
|
||||
};
|
||||
/**
|
||||
* Determines if a given code string contains ECMAScript module syntax.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
|
||||
*/
|
||||
declare function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
|
||||
/**
|
||||
* Determines if a given string of code contains CommonJS syntax.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
|
||||
*/
|
||||
declare function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
|
||||
/**
|
||||
* Analyses the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
|
||||
*
|
||||
* @param {string} code - The source code to analyse.
|
||||
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
|
||||
* @returns {object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
|
||||
*/
|
||||
declare function detectSyntax(code: string, opts?: DetectSyntaxOptions): {
|
||||
hasESM: boolean;
|
||||
hasCJS: boolean;
|
||||
isMixed: boolean;
|
||||
};
|
||||
interface ValidNodeImportOptions extends ResolveOptions {
|
||||
/**
|
||||
* The contents of the import, which may be analyzed to see if it contains
|
||||
* CJS or ESM syntax as a last step in checking whether it is a valid import.
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* Protocols that are allowed as valid node imports.
|
||||
*
|
||||
* @default ['node', 'file', 'data']
|
||||
*
|
||||
*/
|
||||
allowedProtocols?: Array<string>;
|
||||
/**
|
||||
* Whether to strip comments from the code before checking for ESM syntax.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
stripComments?: boolean;
|
||||
}
|
||||
/**
|
||||
* Validates whether a given identifier represents a valid node import, based on its protocol, file extension, and optionally its contents.
|
||||
*
|
||||
* @param {string} id - The identifier or URL of the import to validate.
|
||||
* @param {ValidNodeImportOptions} _options - Options for resolving and validating the import. See {@link ValidNodeImportOptions}.
|
||||
* @returns {Promise<boolean>} A promise that resolves to `true` if the import is valid, otherwise `false`.
|
||||
*/
|
||||
declare function isValidNodeImport(id: string, _options?: ValidNodeImportOptions): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Converts a file URL to a local file system path with normalized slashes.
|
||||
*
|
||||
* @param {string | URL} id - The file URL or local path to convert.
|
||||
* @returns {string} A normalized file system path.
|
||||
*/
|
||||
declare function fileURLToPath(id: string | URL): string;
|
||||
/**
|
||||
* Converts a local file system path to a file URL.
|
||||
*
|
||||
* @param {string | URL} id - The file system path to convert.
|
||||
* @returns {string} The resulting file URL as a string.
|
||||
*/
|
||||
declare function pathToFileURL(id: string | URL): string;
|
||||
/**
|
||||
* Sanitises a component of a URI by replacing invalid characters.
|
||||
*
|
||||
* @param {string} name - The URI component to sanitise.
|
||||
* @param {string} [replacement="_"] - The string to replace invalid characters with.
|
||||
* @returns {string} The sanitised URI component.
|
||||
*/
|
||||
declare function sanitizeURIComponent(name?: string, replacement?: string): string;
|
||||
/**
|
||||
* Cleans a file path string by sanitising each component of the path.
|
||||
*
|
||||
* @param {string} filePath - The file path to sanitise.
|
||||
* @returns {string} The sanitised file path.
|
||||
*/
|
||||
declare function sanitizeFilePath(filePath?: string): string;
|
||||
/**
|
||||
* Normalises a module identifier to ensure it has a protocol if missing, handling built-in modules and file paths.
|
||||
*
|
||||
* @param {string} id - The identifier to normalise.
|
||||
* @returns {string} The normalised identifier with the appropriate protocol.
|
||||
*/
|
||||
declare function normalizeid(id: string): string;
|
||||
/**
|
||||
* Loads the contents of a file from a URL into a string.
|
||||
*
|
||||
* @param {string} url - The URL of the file to load.
|
||||
* @returns {Promise<string>} A promise that resolves to the content of the file.
|
||||
*/
|
||||
declare function loadURL(url: string): Promise<string>;
|
||||
/**
|
||||
* Converts a string of code into a data URL that can be used for dynamic imports.
|
||||
*
|
||||
* @param {string} code - The string of code to convert.
|
||||
* @returns {string} The data URL containing the encoded code.
|
||||
*/
|
||||
declare function toDataURL(code: string): string;
|
||||
/**
|
||||
* Checks if a module identifier matches a Node.js built-in module.
|
||||
*
|
||||
* @param {string} id - The identifier to check.
|
||||
* @returns {boolean} `true` if the identifier is a built-in module, otherwise `false`.
|
||||
*/
|
||||
declare function isNodeBuiltin(id?: string): boolean;
|
||||
/**
|
||||
* Extracts the protocol portion of a given identifier string.
|
||||
*
|
||||
* @param {string} id - The identifier from which to extract the log.
|
||||
* @returns {string | undefined} The protocol part of the identifier, or undefined if no protocol is present.
|
||||
*/
|
||||
declare function getProtocol(id: string): string | undefined;
|
||||
|
||||
export { DYNAMIC_IMPORT_RE, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, pathToFileURL, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule };
|
||||
export type { CommonjsContext, DeclarationExport, DefaultExport, DetectSyntaxOptions, DynamicImport, ESMExport, ESMImport, EvaluateOptions, NamedExport, ParsedStaticImport, ResolveOptions, StaticImport, TypeImport, ValidNodeImportOptions };
|
||||
2613
Frontend-Learner/node_modules/mlly/dist/index.mjs
generated
vendored
Normal file
2613
Frontend-Learner/node_modules/mlly/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
118
Frontend-Learner/node_modules/mlly/node_modules/confbox/LICENSE
generated
vendored
Normal file
118
Frontend-Learner/node_modules/mlly/node_modules/confbox/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Pooya Parsa <pooya@pi0.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
js-yaml: https://github.com/nodeca/js-yaml/tree/master
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2011-2015 by Vitaly Puzrin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
smol-toml: https://github.com/squirrelchat/smol-toml/blob/mistress/LICENSE
|
||||
|
||||
Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---
|
||||
|
||||
jsonc-parser: https://github.com/microsoft/node-jsonc-parser/blob/main/LICENSE.md
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Microsoft
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
json5: https://github.com/json5/json5/blob/main/LICENSE.md
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012-2018 Aseem Kishore, and others (https://github.com/json5/json5/graphs/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
detect-indent: https://github.com/sindresorhus/detect-indent/blob/main/license
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
191
Frontend-Learner/node_modules/mlly/node_modules/confbox/README.md
generated
vendored
Normal file
191
Frontend-Learner/node_modules/mlly/node_modules/confbox/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
# confbox
|
||||
|
||||
<!-- automd:badges color=yellow bundlephobia packagephobia -->
|
||||
|
||||
[](https://npmjs.com/package/confbox)
|
||||
[](https://npm.chart.dev/confbox)
|
||||
[](https://bundlephobia.com/package/confbox)
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
Parsing and serialization utils for [YAML](https://yaml.org/) ([js-yaml](https://github.com/nodeca/js-yaml)), [TOML](https://toml.io/) ([smol-toml](https://github.com/squirrelchat/smol-toml)), [JSONC](https://github.com/microsoft/node-jsonc-parser) ([jsonc-parser](https://github.com/microsoft/node-jsonc-parser)), [JSON5](https://json5.org/) ([json5](https://github.com/json5/json5)), and [JSON](https://www.json.org/json-en.html).
|
||||
|
||||
✨ Zero dependency and tree-shakable
|
||||
|
||||
✨ Types exported out of the box
|
||||
|
||||
✨ Presrves code style (indentation and whitespace)
|
||||
|
||||
> [!TIP]
|
||||
> Use [unjs/c12](https://github.com/unjs/c12) for a full featured configuration loader!
|
||||
|
||||
## Usage
|
||||
|
||||
Install package:
|
||||
|
||||
<!-- automd:pm-i no-version -->
|
||||
|
||||
```sh
|
||||
# ✨ Auto-detect
|
||||
npx nypm install confbox
|
||||
|
||||
# npm
|
||||
npm install confbox
|
||||
|
||||
# yarn
|
||||
yarn add confbox
|
||||
|
||||
# pnpm
|
||||
pnpm install confbox
|
||||
|
||||
# bun
|
||||
bun install confbox
|
||||
|
||||
# deno
|
||||
deno install confbox
|
||||
```
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
Import:
|
||||
|
||||
<!-- automd:jsimport cjs cdn src="./src/index.ts" -->
|
||||
|
||||
**ESM** (Node.js, Bun, Deno)
|
||||
|
||||
```js
|
||||
import {
|
||||
parseJSON5,
|
||||
stringifyJSON5,
|
||||
parseJSONC,
|
||||
stringifyJSONC,
|
||||
parseYAML,
|
||||
stringifyYAML,
|
||||
parseJSON,
|
||||
stringifyJSON,
|
||||
parseTOML,
|
||||
stringifyTOML,
|
||||
} from "confbox";
|
||||
```
|
||||
|
||||
**CommonJS** (Legacy Node.js)
|
||||
|
||||
```js
|
||||
const {
|
||||
parseJSON5,
|
||||
stringifyJSON5,
|
||||
parseJSONC,
|
||||
stringifyJSONC,
|
||||
parseYAML,
|
||||
stringifyYAML,
|
||||
parseJSON,
|
||||
stringifyJSON,
|
||||
parseTOML,
|
||||
stringifyTOML,
|
||||
} = require("confbox");
|
||||
```
|
||||
|
||||
**CDN** (Deno, Bun and Browsers)
|
||||
|
||||
```js
|
||||
import {
|
||||
parseJSON5,
|
||||
stringifyJSON5,
|
||||
parseJSONC,
|
||||
stringifyJSONC,
|
||||
parseYAML,
|
||||
stringifyYAML,
|
||||
parseJSON,
|
||||
stringifyJSON,
|
||||
parseTOML,
|
||||
stringifyTOML,
|
||||
} from "https://esm.sh/confbox";
|
||||
```
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
<!-- automd:jsdocs src="./src/index" -->
|
||||
|
||||
### `parseJSON(text, options?)`
|
||||
|
||||
Converts a [JSON](https://www.json.org/json-en.html) string into an object.
|
||||
|
||||
Indentation status is auto-detected and preserved when stringifying back using `stringifyJSON`
|
||||
|
||||
### `parseJSON5(text, options?)`
|
||||
|
||||
Converts a [JSON5](https://json5.org/) string into an object.
|
||||
|
||||
### `parseJSONC(text, options?)`
|
||||
|
||||
Converts a [JSONC](https://github.com/microsoft/node-jsonc-parser) string into an object.
|
||||
|
||||
### `parseTOML(text)`
|
||||
|
||||
Converts a [TOML](https://toml.io/) string into an object.
|
||||
|
||||
### `parseYAML(text, options?)`
|
||||
|
||||
Converts a [YAML](https://yaml.org/) string into an object.
|
||||
|
||||
### `stringifyJSON(value, options?)`
|
||||
|
||||
Converts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.
|
||||
|
||||
Indentation status is auto detected and preserved when using value from parseJSON.
|
||||
|
||||
### `stringifyJSON5(value, options?)`
|
||||
|
||||
Converts a JavaScript value to a [JSON5](https://json5.org/) string.
|
||||
|
||||
### `stringifyJSONC(value, options?)`
|
||||
|
||||
Converts a JavaScript value to a [JSONC](https://github.com/microsoft/node-jsonc-parser) string.
|
||||
|
||||
### `stringifyTOML(value)`
|
||||
|
||||
Converts a JavaScript value to a [TOML](https://toml.io/) string.
|
||||
|
||||
### `stringifyYAML(value, options?)`
|
||||
|
||||
Converts a JavaScript value to a [YAML](https://yaml.org/) string.
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
<!-- automd:fetch url="gh:unjs/.github/main/snippets/readme-contrib-node-pnpm.md" -->
|
||||
|
||||
## Contribution
|
||||
|
||||
<details>
|
||||
<summary>Local development</summary>
|
||||
|
||||
- Clone this repository
|
||||
- Install the latest LTS version of [Node.js](https://nodejs.org/en/)
|
||||
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
|
||||
- Install dependencies using `pnpm install`
|
||||
- Run tests using `pnpm dev` or `pnpm test`
|
||||
|
||||
</details>
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
## License
|
||||
|
||||
<!-- automd:contributors license=MIT author=pi0 -->
|
||||
|
||||
Published under the [MIT](https://github.com/unjs/confbox/blob/main/LICENSE) license.
|
||||
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/confbox/graphs/contributors) 💛
|
||||
<br><br>
|
||||
<a href="https://github.com/unjs/confbox/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=unjs/confbox" />
|
||||
</a>
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
<!-- automd:with-automd -->
|
||||
|
||||
---
|
||||
|
||||
_🤖 auto updated with [automd](https://automd.unjs.io)_
|
||||
|
||||
<!-- /automd -->
|
||||
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.cjs
generated
vendored
Normal file
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
"use strict";const json5=require("./json5.cjs"),jsonc=require("./shared/confbox.6b479c78.cjs"),yaml=require("./yaml.cjs"),toml=require("./toml.cjs");require("./shared/confbox.3768c7e9.cjs"),exports.parseJSON5=json5.parseJSON5,exports.stringifyJSON5=json5.stringifyJSON5,exports.parseJSON=jsonc.parseJSON,exports.parseJSONC=jsonc.parseJSONC,exports.stringifyJSON=jsonc.stringifyJSON,exports.stringifyJSONC=jsonc.stringifyJSONC,exports.parseYAML=yaml.parseYAML,exports.stringifyYAML=yaml.stringifyYAML,exports.parseTOML=toml.parseTOML,exports.stringifyTOML=toml.stringifyTOML;
|
||||
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.d.cts
generated
vendored
Normal file
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
export { JSON5ParseOptions, JSON5StringifyOptions, parseJSON5, stringifyJSON5 } from './json5.cjs';
|
||||
export { JSONCParseError, JSONCParseOptions, parseJSONC, stringifyJSONC } from './jsonc.cjs';
|
||||
export { YAMLParseOptions, YAMLStringifyOptions, parseYAML, stringifyYAML } from './yaml.cjs';
|
||||
import { F as FormatOptions } from './shared/confbox.9745c98f.cjs';
|
||||
export { parseTOML, stringifyTOML } from './toml.cjs';
|
||||
|
||||
/**
|
||||
* Converts a [JSON](https://www.json.org/json-en.html) string into an object.
|
||||
*
|
||||
* Indentation status is auto-detected and preserved when stringifying back using `stringifyJSON`
|
||||
*/
|
||||
declare function parseJSON<T = unknown>(text: string, options?: JSONParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.
|
||||
*
|
||||
* Indentation status is auto detected and preserved when using value from parseJSON.
|
||||
*/
|
||||
declare function stringifyJSON(value: any, options?: JSONStringifyOptions): string;
|
||||
interface JSONParseOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that transforms the results. This function is called for each member of the object.
|
||||
*/
|
||||
reviver?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
interface JSONStringifyOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that transforms the results. This function is called for each member of the object.
|
||||
*/
|
||||
replacer?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
|
||||
export { type JSONParseOptions, type JSONStringifyOptions, parseJSON, stringifyJSON };
|
||||
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.d.mts
generated
vendored
Normal file
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
export { JSON5ParseOptions, JSON5StringifyOptions, parseJSON5, stringifyJSON5 } from './json5.mjs';
|
||||
export { JSONCParseError, JSONCParseOptions, parseJSONC, stringifyJSONC } from './jsonc.mjs';
|
||||
export { YAMLParseOptions, YAMLStringifyOptions, parseYAML, stringifyYAML } from './yaml.mjs';
|
||||
import { F as FormatOptions } from './shared/confbox.9745c98f.mjs';
|
||||
export { parseTOML, stringifyTOML } from './toml.mjs';
|
||||
|
||||
/**
|
||||
* Converts a [JSON](https://www.json.org/json-en.html) string into an object.
|
||||
*
|
||||
* Indentation status is auto-detected and preserved when stringifying back using `stringifyJSON`
|
||||
*/
|
||||
declare function parseJSON<T = unknown>(text: string, options?: JSONParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.
|
||||
*
|
||||
* Indentation status is auto detected and preserved when using value from parseJSON.
|
||||
*/
|
||||
declare function stringifyJSON(value: any, options?: JSONStringifyOptions): string;
|
||||
interface JSONParseOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that transforms the results. This function is called for each member of the object.
|
||||
*/
|
||||
reviver?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
interface JSONStringifyOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that transforms the results. This function is called for each member of the object.
|
||||
*/
|
||||
replacer?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
|
||||
export { type JSONParseOptions, type JSONStringifyOptions, parseJSON, stringifyJSON };
|
||||
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.d.ts
generated
vendored
Normal file
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
export { JSON5ParseOptions, JSON5StringifyOptions, parseJSON5, stringifyJSON5 } from './json5.js';
|
||||
export { JSONCParseError, JSONCParseOptions, parseJSONC, stringifyJSONC } from './jsonc.js';
|
||||
export { YAMLParseOptions, YAMLStringifyOptions, parseYAML, stringifyYAML } from './yaml.js';
|
||||
import { F as FormatOptions } from './shared/confbox.9745c98f.js';
|
||||
export { parseTOML, stringifyTOML } from './toml.js';
|
||||
|
||||
/**
|
||||
* Converts a [JSON](https://www.json.org/json-en.html) string into an object.
|
||||
*
|
||||
* Indentation status is auto-detected and preserved when stringifying back using `stringifyJSON`
|
||||
*/
|
||||
declare function parseJSON<T = unknown>(text: string, options?: JSONParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.
|
||||
*
|
||||
* Indentation status is auto detected and preserved when using value from parseJSON.
|
||||
*/
|
||||
declare function stringifyJSON(value: any, options?: JSONStringifyOptions): string;
|
||||
interface JSONParseOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that transforms the results. This function is called for each member of the object.
|
||||
*/
|
||||
reviver?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
interface JSONStringifyOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that transforms the results. This function is called for each member of the object.
|
||||
*/
|
||||
replacer?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
|
||||
export { type JSONParseOptions, type JSONStringifyOptions, parseJSON, stringifyJSON };
|
||||
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.mjs
generated
vendored
Normal file
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export{parseJSON5,stringifyJSON5}from"./json5.mjs";export{a as parseJSON,p as parseJSONC,b as stringifyJSON,s as stringifyJSONC}from"./shared/confbox.f9f03f05.mjs";export{parseYAML,stringifyYAML}from"./yaml.mjs";export{parseTOML,stringifyTOML}from"./toml.mjs";import"./shared/confbox.9388d834.mjs";
|
||||
14
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.cjs
generated
vendored
Normal file
14
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.cjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
58
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.d.cts
generated
vendored
Normal file
58
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.cjs';
|
||||
|
||||
/**
|
||||
* Converts a [JSON5](https://json5.org/) string into an object.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The string to parse as JSON5.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the JSON5 string.
|
||||
*/
|
||||
declare function parseJSON5<T = unknown>(text: string, options?: JSON5ParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSON5](https://json5.org/) string.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The JSON string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyJSON5(value: any, options?: JSON5StringifyOptions): string;
|
||||
interface JSON5ParseOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that alters the behavior of the parsing process, or an array of
|
||||
* String and Number objects that serve as a allowlist for selecting/filtering
|
||||
* the properties of the value object to be included in the resulting
|
||||
* JavaScript object. If this value is null or not provided, all properties of
|
||||
* the object are included in the resulting JavaScript object.
|
||||
*/
|
||||
reviver?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
interface JSON5StringifyOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that alters the behavior of the stringification process, or an
|
||||
* array of String and Number objects that serve as a allowlist for
|
||||
* selecting/filtering the properties of the value object to be included in
|
||||
* the JSON5 string. If this value is null or not provided, all properties
|
||||
* of the object are included in the resulting JSON5 string.
|
||||
*/
|
||||
replacer?: ((this: any, key: string, value: any) => any) | null;
|
||||
/**
|
||||
* A String or Number object that's used to insert white space into the
|
||||
* output JSON5 string for readability purposes. If this is a Number, it
|
||||
* indicates the number of space characters to use as white space; this
|
||||
* number is capped at 10 (if it is greater, the value is just 10). Values
|
||||
* less than 1 indicate that no space should be used. If this is a String,
|
||||
* the string (or the first 10 characters of the string, if it's longer than
|
||||
* that) is used as white space. If this parameter is not provided (or is
|
||||
* null), no white space is used. If white space is used, trailing commas
|
||||
* will be used in objects and arrays.
|
||||
*/
|
||||
space?: string | number | null;
|
||||
/**
|
||||
* A String representing the quote character to use when serializing
|
||||
* strings.
|
||||
*/
|
||||
quote?: string | null;
|
||||
}
|
||||
|
||||
export { type JSON5ParseOptions, type JSON5StringifyOptions, parseJSON5, stringifyJSON5 };
|
||||
58
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.d.mts
generated
vendored
Normal file
58
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.mjs';
|
||||
|
||||
/**
|
||||
* Converts a [JSON5](https://json5.org/) string into an object.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The string to parse as JSON5.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the JSON5 string.
|
||||
*/
|
||||
declare function parseJSON5<T = unknown>(text: string, options?: JSON5ParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSON5](https://json5.org/) string.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The JSON string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyJSON5(value: any, options?: JSON5StringifyOptions): string;
|
||||
interface JSON5ParseOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that alters the behavior of the parsing process, or an array of
|
||||
* String and Number objects that serve as a allowlist for selecting/filtering
|
||||
* the properties of the value object to be included in the resulting
|
||||
* JavaScript object. If this value is null or not provided, all properties of
|
||||
* the object are included in the resulting JavaScript object.
|
||||
*/
|
||||
reviver?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
interface JSON5StringifyOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that alters the behavior of the stringification process, or an
|
||||
* array of String and Number objects that serve as a allowlist for
|
||||
* selecting/filtering the properties of the value object to be included in
|
||||
* the JSON5 string. If this value is null or not provided, all properties
|
||||
* of the object are included in the resulting JSON5 string.
|
||||
*/
|
||||
replacer?: ((this: any, key: string, value: any) => any) | null;
|
||||
/**
|
||||
* A String or Number object that's used to insert white space into the
|
||||
* output JSON5 string for readability purposes. If this is a Number, it
|
||||
* indicates the number of space characters to use as white space; this
|
||||
* number is capped at 10 (if it is greater, the value is just 10). Values
|
||||
* less than 1 indicate that no space should be used. If this is a String,
|
||||
* the string (or the first 10 characters of the string, if it's longer than
|
||||
* that) is used as white space. If this parameter is not provided (or is
|
||||
* null), no white space is used. If white space is used, trailing commas
|
||||
* will be used in objects and arrays.
|
||||
*/
|
||||
space?: string | number | null;
|
||||
/**
|
||||
* A String representing the quote character to use when serializing
|
||||
* strings.
|
||||
*/
|
||||
quote?: string | null;
|
||||
}
|
||||
|
||||
export { type JSON5ParseOptions, type JSON5StringifyOptions, parseJSON5, stringifyJSON5 };
|
||||
58
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.d.ts
generated
vendored
Normal file
58
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.js';
|
||||
|
||||
/**
|
||||
* Converts a [JSON5](https://json5.org/) string into an object.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The string to parse as JSON5.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the JSON5 string.
|
||||
*/
|
||||
declare function parseJSON5<T = unknown>(text: string, options?: JSON5ParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSON5](https://json5.org/) string.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The JSON string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyJSON5(value: any, options?: JSON5StringifyOptions): string;
|
||||
interface JSON5ParseOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that alters the behavior of the parsing process, or an array of
|
||||
* String and Number objects that serve as a allowlist for selecting/filtering
|
||||
* the properties of the value object to be included in the resulting
|
||||
* JavaScript object. If this value is null or not provided, all properties of
|
||||
* the object are included in the resulting JavaScript object.
|
||||
*/
|
||||
reviver?: (this: any, key: string, value: any) => any;
|
||||
}
|
||||
interface JSON5StringifyOptions extends FormatOptions {
|
||||
/**
|
||||
* A function that alters the behavior of the stringification process, or an
|
||||
* array of String and Number objects that serve as a allowlist for
|
||||
* selecting/filtering the properties of the value object to be included in
|
||||
* the JSON5 string. If this value is null or not provided, all properties
|
||||
* of the object are included in the resulting JSON5 string.
|
||||
*/
|
||||
replacer?: ((this: any, key: string, value: any) => any) | null;
|
||||
/**
|
||||
* A String or Number object that's used to insert white space into the
|
||||
* output JSON5 string for readability purposes. If this is a Number, it
|
||||
* indicates the number of space characters to use as white space; this
|
||||
* number is capped at 10 (if it is greater, the value is just 10). Values
|
||||
* less than 1 indicate that no space should be used. If this is a String,
|
||||
* the string (or the first 10 characters of the string, if it's longer than
|
||||
* that) is used as white space. If this parameter is not provided (or is
|
||||
* null), no white space is used. If white space is used, trailing commas
|
||||
* will be used in objects and arrays.
|
||||
*/
|
||||
space?: string | number | null;
|
||||
/**
|
||||
* A String representing the quote character to use when serializing
|
||||
* strings.
|
||||
*/
|
||||
quote?: string | null;
|
||||
}
|
||||
|
||||
export { type JSON5ParseOptions, type JSON5StringifyOptions, parseJSON5, stringifyJSON5 };
|
||||
14
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.mjs
generated
vendored
Normal file
14
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/json5.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.cjs
generated
vendored
Normal file
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
"use strict";require("./shared/confbox.3768c7e9.cjs");const jsonc=require("./shared/confbox.6b479c78.cjs");exports.parseJSONC=jsonc.parseJSONC,exports.stringifyJSONC=jsonc.stringifyJSONC;
|
||||
41
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.d.cts
generated
vendored
Normal file
41
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.cjs';
|
||||
|
||||
/**
|
||||
*
|
||||
* Converts a [JSONC](https://github.com/microsoft/node-jsonc-parser) string into an object.
|
||||
*
|
||||
* @NOTE On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
*
|
||||
* @NOTE Comments and trailing commas are not preserved after parsing.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The string to parse as JSONC.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the JSONC string.
|
||||
*/
|
||||
declare function parseJSONC<T = unknown>(text: string, options?: JSONCParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSONC](https://github.com/microsoft/node-jsonc-parser) string.
|
||||
*
|
||||
* @NOTE Comments and trailing commas are not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The JSON string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyJSONC(value: any, options?: JSONCStringifyOptions): string;
|
||||
interface JSONCParseOptions extends FormatOptions {
|
||||
disallowComments?: boolean;
|
||||
allowTrailingComma?: boolean;
|
||||
allowEmptyContent?: boolean;
|
||||
errors?: JSONCParseError[];
|
||||
}
|
||||
interface JSONCStringifyOptions extends FormatOptions {
|
||||
}
|
||||
interface JSONCParseError {
|
||||
error: number;
|
||||
offset: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export { type JSONCParseError, type JSONCParseOptions, type JSONCStringifyOptions, parseJSONC, stringifyJSONC };
|
||||
41
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.d.mts
generated
vendored
Normal file
41
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.mjs';
|
||||
|
||||
/**
|
||||
*
|
||||
* Converts a [JSONC](https://github.com/microsoft/node-jsonc-parser) string into an object.
|
||||
*
|
||||
* @NOTE On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
*
|
||||
* @NOTE Comments and trailing commas are not preserved after parsing.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The string to parse as JSONC.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the JSONC string.
|
||||
*/
|
||||
declare function parseJSONC<T = unknown>(text: string, options?: JSONCParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSONC](https://github.com/microsoft/node-jsonc-parser) string.
|
||||
*
|
||||
* @NOTE Comments and trailing commas are not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The JSON string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyJSONC(value: any, options?: JSONCStringifyOptions): string;
|
||||
interface JSONCParseOptions extends FormatOptions {
|
||||
disallowComments?: boolean;
|
||||
allowTrailingComma?: boolean;
|
||||
allowEmptyContent?: boolean;
|
||||
errors?: JSONCParseError[];
|
||||
}
|
||||
interface JSONCStringifyOptions extends FormatOptions {
|
||||
}
|
||||
interface JSONCParseError {
|
||||
error: number;
|
||||
offset: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export { type JSONCParseError, type JSONCParseOptions, type JSONCStringifyOptions, parseJSONC, stringifyJSONC };
|
||||
41
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.d.ts
generated
vendored
Normal file
41
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.js';
|
||||
|
||||
/**
|
||||
*
|
||||
* Converts a [JSONC](https://github.com/microsoft/node-jsonc-parser) string into an object.
|
||||
*
|
||||
* @NOTE On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
*
|
||||
* @NOTE Comments and trailing commas are not preserved after parsing.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The string to parse as JSONC.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the JSONC string.
|
||||
*/
|
||||
declare function parseJSONC<T = unknown>(text: string, options?: JSONCParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [JSONC](https://github.com/microsoft/node-jsonc-parser) string.
|
||||
*
|
||||
* @NOTE Comments and trailing commas are not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The JSON string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyJSONC(value: any, options?: JSONCStringifyOptions): string;
|
||||
interface JSONCParseOptions extends FormatOptions {
|
||||
disallowComments?: boolean;
|
||||
allowTrailingComma?: boolean;
|
||||
allowEmptyContent?: boolean;
|
||||
errors?: JSONCParseError[];
|
||||
}
|
||||
interface JSONCStringifyOptions extends FormatOptions {
|
||||
}
|
||||
interface JSONCParseError {
|
||||
error: number;
|
||||
offset: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export { type JSONCParseError, type JSONCParseOptions, type JSONCStringifyOptions, parseJSONC, stringifyJSONC };
|
||||
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.mjs
generated
vendored
Normal file
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/jsonc.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
import"./shared/confbox.9388d834.mjs";export{p as parseJSONC,s as stringifyJSONC}from"./shared/confbox.f9f03f05.mjs";
|
||||
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.3768c7e9.cjs
generated
vendored
Normal file
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.3768c7e9.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
"use strict";const INDENT_REGEX=/^(?:( )+|\t+)/,INDENT_TYPE_SPACE="space",INDENT_TYPE_TAB="tab";function makeIndentsMap(e,t){const n=new Map;let i=0,a,c;for(const f of e.split(/\n/g)){if(!f)continue;let l,u,y,m,d;const h=f.match(INDENT_REGEX);if(h===null)i=0,a="";else{if(l=h[0].length,u=h[1]?INDENT_TYPE_SPACE:INDENT_TYPE_TAB,t&&u===INDENT_TYPE_SPACE&&l===1)continue;u!==a&&(i=0),a=u,y=1,m=0;const p=l-i;if(i=l,p===0)y=0,m=1;else{const g=p>0?p:-p;c=encodeIndentsKey(u,g)}d=n.get(c),d=d===void 0?[1,0]:[d[0]+y,d[1]+m],n.set(c,d)}}return n}function encodeIndentsKey(e,t){return(e===INDENT_TYPE_SPACE?"s":"t")+String(t)}function decodeIndentsKey(e){const n=e[0]==="s"?INDENT_TYPE_SPACE:INDENT_TYPE_TAB,i=Number(e.slice(1));return{type:n,amount:i}}function getMostUsedKey(e){let t,n=0,i=0;for(const[a,[c,f]]of e)(c>n||c===n&&f>i)&&(n=c,i=f,t=a);return t}function makeIndentString(e,t){return(e===INDENT_TYPE_SPACE?" ":" ").repeat(t)}function detectIndent(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=makeIndentsMap(e,!0);t.size===0&&(t=makeIndentsMap(e,!1));const n=getMostUsedKey(t);let i,a=0,c="";return n!==void 0&&({type:i,amount:a}=decodeIndentsKey(n),c=makeIndentString(i,a)),{amount:a,type:i,indent:c}}const r=Symbol.for("__confbox_fmt__"),o=/^(\s+)/,s=/(\s+)$/;function detectFormat(e,t={}){const n=t.indent===void 0&&t.preserveIndentation!==!1&&e.slice(0,t?.sampleSize||1024),i=t.preserveWhitespace===!1?void 0:{start:o.exec(e)?.[0]||"",end:s.exec(e)?.[0]||""};return{sample:n,whiteSpace:i}}function storeFormat(e,t,n){!t||typeof t!="object"||Object.defineProperty(t,r,{enumerable:!1,configurable:!0,writable:!0,value:detectFormat(e,n)})}function getFormat(e,t){if(!e||typeof e!="object"||!(r in e))return{indent:t?.indent,whitespace:{start:"",end:""}};const n=e[r];return{indent:t?.indent||detectIndent(n.sample||"").indent,whitespace:n.whiteSpace||{start:"",end:""}}}exports.getFormat=getFormat,exports.storeFormat=storeFormat;
|
||||
7
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.6b479c78.cjs
generated
vendored
Normal file
7
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.6b479c78.cjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9388d834.mjs
generated
vendored
Normal file
1
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9388d834.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
const b=/^(?:( )+|\t+)/,d="space",h="tab";function g(e,t){const n=new Map;let i=0,s,o;for(const c of e.split(/\n/g)){if(!c)continue;let f,a,l,p,r;const y=c.match(b);if(y===null)i=0,s="";else{if(f=y[0].length,a=y[1]?d:h,t&&a===d&&f===1)continue;a!==s&&(i=0),s=a,l=1,p=0;const u=f-i;if(i=f,u===0)l=0,p=1;else{const I=u>0?u:-u;o=T(a,I)}r=n.get(o),r=r===void 0?[1,0]:[r[0]+l,r[1]+p],n.set(o,r)}}return n}function T(e,t){return(e===d?"s":"t")+String(t)}function w(e){const n=e[0]==="s"?d:h,i=Number(e.slice(1));return{type:n,amount:i}}function E(e){let t,n=0,i=0;for(const[s,[o,c]]of e)(o>n||o===n&&c>i)&&(n=o,i=c,t=s);return t}function S(e,t){return(e===d?" ":" ").repeat(t)}function _(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=g(e,!0);t.size===0&&(t=g(e,!1));const n=E(t);let i,s=0,o="";return n!==void 0&&({type:i,amount:s}=w(n),o=S(i,s)),{amount:s,type:i,indent:o}}const m=Symbol.for("__confbox_fmt__"),k=/^(\s+)/,v=/(\s+)$/;function x(e,t={}){const n=t.indent===void 0&&t.preserveIndentation!==!1&&e.slice(0,t?.sampleSize||1024),i=t.preserveWhitespace===!1?void 0:{start:k.exec(e)?.[0]||"",end:v.exec(e)?.[0]||""};return{sample:n,whiteSpace:i}}function N(e,t,n){!t||typeof t!="object"||Object.defineProperty(t,m,{enumerable:!1,configurable:!0,writable:!0,value:x(e,n)})}function C(e,t){if(!e||typeof e!="object"||!(m in e))return{indent:t?.indent,whitespace:{start:"",end:""}};const n=e[m];return{indent:t?.indent||_(n.sample||"").indent,whitespace:n.whiteSpace||{start:"",end:""}}}export{C as g,N as s};
|
||||
24
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.cts
generated
vendored
Normal file
24
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
interface FormatOptions {
|
||||
/**
|
||||
* A String or Number object that's used to insert white space into the output JSON string for readability purposes.
|
||||
*
|
||||
* When provided, identation won't be auto detected anymore.
|
||||
*/
|
||||
indent?: string | number;
|
||||
/**
|
||||
* Set to `false` to skip indentation preservation.
|
||||
*/
|
||||
preserveIndentation?: boolean;
|
||||
/**
|
||||
* Set to `false` to skip whitespace preservation.
|
||||
*/
|
||||
preserveWhitespace?: boolean;
|
||||
/**
|
||||
* The number of characters to sample from the start of the text.
|
||||
*
|
||||
* Default: 1024
|
||||
*/
|
||||
sampleSize?: number;
|
||||
}
|
||||
|
||||
export type { FormatOptions as F };
|
||||
24
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.mts
generated
vendored
Normal file
24
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
interface FormatOptions {
|
||||
/**
|
||||
* A String or Number object that's used to insert white space into the output JSON string for readability purposes.
|
||||
*
|
||||
* When provided, identation won't be auto detected anymore.
|
||||
*/
|
||||
indent?: string | number;
|
||||
/**
|
||||
* Set to `false` to skip indentation preservation.
|
||||
*/
|
||||
preserveIndentation?: boolean;
|
||||
/**
|
||||
* Set to `false` to skip whitespace preservation.
|
||||
*/
|
||||
preserveWhitespace?: boolean;
|
||||
/**
|
||||
* The number of characters to sample from the start of the text.
|
||||
*
|
||||
* Default: 1024
|
||||
*/
|
||||
sampleSize?: number;
|
||||
}
|
||||
|
||||
export type { FormatOptions as F };
|
||||
24
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.ts
generated
vendored
Normal file
24
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
interface FormatOptions {
|
||||
/**
|
||||
* A String or Number object that's used to insert white space into the output JSON string for readability purposes.
|
||||
*
|
||||
* When provided, identation won't be auto detected anymore.
|
||||
*/
|
||||
indent?: string | number;
|
||||
/**
|
||||
* Set to `false` to skip indentation preservation.
|
||||
*/
|
||||
preserveIndentation?: boolean;
|
||||
/**
|
||||
* Set to `false` to skip whitespace preservation.
|
||||
*/
|
||||
preserveWhitespace?: boolean;
|
||||
/**
|
||||
* The number of characters to sample from the start of the text.
|
||||
*
|
||||
* Default: 1024
|
||||
*/
|
||||
sampleSize?: number;
|
||||
}
|
||||
|
||||
export type { FormatOptions as F };
|
||||
7
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.f9f03f05.mjs
generated
vendored
Normal file
7
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/shared/confbox.f9f03f05.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
239
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.cjs
generated
vendored
Normal file
239
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
"use strict";var _=Object.defineProperty;var A=(e,n,t)=>n in e?_(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var b=(e,n,t)=>(A(e,typeof n!="symbol"?n+"":n,t),t),E=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var c=(e,n,t)=>(E(e,n,"read from private field"),t?t.call(e):n.get(e)),O=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},d=(e,n,t,i)=>(E(e,n,"write to private field"),i?i.call(e,t):n.set(e,t),t);var h,w,s;const _format=require("./shared/confbox.3768c7e9.cjs");/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function getLineColFromPtr(e,n){let t=e.slice(0,n).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function makeCodeBlock(e,n,t){let i=e.split(/\r\n|\n|\r/g),l="",r=(Math.log10(n+1)|0)+1;for(let f=n-1;f<=n+1;f++){let o=i[f-1];o&&(l+=f.toString().padEnd(r," "),l+=": ",l+=o,l+=`
|
||||
`,f===n&&(l+=" ".repeat(r+t+2),l+=`^
|
||||
`))}return l}class TomlError extends Error{constructor(t,i){const[l,r]=getLineColFromPtr(i.toml,i.ptr),f=makeCodeBlock(i.toml,l,r);super(`Invalid TOML document: ${t}
|
||||
|
||||
${f}`,i);b(this,"line");b(this,"column");b(this,"codeblock");this.line=l,this.column=r,this.codeblock=f}}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function indexOfNewline(e,n=0,t=e.length){let i=e.indexOf(`
|
||||
`,n);return e[i-1]==="\r"&&i--,i<=t?i:-1}function skipComment(e,n){for(let t=n;t<e.length;t++){let i=e[t];if(i===`
|
||||
`)return t;if(i==="\r"&&e[t+1]===`
|
||||
`)return t+1;if(i<" "&&i!==" "||i==="\x7F")throw new TomlError("control characters are not allowed in comments",{toml:e,ptr:n})}return e.length}function skipVoid(e,n,t,i){let l;for(;(l=e[n])===" "||l===" "||!t&&(l===`
|
||||
`||l==="\r"&&e[n+1]===`
|
||||
`);)n++;return i||l!=="#"?n:skipVoid(e,skipComment(e,n),t)}function skipUntil(e,n,t,i,l=!1){if(!i)return n=indexOfNewline(e,n),n<0?e.length:n;for(let r=n;r<e.length;r++){let f=e[r];if(f==="#")r=indexOfNewline(e,r);else{if(f===t)return r+1;if(f===i)return r;if(l&&(f===`
|
||||
`||f==="\r"&&e[r+1]===`
|
||||
`))return r}}throw new TomlError("cannot find end of structure",{toml:e,ptr:n})}function getStringEnd(e,n){let t=e[n],i=t===e[n+1]&&e[n+1]===e[n+2]?e.slice(n,n+3):t;n+=i.length-1;do n=e.indexOf(i,++n);while(n>-1&&t!=="'"&&e[n-1]==="\\"&&e[n-2]!=="\\");return n>-1&&(n+=i.length,i.length>1&&(e[n]===t&&n++,e[n]===t&&n++)),n}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/let DATE_TIME_RE=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;const g=class g extends Date{constructor(t){let i=!0,l=!0,r="Z";if(typeof t=="string"){let f=t.match(DATE_TIME_RE);f?(f[1]||(i=!1,t=`0000-01-01T${t}`),l=!!f[2],f[2]&&+f[2]>23?t="":(r=f[3]||null,t=t.toUpperCase(),!r&&l&&(t+="Z"))):t=""}super(t);O(this,h,!1);O(this,w,!1);O(this,s,null);isNaN(this.getTime())||(d(this,h,i),d(this,w,l),d(this,s,r))}isDateTime(){return c(this,h)&&c(this,w)}isLocal(){return!c(this,h)||!c(this,w)||!c(this,s)}isDate(){return c(this,h)&&!c(this,w)}isTime(){return c(this,w)&&!c(this,h)}isValid(){return c(this,h)||c(this,w)}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(c(this,s)===null)return t.slice(0,-1);if(c(this,s)==="Z")return t;let i=+c(this,s).slice(1,3)*60+ +c(this,s).slice(4,6);return i=c(this,s)[0]==="-"?i:-i,new Date(this.getTime()-i*6e4).toISOString().slice(0,-1)+c(this,s)}static wrapAsOffsetDateTime(t,i="Z"){let l=new g(t);return d(l,s,i),l}static wrapAsLocalDateTime(t){let i=new g(t);return d(i,s,null),i}static wrapAsLocalDate(t){let i=new g(t);return d(i,w,!1),d(i,s,null),i}static wrapAsLocalTime(t){let i=new g(t);return d(i,h,!1),d(i,s,null),i}};h=new WeakMap,w=new WeakMap,s=new WeakMap;let TomlDate=g;/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/let INT_REGEX=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,FLOAT_REGEX=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,LEADING_ZERO=/^[+-]?0[0-9_]/,ESCAPE_REGEX=/^[0-9a-f]{4,8}$/i,ESC_MAP={b:"\b",t:" ",n:`
|
||||
`,f:"\f",r:"\r",'"':'"',"\\":"\\"};function parseString(e,n=0,t=e.length){let i=e[n]==="'",l=e[n++]===e[n]&&e[n]===e[n+1];l&&(t-=2,e[n+=2]==="\r"&&n++,e[n]===`
|
||||
`&&n++);let r=0,f,o="",a=n;for(;n<t-1;){let u=e[n++];if(u===`
|
||||
`||u==="\r"&&e[n]===`
|
||||
`){if(!l)throw new TomlError("newlines are not allowed in strings",{toml:e,ptr:n-1})}else if(u<" "&&u!==" "||u==="\x7F")throw new TomlError("control characters are not allowed in strings",{toml:e,ptr:n-1});if(f){if(f=!1,u==="u"||u==="U"){let m=e.slice(n,n+=u==="u"?4:8);if(!ESCAPE_REGEX.test(m))throw new TomlError("invalid unicode escape",{toml:e,ptr:r});try{o+=String.fromCodePoint(parseInt(m,16))}catch{throw new TomlError("invalid unicode escape",{toml:e,ptr:r})}}else if(l&&(u===`
|
||||
`||u===" "||u===" "||u==="\r")){if(n=skipVoid(e,n-1,!0),e[n]!==`
|
||||
`&&e[n]!=="\r")throw new TomlError("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:r});n=skipVoid(e,n)}else if(u in ESC_MAP)o+=ESC_MAP[u];else throw new TomlError("unrecognized escape sequence",{toml:e,ptr:r});a=n}else!i&&u==="\\"&&(r=n-1,f=!0,o+=e.slice(a,r))}return o+e.slice(a,t-1)}function parseValue(e,n,t){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return 0;let i;if((i=INT_REGEX.test(e))||FLOAT_REGEX.test(e)){if(LEADING_ZERO.test(e))throw new TomlError("leading zeroes are not allowed",{toml:n,ptr:t});let r=+e.replace(/_/g,"");if(isNaN(r))throw new TomlError("invalid number",{toml:n,ptr:t});if(i&&!Number.isSafeInteger(r))throw new TomlError("integer value cannot be represented losslessly",{toml:n,ptr:t});return r}let l=new TomlDate(e);if(!l.isValid())throw new TomlError("invalid value",{toml:n,ptr:t});return l}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function sliceAndTrimEndOf(e,n,t,i){let l=e.slice(n,t),r=l.indexOf("#");r>-1&&(skipComment(e,r),l=l.slice(0,r));let f=l.trimEnd();if(!i){let o=l.indexOf(`
|
||||
`,f.length);if(o>-1)throw new TomlError("newlines are not allowed in inline tables",{toml:e,ptr:n+o})}return[f,r]}function extractValue(e,n,t){let i=e[n];if(i==="["||i==="{"){let[f,o]=i==="["?parseArray(e,n):parseInlineTable(e,n),a=skipUntil(e,o,",",t);if(t==="}"){let u=indexOfNewline(e,o,a);if(u>-1)throw new TomlError("newlines are not allowed in inline tables",{toml:e,ptr:u})}return[f,a]}let l;if(i==='"'||i==="'"){l=getStringEnd(e,n);let f=parseString(e,n,l);if(t){if(l=skipVoid(e,l,t!=="]"),e[l]&&e[l]!==","&&e[l]!==t&&e[l]!==`
|
||||
`&&e[l]!=="\r")throw new TomlError("unexpected character encountered",{toml:e,ptr:l});l+=+(e[l]===",")}return[f,l]}l=skipUntil(e,n,",",t);let r=sliceAndTrimEndOf(e,n,l-+(e[l-1]===","),t==="]");if(!r[0])throw new TomlError("incomplete key-value declaration: no value specified",{toml:e,ptr:n});return t&&r[1]>-1&&(l=skipVoid(e,n+r[1]),l+=+(e[l]===",")),[parseValue(r[0],e,n),l]}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/let KEY_PART_RE=/^[a-zA-Z0-9-_]+[ \t]*$/;function parseKey(e,n,t="="){let i=n-1,l=[],r=e.indexOf(t,n);if(r<0)throw new TomlError("incomplete key-value: cannot find end of key",{toml:e,ptr:n});do{let f=e[n=++i];if(f!==" "&&f!==" ")if(f==='"'||f==="'"){if(f===e[n+1]&&f===e[n+2])throw new TomlError("multiline strings are not allowed in keys",{toml:e,ptr:n});let o=getStringEnd(e,n);if(o<0)throw new TomlError("unfinished string encountered",{toml:e,ptr:n});i=e.indexOf(".",o);let a=e.slice(o,i<0||i>r?r:i),u=indexOfNewline(a);if(u>-1)throw new TomlError("newlines are not allowed in keys",{toml:e,ptr:n+i+u});if(a.trimStart())throw new TomlError("found extra tokens after the string part",{toml:e,ptr:o});if(r<o&&(r=e.indexOf(t,o),r<0))throw new TomlError("incomplete key-value: cannot find end of key",{toml:e,ptr:n});l.push(parseString(e,n,o))}else{i=e.indexOf(".",n);let o=e.slice(n,i<0||i>r?r:i);if(!KEY_PART_RE.test(o))throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:n});l.push(o.trimEnd())}}while(i+1&&i<r);return[l,skipVoid(e,r+1,!0,!0)]}function parseInlineTable(e,n){let t={},i=new Set,l,r=0;for(n++;(l=e[n++])!=="}"&&l;){if(l===`
|
||||
`)throw new TomlError("newlines are not allowed in inline tables",{toml:e,ptr:n-1});if(l==="#")throw new TomlError("inline tables cannot contain comments",{toml:e,ptr:n-1});if(l===",")throw new TomlError("expected key-value, found comma",{toml:e,ptr:n-1});if(l!==" "&&l!==" "){let f,o=t,a=!1,[u,m]=parseKey(e,n-1);for(let y=0;y<u.length;y++){if(y&&(o=a?o[f]:o[f]={}),f=u[y],(a=Object.hasOwn(o,f))&&(typeof o[f]!="object"||i.has(o[f])))throw new TomlError("trying to redefine an already defined value",{toml:e,ptr:n});!a&&f==="__proto__"&&Object.defineProperty(o,f,{enumerable:!0,configurable:!0,writable:!0})}if(a)throw new TomlError("trying to redefine an already defined value",{toml:e,ptr:n});let[T,x]=extractValue(e,m,"}");i.add(T),o[f]=T,n=x,r=e[n-1]===","?n-1:0}}if(r)throw new TomlError("trailing commas are not allowed in inline tables",{toml:e,ptr:r});if(!l)throw new TomlError("unfinished table encountered",{toml:e,ptr:n});return[t,n]}function parseArray(e,n){let t=[],i;for(n++;(i=e[n++])!=="]"&&i;){if(i===",")throw new TomlError("expected value, found comma",{toml:e,ptr:n-1});if(i==="#")n=skipComment(e,n);else if(i!==" "&&i!==" "&&i!==`
|
||||
`&&i!=="\r"){let l=extractValue(e,n-1,"]");t.push(l[0]),n=l[1]}}if(!i)throw new TomlError("unfinished array encountered",{toml:e,ptr:n});return[t,n]}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function peekTable(e,n,t,i){let l=n,r=t,f,o=!1,a;for(let u=0;u<e.length;u++){if(u){if(l=o?l[f]:l[f]={},r=(a=r[f]).c,i===0&&(a.t===1||a.t===2))return null;if(a.t===2){let m=l.length-1;l=l[m],r=r[m].c}}if(f=e[u],(o=Object.hasOwn(l,f))&&r[f]?.t===0&&r[f]?.d)return null;o||(f==="__proto__"&&(Object.defineProperty(l,f,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,f,{enumerable:!0,configurable:!0,writable:!0})),r[f]={t:u<e.length-1&&i===2?3:i,d:!1,i:0,c:{}})}if(a=r[f],a.t!==i&&!(i===1&&a.t===3)||(i===2&&(a.d||(a.d=!0,l[f]=[]),l[f].push(l={}),a.c[a.i++]=a={t:1,d:!1,i:0,c:{}}),a.d))return null;if(a.d=!0,i===1)l=o?l[f]:l[f]={};else if(i===0&&o)return null;return[f,l,a.c]}function parse(e){let n={},t={},i=n,l=t;for(let r=skipVoid(e,0);r<e.length;){if(e[r]==="["){let f=e[++r]==="[",o=parseKey(e,r+=+f,"]");if(f){if(e[o[1]-1]!=="]")throw new TomlError("expected end of table declaration",{toml:e,ptr:o[1]-1});o[1]++}let a=peekTable(o[0],n,t,f?2:1);if(!a)throw new TomlError("trying to redefine an already defined table or value",{toml:e,ptr:r});l=a[2],i=a[1],r=o[1]}else{let f=parseKey(e,r),o=peekTable(f[0],i,l,0);if(!o)throw new TomlError("trying to redefine an already defined table or value",{toml:e,ptr:r});let a=extractValue(e,f[1]);o[1][o[0]]=a[0],r=a[1]}if(r=skipVoid(e,r,!0),e[r]&&e[r]!==`
|
||||
`&&e[r]!=="\r")throw new TomlError("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:r});r=skipVoid(e,r)}return n}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/const BARE_KEY=/^[a-z0-9-_]+$/i;function extendedTypeOf(e){let n=typeof e;if(n==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return n}function isArrayOfTables(e){for(let n=0;n<e.length;n++)if(extendedTypeOf(e[n])!=="object")return!1;return e.length!=0}function formatString(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function stringifyValue(e,n=extendedTypeOf(e)){if(n==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":e.toString();if(n==="bigint"||n==="boolean")return e.toString();if(n==="string")return formatString(e);if(n==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(n==="object")return stringifyInlineTable(e);if(n==="array")return stringifyArray(e)}function stringifyInlineTable(e){let n=Object.keys(e);if(n.length===0)return"{}";let t="{ ";for(let i=0;i<n.length;i++){let l=n[i];i&&(t+=", "),t+=BARE_KEY.test(l)?l:formatString(l),t+=" = ",t+=stringifyValue(e[l])}return t+" }"}function stringifyArray(e){if(e.length===0)return"[]";let n="[ ";for(let t=0;t<e.length;t++){if(t&&(n+=", "),e[t]===null||e[t]===void 0)throw new TypeError("arrays cannot contain null or undefined values");n+=stringifyValue(e[t])}return n+" ]"}function stringifyArrayTable(e,n){let t="";for(let i=0;i<e.length;i++)t+=`[[${n}]]
|
||||
`,t+=stringifyTable(e[i],n),t+=`
|
||||
|
||||
`;return t}function stringifyTable(e,n=""){let t="",i="",l=Object.keys(e);for(let r=0;r<l.length;r++){let f=l[r];if(e[f]!==null&&e[f]!==void 0){let o=extendedTypeOf(e[f]);if(o==="symbol"||o==="function")throw new TypeError(`cannot serialize values of type '${o}'`);let a=BARE_KEY.test(f)?f:formatString(f);if(o==="array"&&isArrayOfTables(e[f]))i+=stringifyArrayTable(e[f],n?`${n}.${a}`:a);else if(o==="object"){let u=n?`${n}.${a}`:a;i+=`[${u}]
|
||||
`,i+=stringifyTable(e[f],u),i+=`
|
||||
|
||||
`}else t+=a,t+=" = ",t+=stringifyValue(e[f],o),t+=`
|
||||
`}}return`${t}
|
||||
${i}`.trim()}function stringify(e){if(extendedTypeOf(e)!=="object")throw new TypeError("stringify can only be called with an object");return stringifyTable(e)}function parseTOML(e){const n=parse(e);return _format.storeFormat(e,n,{preserveIndentation:!1}),n}function stringifyTOML(e){const n=_format.getFormat(e,{preserveIndentation:!1}),t=stringify(e);return n.whitespace.start+t+n.whitespace.end}exports.parseTOML=parseTOML,exports.stringifyTOML=stringifyTOML;
|
||||
22
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.d.cts
generated
vendored
Normal file
22
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Converts a [TOML](https://toml.io/) string into an object.
|
||||
*
|
||||
* @NOTE Comments and indentation is not preserved after parsing.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The TOML string to parse.
|
||||
* @returns The JavaScript value converted from the TOML string.
|
||||
*/
|
||||
declare function parseTOML<T = unknown>(text: string): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [TOML](https://toml.io/) string.
|
||||
*
|
||||
* @NOTE Comments and indentation is not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The YAML string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyTOML(value: any): string;
|
||||
|
||||
export { parseTOML, stringifyTOML };
|
||||
22
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.d.mts
generated
vendored
Normal file
22
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Converts a [TOML](https://toml.io/) string into an object.
|
||||
*
|
||||
* @NOTE Comments and indentation is not preserved after parsing.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The TOML string to parse.
|
||||
* @returns The JavaScript value converted from the TOML string.
|
||||
*/
|
||||
declare function parseTOML<T = unknown>(text: string): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [TOML](https://toml.io/) string.
|
||||
*
|
||||
* @NOTE Comments and indentation is not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The YAML string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyTOML(value: any): string;
|
||||
|
||||
export { parseTOML, stringifyTOML };
|
||||
22
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.d.ts
generated
vendored
Normal file
22
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Converts a [TOML](https://toml.io/) string into an object.
|
||||
*
|
||||
* @NOTE Comments and indentation is not preserved after parsing.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The TOML string to parse.
|
||||
* @returns The JavaScript value converted from the TOML string.
|
||||
*/
|
||||
declare function parseTOML<T = unknown>(text: string): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [TOML](https://toml.io/) string.
|
||||
*
|
||||
* @NOTE Comments and indentation is not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The YAML string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyTOML(value: any): string;
|
||||
|
||||
export { parseTOML, stringifyTOML };
|
||||
239
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.mjs
generated
vendored
Normal file
239
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/toml.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
var F=Object.defineProperty;var V=(e,n,t)=>n in e?F(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var O=(e,n,t)=>(V(e,typeof n!="symbol"?n+"":n,t),t),L=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var d=(e,n,t)=>(L(e,n,"read from private field"),t?t.call(e):n.get(e)),T=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},w=(e,n,t,i)=>(L(e,n,"write to private field"),i?i.call(e,t):n.set(e,t),t);var h,m,s;import{s as G,g as K}from"./shared/confbox.9388d834.mjs";/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function U(e,n){let t=e.slice(0,n).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function X(e,n,t){let i=e.split(/\r\n|\n|\r/g),l="",r=(Math.log10(n+1)|0)+1;for(let f=n-1;f<=n+1;f++){let o=i[f-1];o&&(l+=f.toString().padEnd(r," "),l+=": ",l+=o,l+=`
|
||||
`,f===n&&(l+=" ".repeat(r+t+2),l+=`^
|
||||
`))}return l}class u extends Error{constructor(t,i){const[l,r]=U(i.toml,i.ptr),f=X(i.toml,l,r);super(`Invalid TOML document: ${t}
|
||||
|
||||
${f}`,i);O(this,"line");O(this,"column");O(this,"codeblock");this.line=l,this.column=r,this.codeblock=f}}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function x(e,n=0,t=e.length){let i=e.indexOf(`
|
||||
`,n);return e[i-1]==="\r"&&i--,i<=t?i:-1}function A(e,n){for(let t=n;t<e.length;t++){let i=e[t];if(i===`
|
||||
`)return t;if(i==="\r"&&e[t+1]===`
|
||||
`)return t+1;if(i<" "&&i!==" "||i==="\x7F")throw new u("control characters are not allowed in comments",{toml:e,ptr:n})}return e.length}function g(e,n,t,i){let l;for(;(l=e[n])===" "||l===" "||!t&&(l===`
|
||||
`||l==="\r"&&e[n+1]===`
|
||||
`);)n++;return i||l!=="#"?n:g(e,A(e,n),t)}function P(e,n,t,i,l=!1){if(!i)return n=x(e,n),n<0?e.length:n;for(let r=n;r<e.length;r++){let f=e[r];if(f==="#")r=x(e,r);else{if(f===t)return r+1;if(f===i)return r;if(l&&(f===`
|
||||
`||f==="\r"&&e[r+1]===`
|
||||
`))return r}}throw new u("cannot find end of structure",{toml:e,ptr:n})}function v(e,n){let t=e[n],i=t===e[n+1]&&e[n+1]===e[n+2]?e.slice(n,n+3):t;n+=i.length-1;do n=e.indexOf(i,++n);while(n>-1&&t!=="'"&&e[n-1]==="\\"&&e[n-2]!=="\\");return n>-1&&(n+=i.length,i.length>1&&(e[n]===t&&n++,e[n]===t&&n++)),n}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/let B=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;const b=class b extends Date{constructor(t){let i=!0,l=!0,r="Z";if(typeof t=="string"){let f=t.match(B);f?(f[1]||(i=!1,t=`0000-01-01T${t}`),l=!!f[2],f[2]&&+f[2]>23?t="":(r=f[3]||null,t=t.toUpperCase(),!r&&l&&(t+="Z"))):t=""}super(t);T(this,h,!1);T(this,m,!1);T(this,s,null);isNaN(this.getTime())||(w(this,h,i),w(this,m,l),w(this,s,r))}isDateTime(){return d(this,h)&&d(this,m)}isLocal(){return!d(this,h)||!d(this,m)||!d(this,s)}isDate(){return d(this,h)&&!d(this,m)}isTime(){return d(this,m)&&!d(this,h)}isValid(){return d(this,h)||d(this,m)}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(d(this,s)===null)return t.slice(0,-1);if(d(this,s)==="Z")return t;let i=+d(this,s).slice(1,3)*60+ +d(this,s).slice(4,6);return i=d(this,s)[0]==="-"?i:-i,new Date(this.getTime()-i*6e4).toISOString().slice(0,-1)+d(this,s)}static wrapAsOffsetDateTime(t,i="Z"){let l=new b(t);return w(l,s,i),l}static wrapAsLocalDateTime(t){let i=new b(t);return w(i,s,null),i}static wrapAsLocalDate(t){let i=new b(t);return w(i,m,!1),w(i,s,null),i}static wrapAsLocalTime(t){let i=new b(t);return w(i,h,!1),w(i,s,null),i}};h=new WeakMap,m=new WeakMap,s=new WeakMap;let S=b;/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/let Y=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,j=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,q=/^[+-]?0[0-9_]/,J=/^[0-9a-f]{4,8}$/i,R={b:"\b",t:" ",n:`
|
||||
`,f:"\f",r:"\r",'"':'"',"\\":"\\"};function C(e,n=0,t=e.length){let i=e[n]==="'",l=e[n++]===e[n]&&e[n]===e[n+1];l&&(t-=2,e[n+=2]==="\r"&&n++,e[n]===`
|
||||
`&&n++);let r=0,f,o="",a=n;for(;n<t-1;){let c=e[n++];if(c===`
|
||||
`||c==="\r"&&e[n]===`
|
||||
`){if(!l)throw new u("newlines are not allowed in strings",{toml:e,ptr:n-1})}else if(c<" "&&c!==" "||c==="\x7F")throw new u("control characters are not allowed in strings",{toml:e,ptr:n-1});if(f){if(f=!1,c==="u"||c==="U"){let y=e.slice(n,n+=c==="u"?4:8);if(!J.test(y))throw new u("invalid unicode escape",{toml:e,ptr:r});try{o+=String.fromCodePoint(parseInt(y,16))}catch{throw new u("invalid unicode escape",{toml:e,ptr:r})}}else if(l&&(c===`
|
||||
`||c===" "||c===" "||c==="\r")){if(n=g(e,n-1,!0),e[n]!==`
|
||||
`&&e[n]!=="\r")throw new u("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:r});n=g(e,n)}else if(c in R)o+=R[c];else throw new u("unrecognized escape sequence",{toml:e,ptr:r});a=n}else!i&&c==="\\"&&(r=n-1,f=!0,o+=e.slice(a,r))}return o+e.slice(a,t-1)}function H(e,n,t){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return 0;let i;if((i=Y.test(e))||j.test(e)){if(q.test(e))throw new u("leading zeroes are not allowed",{toml:n,ptr:t});let r=+e.replace(/_/g,"");if(isNaN(r))throw new u("invalid number",{toml:n,ptr:t});if(i&&!Number.isSafeInteger(r))throw new u("integer value cannot be represented losslessly",{toml:n,ptr:t});return r}let l=new S(e);if(!l.isValid())throw new u("invalid value",{toml:n,ptr:t});return l}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function Q(e,n,t,i){let l=e.slice(n,t),r=l.indexOf("#");r>-1&&(A(e,r),l=l.slice(0,r));let f=l.trimEnd();if(!i){let o=l.indexOf(`
|
||||
`,f.length);if(o>-1)throw new u("newlines are not allowed in inline tables",{toml:e,ptr:n+o})}return[f,r]}function I(e,n,t){let i=e[n];if(i==="["||i==="{"){let[f,o]=i==="["?ne(e,n):ee(e,n),a=P(e,o,",",t);if(t==="}"){let c=x(e,o,a);if(c>-1)throw new u("newlines are not allowed in inline tables",{toml:e,ptr:c})}return[f,a]}let l;if(i==='"'||i==="'"){l=v(e,n);let f=C(e,n,l);if(t){if(l=g(e,l,t!=="]"),e[l]&&e[l]!==","&&e[l]!==t&&e[l]!==`
|
||||
`&&e[l]!=="\r")throw new u("unexpected character encountered",{toml:e,ptr:l});l+=+(e[l]===",")}return[f,l]}l=P(e,n,",",t);let r=Q(e,n,l-+(e[l-1]===","),t==="]");if(!r[0])throw new u("incomplete key-value declaration: no value specified",{toml:e,ptr:n});return t&&r[1]>-1&&(l=g(e,n+r[1]),l+=+(e[l]===",")),[H(r[0],e,n),l]}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/let W=/^[a-zA-Z0-9-_]+[ \t]*$/;function p(e,n,t="="){let i=n-1,l=[],r=e.indexOf(t,n);if(r<0)throw new u("incomplete key-value: cannot find end of key",{toml:e,ptr:n});do{let f=e[n=++i];if(f!==" "&&f!==" ")if(f==='"'||f==="'"){if(f===e[n+1]&&f===e[n+2])throw new u("multiline strings are not allowed in keys",{toml:e,ptr:n});let o=v(e,n);if(o<0)throw new u("unfinished string encountered",{toml:e,ptr:n});i=e.indexOf(".",o);let a=e.slice(o,i<0||i>r?r:i),c=x(a);if(c>-1)throw new u("newlines are not allowed in keys",{toml:e,ptr:n+i+c});if(a.trimStart())throw new u("found extra tokens after the string part",{toml:e,ptr:o});if(r<o&&(r=e.indexOf(t,o),r<0))throw new u("incomplete key-value: cannot find end of key",{toml:e,ptr:n});l.push(C(e,n,o))}else{i=e.indexOf(".",n);let o=e.slice(n,i<0||i>r?r:i);if(!W.test(o))throw new u("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:n});l.push(o.trimEnd())}}while(i+1&&i<r);return[l,g(e,r+1,!0,!0)]}function ee(e,n){let t={},i=new Set,l,r=0;for(n++;(l=e[n++])!=="}"&&l;){if(l===`
|
||||
`)throw new u("newlines are not allowed in inline tables",{toml:e,ptr:n-1});if(l==="#")throw new u("inline tables cannot contain comments",{toml:e,ptr:n-1});if(l===",")throw new u("expected key-value, found comma",{toml:e,ptr:n-1});if(l!==" "&&l!==" "){let f,o=t,a=!1,[c,y]=p(e,n-1);for(let E=0;E<c.length;E++){if(E&&(o=a?o[f]:o[f]={}),f=c[E],(a=Object.hasOwn(o,f))&&(typeof o[f]!="object"||i.has(o[f])))throw new u("trying to redefine an already defined value",{toml:e,ptr:n});!a&&f==="__proto__"&&Object.defineProperty(o,f,{enumerable:!0,configurable:!0,writable:!0})}if(a)throw new u("trying to redefine an already defined value",{toml:e,ptr:n});let[k,z]=I(e,y,"}");i.add(k),o[f]=k,n=z,r=e[n-1]===","?n-1:0}}if(r)throw new u("trailing commas are not allowed in inline tables",{toml:e,ptr:r});if(!l)throw new u("unfinished table encountered",{toml:e,ptr:n});return[t,n]}function ne(e,n){let t=[],i;for(n++;(i=e[n++])!=="]"&&i;){if(i===",")throw new u("expected value, found comma",{toml:e,ptr:n-1});if(i==="#")n=A(e,n);else if(i!==" "&&i!==" "&&i!==`
|
||||
`&&i!=="\r"){let l=I(e,n-1,"]");t.push(l[0]),n=l[1]}}if(!i)throw new u("unfinished array encountered",{toml:e,ptr:n});return[t,n]}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/function M(e,n,t,i){let l=n,r=t,f,o=!1,a;for(let c=0;c<e.length;c++){if(c){if(l=o?l[f]:l[f]={},r=(a=r[f]).c,i===0&&(a.t===1||a.t===2))return null;if(a.t===2){let y=l.length-1;l=l[y],r=r[y].c}}if(f=e[c],(o=Object.hasOwn(l,f))&&r[f]?.t===0&&r[f]?.d)return null;o||(f==="__proto__"&&(Object.defineProperty(l,f,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,f,{enumerable:!0,configurable:!0,writable:!0})),r[f]={t:c<e.length-1&&i===2?3:i,d:!1,i:0,c:{}})}if(a=r[f],a.t!==i&&!(i===1&&a.t===3)||(i===2&&(a.d||(a.d=!0,l[f]=[]),l[f].push(l={}),a.c[a.i++]=a={t:1,d:!1,i:0,c:{}}),a.d))return null;if(a.d=!0,i===1)l=o?l[f]:l[f]={};else if(i===0&&o)return null;return[f,l,a.c]}function te(e){let n={},t={},i=n,l=t;for(let r=g(e,0);r<e.length;){if(e[r]==="["){let f=e[++r]==="[",o=p(e,r+=+f,"]");if(f){if(e[o[1]-1]!=="]")throw new u("expected end of table declaration",{toml:e,ptr:o[1]-1});o[1]++}let a=M(o[0],n,t,f?2:1);if(!a)throw new u("trying to redefine an already defined table or value",{toml:e,ptr:r});l=a[2],i=a[1],r=o[1]}else{let f=p(e,r),o=M(f[0],i,l,0);if(!o)throw new u("trying to redefine an already defined table or value",{toml:e,ptr:r});let a=I(e,f[1]);o[1][o[0]]=a[0],r=a[1]}if(r=g(e,r,!0),e[r]&&e[r]!==`
|
||||
`&&e[r]!=="\r")throw new u("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:r});r=g(e,r)}return n}/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/const Z=/^[a-z0-9-_]+$/i;function _(e){let n=typeof e;if(n==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return n}function ie(e){for(let n=0;n<e.length;n++)if(_(e[n])!=="object")return!1;return e.length!=0}function $(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function N(e,n=_(e)){if(n==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":e.toString();if(n==="bigint"||n==="boolean")return e.toString();if(n==="string")return $(e);if(n==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(n==="object")return le(e);if(n==="array")return re(e)}function le(e){let n=Object.keys(e);if(n.length===0)return"{}";let t="{ ";for(let i=0;i<n.length;i++){let l=n[i];i&&(t+=", "),t+=Z.test(l)?l:$(l),t+=" = ",t+=N(e[l])}return t+" }"}function re(e){if(e.length===0)return"[]";let n="[ ";for(let t=0;t<e.length;t++){if(t&&(n+=", "),e[t]===null||e[t]===void 0)throw new TypeError("arrays cannot contain null or undefined values");n+=N(e[t])}return n+" ]"}function fe(e,n){let t="";for(let i=0;i<e.length;i++)t+=`[[${n}]]
|
||||
`,t+=D(e[i],n),t+=`
|
||||
|
||||
`;return t}function D(e,n=""){let t="",i="",l=Object.keys(e);for(let r=0;r<l.length;r++){let f=l[r];if(e[f]!==null&&e[f]!==void 0){let o=_(e[f]);if(o==="symbol"||o==="function")throw new TypeError(`cannot serialize values of type '${o}'`);let a=Z.test(f)?f:$(f);if(o==="array"&&ie(e[f]))i+=fe(e[f],n?`${n}.${a}`:a);else if(o==="object"){let c=n?`${n}.${a}`:a;i+=`[${c}]
|
||||
`,i+=D(e[f],c),i+=`
|
||||
|
||||
`}else t+=a,t+=" = ",t+=N(e[f],o),t+=`
|
||||
`}}return`${t}
|
||||
${i}`.trim()}function oe(e){if(_(e)!=="object")throw new TypeError("stringify can only be called with an object");return D(e)}function ae(e){const n=te(e);return G(e,n,{preserveIndentation:!1}),n}function ue(e){const n=K(e,{preserveIndentation:!1}),t=oe(e);return n.whitespace.start+t+n.whitespace.end}export{ae as parseTOML,ue as stringifyTOML};
|
||||
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.cjs
generated
vendored
Normal file
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.cjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
95
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.d.cts
generated
vendored
Normal file
95
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.cjs';
|
||||
|
||||
/**
|
||||
* Converts a [YAML](https://yaml.org/) string into an object.
|
||||
*
|
||||
* @NOTE This function does **not** understand multi-document sources, it throws exception on those.
|
||||
*
|
||||
* @NOTE Comments are not preserved after parsing.
|
||||
*
|
||||
* @NOTE This function does **not** support schema-specific tag resolution restrictions.
|
||||
* So, the JSON schema is not as strictly defined in the YAML specification.
|
||||
* It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
|
||||
* The core schema also has no such restrictions. It allows binary notation for integers.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The YAML string to parse.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the YAML string.
|
||||
*/
|
||||
declare function parseYAML<T = unknown>(text: string, options?: YAMLParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [YAML](https://yaml.org/) string.
|
||||
*
|
||||
* @NOTE Comments are not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The YAML string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyYAML(value: any, options?: YAMLStringifyOptions): string;
|
||||
interface YAMLParseOptions extends FormatOptions {
|
||||
/** string to be used as a file path in error/warning messages. */
|
||||
filename?: string | undefined;
|
||||
/** function to call on warning messages. */
|
||||
onWarning?(this: null, e: YAMLException): void;
|
||||
/** specifies a schema to use. */
|
||||
schema?: any | undefined;
|
||||
/** compatibility with JSON.parse behaviour. */
|
||||
json?: boolean | undefined;
|
||||
/** listener for parse events */
|
||||
listener?(this: any, eventType: any, state: any): void;
|
||||
}
|
||||
interface YAMLStringifyOptions extends FormatOptions {
|
||||
/** indentation width to use (in spaces). */
|
||||
indent?: number | undefined;
|
||||
/** when true, will not add an indentation level to array elements */
|
||||
noArrayIndent?: boolean | undefined;
|
||||
/** do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. */
|
||||
skipInvalid?: boolean | undefined;
|
||||
/** specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere */
|
||||
flowLevel?: number | undefined;
|
||||
/** Each tag may have own set of styles. - "tag" => "style" map. */
|
||||
styles?: {
|
||||
[x: string]: any;
|
||||
} | undefined;
|
||||
/** specifies a schema to use. */
|
||||
schema?: any | undefined;
|
||||
/** if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) */
|
||||
sortKeys?: boolean | ((a: any, b: any) => number) | undefined;
|
||||
/** set max line width. (default: 80) */
|
||||
lineWidth?: number | undefined;
|
||||
/** if true, don't convert duplicate objects into references (default: false) */
|
||||
noRefs?: boolean | undefined;
|
||||
/** if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) */
|
||||
noCompatMode?: boolean | undefined;
|
||||
/**
|
||||
* if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`.
|
||||
* Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false).
|
||||
*/
|
||||
condenseFlow?: boolean | undefined;
|
||||
/** strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters. (default: `'`) */
|
||||
quotingType?: "'" | '"' | undefined;
|
||||
/** if true, all non-key strings will be quoted even if they normally don't need to. (default: false) */
|
||||
forceQuotes?: boolean | undefined;
|
||||
/** callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`). */
|
||||
replacer?: ((key: string, value: any) => any) | undefined;
|
||||
}
|
||||
interface Mark {
|
||||
buffer: string;
|
||||
column: number;
|
||||
line: number;
|
||||
name: string;
|
||||
position: number;
|
||||
snippet: string;
|
||||
}
|
||||
declare class YAMLException extends Error {
|
||||
constructor(reason?: string, mark?: Mark);
|
||||
toString(compact?: boolean): string;
|
||||
name: string;
|
||||
reason: string;
|
||||
message: string;
|
||||
mark: Mark;
|
||||
}
|
||||
|
||||
export { type YAMLParseOptions, type YAMLStringifyOptions, parseYAML, stringifyYAML };
|
||||
95
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.d.mts
generated
vendored
Normal file
95
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.mjs';
|
||||
|
||||
/**
|
||||
* Converts a [YAML](https://yaml.org/) string into an object.
|
||||
*
|
||||
* @NOTE This function does **not** understand multi-document sources, it throws exception on those.
|
||||
*
|
||||
* @NOTE Comments are not preserved after parsing.
|
||||
*
|
||||
* @NOTE This function does **not** support schema-specific tag resolution restrictions.
|
||||
* So, the JSON schema is not as strictly defined in the YAML specification.
|
||||
* It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
|
||||
* The core schema also has no such restrictions. It allows binary notation for integers.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The YAML string to parse.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the YAML string.
|
||||
*/
|
||||
declare function parseYAML<T = unknown>(text: string, options?: YAMLParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [YAML](https://yaml.org/) string.
|
||||
*
|
||||
* @NOTE Comments are not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The YAML string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyYAML(value: any, options?: YAMLStringifyOptions): string;
|
||||
interface YAMLParseOptions extends FormatOptions {
|
||||
/** string to be used as a file path in error/warning messages. */
|
||||
filename?: string | undefined;
|
||||
/** function to call on warning messages. */
|
||||
onWarning?(this: null, e: YAMLException): void;
|
||||
/** specifies a schema to use. */
|
||||
schema?: any | undefined;
|
||||
/** compatibility with JSON.parse behaviour. */
|
||||
json?: boolean | undefined;
|
||||
/** listener for parse events */
|
||||
listener?(this: any, eventType: any, state: any): void;
|
||||
}
|
||||
interface YAMLStringifyOptions extends FormatOptions {
|
||||
/** indentation width to use (in spaces). */
|
||||
indent?: number | undefined;
|
||||
/** when true, will not add an indentation level to array elements */
|
||||
noArrayIndent?: boolean | undefined;
|
||||
/** do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. */
|
||||
skipInvalid?: boolean | undefined;
|
||||
/** specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere */
|
||||
flowLevel?: number | undefined;
|
||||
/** Each tag may have own set of styles. - "tag" => "style" map. */
|
||||
styles?: {
|
||||
[x: string]: any;
|
||||
} | undefined;
|
||||
/** specifies a schema to use. */
|
||||
schema?: any | undefined;
|
||||
/** if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) */
|
||||
sortKeys?: boolean | ((a: any, b: any) => number) | undefined;
|
||||
/** set max line width. (default: 80) */
|
||||
lineWidth?: number | undefined;
|
||||
/** if true, don't convert duplicate objects into references (default: false) */
|
||||
noRefs?: boolean | undefined;
|
||||
/** if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) */
|
||||
noCompatMode?: boolean | undefined;
|
||||
/**
|
||||
* if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`.
|
||||
* Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false).
|
||||
*/
|
||||
condenseFlow?: boolean | undefined;
|
||||
/** strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters. (default: `'`) */
|
||||
quotingType?: "'" | '"' | undefined;
|
||||
/** if true, all non-key strings will be quoted even if they normally don't need to. (default: false) */
|
||||
forceQuotes?: boolean | undefined;
|
||||
/** callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`). */
|
||||
replacer?: ((key: string, value: any) => any) | undefined;
|
||||
}
|
||||
interface Mark {
|
||||
buffer: string;
|
||||
column: number;
|
||||
line: number;
|
||||
name: string;
|
||||
position: number;
|
||||
snippet: string;
|
||||
}
|
||||
declare class YAMLException extends Error {
|
||||
constructor(reason?: string, mark?: Mark);
|
||||
toString(compact?: boolean): string;
|
||||
name: string;
|
||||
reason: string;
|
||||
message: string;
|
||||
mark: Mark;
|
||||
}
|
||||
|
||||
export { type YAMLParseOptions, type YAMLStringifyOptions, parseYAML, stringifyYAML };
|
||||
95
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.d.ts
generated
vendored
Normal file
95
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import { F as FormatOptions } from './shared/confbox.9745c98f.js';
|
||||
|
||||
/**
|
||||
* Converts a [YAML](https://yaml.org/) string into an object.
|
||||
*
|
||||
* @NOTE This function does **not** understand multi-document sources, it throws exception on those.
|
||||
*
|
||||
* @NOTE Comments are not preserved after parsing.
|
||||
*
|
||||
* @NOTE This function does **not** support schema-specific tag resolution restrictions.
|
||||
* So, the JSON schema is not as strictly defined in the YAML specification.
|
||||
* It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
|
||||
* The core schema also has no such restrictions. It allows binary notation for integers.
|
||||
*
|
||||
* @template T The type of the return value.
|
||||
* @param text The YAML string to parse.
|
||||
* @param options Parsing options.
|
||||
* @returns The JavaScript value converted from the YAML string.
|
||||
*/
|
||||
declare function parseYAML<T = unknown>(text: string, options?: YAMLParseOptions): T;
|
||||
/**
|
||||
* Converts a JavaScript value to a [YAML](https://yaml.org/) string.
|
||||
*
|
||||
* @NOTE Comments are not preserved in the output.
|
||||
*
|
||||
* @param value
|
||||
* @param options
|
||||
* @returns The YAML string converted from the JavaScript value.
|
||||
*/
|
||||
declare function stringifyYAML(value: any, options?: YAMLStringifyOptions): string;
|
||||
interface YAMLParseOptions extends FormatOptions {
|
||||
/** string to be used as a file path in error/warning messages. */
|
||||
filename?: string | undefined;
|
||||
/** function to call on warning messages. */
|
||||
onWarning?(this: null, e: YAMLException): void;
|
||||
/** specifies a schema to use. */
|
||||
schema?: any | undefined;
|
||||
/** compatibility with JSON.parse behaviour. */
|
||||
json?: boolean | undefined;
|
||||
/** listener for parse events */
|
||||
listener?(this: any, eventType: any, state: any): void;
|
||||
}
|
||||
interface YAMLStringifyOptions extends FormatOptions {
|
||||
/** indentation width to use (in spaces). */
|
||||
indent?: number | undefined;
|
||||
/** when true, will not add an indentation level to array elements */
|
||||
noArrayIndent?: boolean | undefined;
|
||||
/** do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. */
|
||||
skipInvalid?: boolean | undefined;
|
||||
/** specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere */
|
||||
flowLevel?: number | undefined;
|
||||
/** Each tag may have own set of styles. - "tag" => "style" map. */
|
||||
styles?: {
|
||||
[x: string]: any;
|
||||
} | undefined;
|
||||
/** specifies a schema to use. */
|
||||
schema?: any | undefined;
|
||||
/** if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) */
|
||||
sortKeys?: boolean | ((a: any, b: any) => number) | undefined;
|
||||
/** set max line width. (default: 80) */
|
||||
lineWidth?: number | undefined;
|
||||
/** if true, don't convert duplicate objects into references (default: false) */
|
||||
noRefs?: boolean | undefined;
|
||||
/** if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) */
|
||||
noCompatMode?: boolean | undefined;
|
||||
/**
|
||||
* if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`.
|
||||
* Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false).
|
||||
*/
|
||||
condenseFlow?: boolean | undefined;
|
||||
/** strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters. (default: `'`) */
|
||||
quotingType?: "'" | '"' | undefined;
|
||||
/** if true, all non-key strings will be quoted even if they normally don't need to. (default: false) */
|
||||
forceQuotes?: boolean | undefined;
|
||||
/** callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`). */
|
||||
replacer?: ((key: string, value: any) => any) | undefined;
|
||||
}
|
||||
interface Mark {
|
||||
buffer: string;
|
||||
column: number;
|
||||
line: number;
|
||||
name: string;
|
||||
position: number;
|
||||
snippet: string;
|
||||
}
|
||||
declare class YAMLException extends Error {
|
||||
constructor(reason?: string, mark?: Mark);
|
||||
toString(compact?: boolean): string;
|
||||
name: string;
|
||||
reason: string;
|
||||
message: string;
|
||||
mark: Mark;
|
||||
}
|
||||
|
||||
export { type YAMLParseOptions, type YAMLStringifyOptions, parseYAML, stringifyYAML };
|
||||
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.mjs
generated
vendored
Normal file
32
Frontend-Learner/node_modules/mlly/node_modules/confbox/dist/yaml.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/json5.d.ts
generated
vendored
Normal file
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/json5.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export * from "./dist/json5";
|
||||
export { default } from "./dist/json5";
|
||||
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/jsonc.d.ts
generated
vendored
Normal file
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/jsonc.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export * from "./dist/jsonc";
|
||||
export { default } from "./dist/jsonc";
|
||||
86
Frontend-Learner/node_modules/mlly/node_modules/confbox/package.json
generated
vendored
Normal file
86
Frontend-Learner/node_modules/mlly/node_modules/confbox/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
{
|
||||
"name": "confbox",
|
||||
"version": "0.1.8",
|
||||
"description": "Compact and high quality YAML, TOML, JSONC and JSON5 parsers",
|
||||
"keywords": [
|
||||
"yaml",
|
||||
"toml",
|
||||
"jsonc",
|
||||
"json5",
|
||||
"unjs",
|
||||
"config"
|
||||
],
|
||||
"repository": "unjs/confbox",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"./json5": {
|
||||
"types": "./dist/json5.d.ts",
|
||||
"import": "./dist/json5.mjs",
|
||||
"require": "./dist/json5.cjs"
|
||||
},
|
||||
"./jsonc": {
|
||||
"types": "./dist/jsonc.d.ts",
|
||||
"import": "./dist/jsonc.mjs",
|
||||
"require": "./dist/jsonc.cjs"
|
||||
},
|
||||
"./toml": {
|
||||
"types": "./dist/toml.d.ts",
|
||||
"import": "./dist/toml.mjs",
|
||||
"require": "./dist/toml.cjs"
|
||||
},
|
||||
"./yaml": {
|
||||
"types": "./dist/yaml.d.ts",
|
||||
"import": "./dist/yaml.mjs",
|
||||
"require": "./dist/yaml.cjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"*.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "vitest dev --coverage",
|
||||
"bench": "pnpm build && node test/bench.mjs",
|
||||
"lint": "eslint && prettier -c src test",
|
||||
"lint:fix": "eslint --fix && prettier -c src test -w",
|
||||
"prepack": "pnpm build",
|
||||
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
|
||||
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
|
||||
"test:types": "tsc --noEmit --skipLibCheck"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^22.7.4",
|
||||
"@vitest/coverage-v8": "^2.1.2",
|
||||
"automd": "^0.3.10",
|
||||
"changelogen": "^0.5.7",
|
||||
"detect-indent": "^7.0.1",
|
||||
"eslint": "^9.12.0",
|
||||
"eslint-config-unjs": "^0.4.1",
|
||||
"jiti": "^2.3.1",
|
||||
"js-toml": "^1.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json5": "^2.2.3",
|
||||
"jsonc-parser": "^3.3.1",
|
||||
"mitata": "^1.0.10",
|
||||
"prettier": "^3.3.3",
|
||||
"smol-toml": "^1.3.0",
|
||||
"toml": "^3.0.0",
|
||||
"typescript": "^5.6.2",
|
||||
"unbuild": "^2.0.0",
|
||||
"vitest": "^2.1.2",
|
||||
"yaml": "^2.5.1"
|
||||
},
|
||||
"packageManager": "pnpm@9.12.0"
|
||||
}
|
||||
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/toml.d.ts
generated
vendored
Normal file
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/toml.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export * from "./dist/toml";
|
||||
export { default } from "./dist/toml";
|
||||
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/yaml.d.ts
generated
vendored
Normal file
2
Frontend-Learner/node_modules/mlly/node_modules/confbox/yaml.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export * from "./dist/yaml";
|
||||
export { default } from "./dist/yaml";
|
||||
44
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/LICENSE
generated
vendored
Normal file
44
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Pooya Parsa <pooya@pi0.io> - Daniel Roe <daniel@roe.dev>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Copyright Joyent, Inc. and other Node contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
167
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/README.md
generated
vendored
Normal file
167
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
# pkg-types
|
||||
|
||||
<!-- automd:badges color=yellow codecov -->
|
||||
|
||||
[](https://npmjs.com/package/pkg-types)
|
||||
[](https://npm.chart.dev/pkg-types)
|
||||
[](https://codecov.io/gh/unjs/pkg-types)
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
Node.js utilities and TypeScript definitions for `package.json` and `tsconfig.json`.
|
||||
|
||||
## Install
|
||||
|
||||
<!-- automd:pm-i -->
|
||||
|
||||
```sh
|
||||
# ✨ Auto-detect
|
||||
npx nypm install pkg-types
|
||||
|
||||
# npm
|
||||
npm install pkg-types
|
||||
|
||||
# yarn
|
||||
yarn add pkg-types
|
||||
|
||||
# pnpm
|
||||
pnpm install pkg-types
|
||||
|
||||
# bun
|
||||
bun install pkg-types
|
||||
|
||||
# deno
|
||||
deno install pkg-types
|
||||
```
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
## Usage
|
||||
|
||||
### `readPackageJSON`
|
||||
|
||||
```js
|
||||
import { readPackageJSON } from "pkg-types";
|
||||
const localPackageJson = await readPackageJSON();
|
||||
// or
|
||||
const packageJson = await readPackageJSON("/fully/resolved/path/to/folder");
|
||||
```
|
||||
|
||||
### `writePackageJSON`
|
||||
|
||||
```js
|
||||
import { writePackageJSON } from "pkg-types";
|
||||
|
||||
await writePackageJSON("path/to/package.json", pkg);
|
||||
```
|
||||
|
||||
### `resolvePackageJSON`
|
||||
|
||||
```js
|
||||
import { resolvePackageJSON } from "pkg-types";
|
||||
const filename = await resolvePackageJSON();
|
||||
// or
|
||||
const packageJson = await resolvePackageJSON("/fully/resolved/path/to/folder");
|
||||
```
|
||||
|
||||
### `readTSConfig`
|
||||
|
||||
```js
|
||||
import { readTSConfig } from "pkg-types";
|
||||
const tsconfig = await readTSConfig();
|
||||
// or
|
||||
const tsconfig2 = await readTSConfig("/fully/resolved/path/to/folder");
|
||||
```
|
||||
|
||||
### `writeTSConfig`
|
||||
|
||||
```js
|
||||
import { writeTSConfig } from "pkg-types";
|
||||
|
||||
await writeTSConfig("path/to/tsconfig.json", tsconfig);
|
||||
```
|
||||
|
||||
### `resolveTSConfig`
|
||||
|
||||
```js
|
||||
import { resolveTSConfig } from "pkg-types";
|
||||
const filename = await resolveTSConfig();
|
||||
// or
|
||||
const tsconfig = await resolveTSConfig("/fully/resolved/path/to/folder");
|
||||
```
|
||||
|
||||
### `resolveFile`
|
||||
|
||||
```js
|
||||
import { resolveFile } from "pkg-types";
|
||||
const filename = await resolveFile("README.md", {
|
||||
startingFrom: id,
|
||||
rootPattern: /^node_modules$/,
|
||||
matcher: (filename) => filename.endsWith(".md"),
|
||||
});
|
||||
```
|
||||
|
||||
### `resolveLockFile`
|
||||
|
||||
Find path to the lock file (`yarn.lock`, `package-lock.json`, `pnpm-lock.yaml`, `npm-shrinkwrap.json`) or throws an error.
|
||||
|
||||
```js
|
||||
import { resolveLockFile } from "pkg-types";
|
||||
const lockfile = await resolveLockFile(".");
|
||||
```
|
||||
|
||||
### `findWorkspaceDir`
|
||||
|
||||
Try to detect workspace dir by in order:
|
||||
|
||||
1. Nearest `.git` directory
|
||||
2. Farthest lockfile
|
||||
3. Farthest `package.json` file
|
||||
|
||||
If fails, throws an error.
|
||||
|
||||
```js
|
||||
import { findWorkspaceDir } from "pkg-types";
|
||||
const workspaceDir = await findWorkspaceDir(".");
|
||||
```
|
||||
|
||||
## Types
|
||||
|
||||
**Note:** In order to make types working, you need to install `typescript` as a devDependency.
|
||||
|
||||
You can directly use typed interfaces:
|
||||
|
||||
```ts
|
||||
import type { TSConfig, PackageJSON } from "pkg-types";
|
||||
```
|
||||
|
||||
You can also use define utils for type support for using in plain `.js` files and auto-complete in IDE.
|
||||
|
||||
```js
|
||||
import type { definePackageJSON } from 'pkg-types'
|
||||
|
||||
const pkg = definePackageJSON({})
|
||||
```
|
||||
|
||||
```js
|
||||
import type { defineTSConfig } from 'pkg-types'
|
||||
|
||||
const pkg = defineTSConfig({})
|
||||
```
|
||||
|
||||
## Alternatives
|
||||
|
||||
- [dominikg/tsconfck](https://github.com/dominikg/tsconfck)
|
||||
|
||||
## License
|
||||
|
||||
<!-- automd:contributors license=MIT author="pi0,danielroe" -->
|
||||
|
||||
Published under the [MIT](https://github.com/unjs/pkg-types/blob/main/LICENSE) license.
|
||||
Made by [@pi0](https://github.com/pi0), [@danielroe](https://github.com/danielroe) and [community](https://github.com/unjs/pkg-types/graphs/contributors) 💛
|
||||
<br><br>
|
||||
<a href="https://github.com/unjs/pkg-types/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=unjs/pkg-types" />
|
||||
</a>
|
||||
|
||||
<!-- /automd -->
|
||||
171
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.cjs
generated
vendored
Normal file
171
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
'use strict';
|
||||
|
||||
const node_fs = require('node:fs');
|
||||
const pathe = require('pathe');
|
||||
const mlly = require('mlly');
|
||||
const confbox = require('confbox');
|
||||
|
||||
const defaultFindOptions = {
|
||||
startingFrom: ".",
|
||||
rootPattern: /^node_modules$/,
|
||||
reverse: false,
|
||||
test: (filePath) => {
|
||||
try {
|
||||
if (node_fs.statSync(filePath).isFile()) {
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
};
|
||||
async function findFile(filename, _options = {}) {
|
||||
const filenames = Array.isArray(filename) ? filename : [filename];
|
||||
const options = { ...defaultFindOptions, ..._options };
|
||||
const basePath = pathe.resolve(options.startingFrom);
|
||||
const leadingSlash = basePath[0] === "/";
|
||||
const segments = basePath.split("/").filter(Boolean);
|
||||
if (leadingSlash) {
|
||||
segments[0] = "/" + segments[0];
|
||||
}
|
||||
let root = segments.findIndex((r) => r.match(options.rootPattern));
|
||||
if (root === -1) {
|
||||
root = 0;
|
||||
}
|
||||
if (options.reverse) {
|
||||
for (let index = root + 1; index <= segments.length; index++) {
|
||||
for (const filename2 of filenames) {
|
||||
const filePath = pathe.join(...segments.slice(0, index), filename2);
|
||||
if (await options.test(filePath)) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let index = segments.length; index > root; index--) {
|
||||
for (const filename2 of filenames) {
|
||||
const filePath = pathe.join(...segments.slice(0, index), filename2);
|
||||
if (await options.test(filePath)) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`
|
||||
);
|
||||
}
|
||||
function findNearestFile(filename, _options = {}) {
|
||||
return findFile(filename, _options);
|
||||
}
|
||||
function findFarthestFile(filename, _options = {}) {
|
||||
return findFile(filename, { ..._options, reverse: true });
|
||||
}
|
||||
|
||||
function definePackageJSON(package_) {
|
||||
return package_;
|
||||
}
|
||||
function defineTSConfig(tsconfig) {
|
||||
return tsconfig;
|
||||
}
|
||||
const FileCache = /* @__PURE__ */ new Map();
|
||||
async function readPackageJSON(id, options = {}) {
|
||||
const resolvedPath = await resolvePackageJSON(id, options);
|
||||
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
||||
if (options.cache && cache.has(resolvedPath)) {
|
||||
return cache.get(resolvedPath);
|
||||
}
|
||||
const blob = await node_fs.promises.readFile(resolvedPath, "utf8");
|
||||
let parsed;
|
||||
try {
|
||||
parsed = confbox.parseJSON(blob);
|
||||
} catch {
|
||||
parsed = confbox.parseJSONC(blob);
|
||||
}
|
||||
cache.set(resolvedPath, parsed);
|
||||
return parsed;
|
||||
}
|
||||
async function writePackageJSON(path, package_) {
|
||||
await node_fs.promises.writeFile(path, confbox.stringifyJSON(package_));
|
||||
}
|
||||
async function readTSConfig(id, options = {}) {
|
||||
const resolvedPath = await resolveTSConfig(id, options);
|
||||
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
||||
if (options.cache && cache.has(resolvedPath)) {
|
||||
return cache.get(resolvedPath);
|
||||
}
|
||||
const text = await node_fs.promises.readFile(resolvedPath, "utf8");
|
||||
const parsed = confbox.parseJSONC(text);
|
||||
cache.set(resolvedPath, parsed);
|
||||
return parsed;
|
||||
}
|
||||
async function writeTSConfig(path, tsconfig) {
|
||||
await node_fs.promises.writeFile(path, confbox.stringifyJSONC(tsconfig));
|
||||
}
|
||||
async function resolvePackageJSON(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = pathe.isAbsolute(id) ? id : await mlly.resolvePath(id, options);
|
||||
return findNearestFile("package.json", {
|
||||
startingFrom: resolvedPath,
|
||||
...options
|
||||
});
|
||||
}
|
||||
async function resolveTSConfig(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = pathe.isAbsolute(id) ? id : await mlly.resolvePath(id, options);
|
||||
return findNearestFile("tsconfig.json", {
|
||||
startingFrom: resolvedPath,
|
||||
...options
|
||||
});
|
||||
}
|
||||
const lockFiles = [
|
||||
"yarn.lock",
|
||||
"package-lock.json",
|
||||
"pnpm-lock.yaml",
|
||||
"npm-shrinkwrap.json",
|
||||
"bun.lockb",
|
||||
"bun.lock"
|
||||
];
|
||||
async function resolveLockfile(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = pathe.isAbsolute(id) ? id : await mlly.resolvePath(id, options);
|
||||
const _options = { startingFrom: resolvedPath, ...options };
|
||||
try {
|
||||
return await findNearestFile(lockFiles, _options);
|
||||
} catch {
|
||||
}
|
||||
throw new Error("No lockfile found from " + id);
|
||||
}
|
||||
async function findWorkspaceDir(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = pathe.isAbsolute(id) ? id : await mlly.resolvePath(id, options);
|
||||
const _options = { startingFrom: resolvedPath, ...options };
|
||||
try {
|
||||
const r = await findNearestFile(".git/config", _options);
|
||||
return pathe.resolve(r, "../..");
|
||||
} catch {
|
||||
}
|
||||
try {
|
||||
const r = await resolveLockfile(resolvedPath, {
|
||||
..._options,
|
||||
reverse: true
|
||||
});
|
||||
return pathe.dirname(r);
|
||||
} catch {
|
||||
}
|
||||
try {
|
||||
const r = await findFile(resolvedPath, _options);
|
||||
return pathe.dirname(r);
|
||||
} catch {
|
||||
}
|
||||
throw new Error("Cannot detect workspace root from " + id);
|
||||
}
|
||||
|
||||
exports.definePackageJSON = definePackageJSON;
|
||||
exports.defineTSConfig = defineTSConfig;
|
||||
exports.findFarthestFile = findFarthestFile;
|
||||
exports.findFile = findFile;
|
||||
exports.findNearestFile = findNearestFile;
|
||||
exports.findWorkspaceDir = findWorkspaceDir;
|
||||
exports.readPackageJSON = readPackageJSON;
|
||||
exports.readTSConfig = readTSConfig;
|
||||
exports.resolveLockfile = resolveLockfile;
|
||||
exports.resolvePackageJSON = resolvePackageJSON;
|
||||
exports.resolveTSConfig = resolveTSConfig;
|
||||
exports.writePackageJSON = writePackageJSON;
|
||||
exports.writeTSConfig = writeTSConfig;
|
||||
411
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.d.cts
generated
vendored
Normal file
411
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,411 @@
|
|||
import { ResolveOptions as ResolveOptions$1 } from 'mlly';
|
||||
import { CompilerOptions, TypeAcquisition } from 'typescript';
|
||||
|
||||
interface FindFileOptions {
|
||||
/**
|
||||
* The starting directory for the search.
|
||||
* @default . (same as `process.cwd()`)
|
||||
*/
|
||||
startingFrom?: string;
|
||||
/**
|
||||
* A pattern to match a path segment above which you don't want to ascend
|
||||
* @default /^node_modules$/
|
||||
*/
|
||||
rootPattern?: RegExp;
|
||||
/**
|
||||
* If true, search starts from root level descending into subdirectories
|
||||
*/
|
||||
reverse?: boolean;
|
||||
/**
|
||||
* A matcher that can evaluate whether the given path is a valid file (for example,
|
||||
* by testing whether the file path exists.
|
||||
*
|
||||
* @default fs.statSync(path).isFile()
|
||||
*/
|
||||
test?: (filePath: string) => boolean | undefined | Promise<boolean | undefined>;
|
||||
}
|
||||
/** @deprecated */
|
||||
type FindNearestFileOptions = FindFileOptions;
|
||||
/**
|
||||
* Asynchronously finds a file by name, starting from the specified directory and traversing up (or down if reverse).
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour.
|
||||
* @returns a promise that resolves to the path of the file found.
|
||||
* @throws Will throw an error if the file cannot be found.
|
||||
*/
|
||||
declare function findFile(filename: string | string[], _options?: FindFileOptions): Promise<string>;
|
||||
/**
|
||||
* Asynchronously finds the next file with the given name, starting in the given directory and moving up.
|
||||
* Alias for findFile without reversing the search.
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour.
|
||||
* @returns A promise that resolves to the path of the next file found.
|
||||
*/
|
||||
declare function findNearestFile(filename: string | string[], _options?: FindFileOptions): Promise<string>;
|
||||
/**
|
||||
* Asynchronously finds the furthest file with the given name, starting from the root directory and moving downwards.
|
||||
* This is essentially the reverse of `findNearestFile'.
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour, with reverse set to true.
|
||||
* @returns A promise that resolves to the path of the farthest file found.
|
||||
*/
|
||||
declare function findFarthestFile(filename: string, _options?: FindFileOptions): Promise<string>;
|
||||
|
||||
type StripEnums<T extends Record<string, any>> = {
|
||||
[K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any;
|
||||
};
|
||||
interface TSConfig {
|
||||
compilerOptions?: StripEnums<CompilerOptions>;
|
||||
exclude?: string[];
|
||||
compileOnSave?: boolean;
|
||||
extends?: string | string[];
|
||||
files?: string[];
|
||||
include?: string[];
|
||||
typeAcquisition?: TypeAcquisition;
|
||||
references?: {
|
||||
path: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
interface PackageJson {
|
||||
/**
|
||||
* The name is what your thing is called.
|
||||
* Some rules:
|
||||
* - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
|
||||
* - The name can’t start with a dot or an underscore.
|
||||
* - New packages must not have uppercase letters in the name.
|
||||
* - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can’t contain any non-URL-safe characters.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
|
||||
*/
|
||||
version?: string;
|
||||
/**
|
||||
* Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
|
||||
*/
|
||||
keywords?: string[];
|
||||
/**
|
||||
* The url to the project homepage.
|
||||
*/
|
||||
homepage?: string;
|
||||
/**
|
||||
* The url to your project’s issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
|
||||
*/
|
||||
bugs?: string | {
|
||||
url?: string;
|
||||
email?: string;
|
||||
};
|
||||
/**
|
||||
* You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
|
||||
*/
|
||||
license?: string;
|
||||
/**
|
||||
* Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
|
||||
* For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
|
||||
*/
|
||||
repository?: string | {
|
||||
type: string;
|
||||
url: string;
|
||||
/**
|
||||
* If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
|
||||
*/
|
||||
directory?: string;
|
||||
};
|
||||
/**
|
||||
* The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
|
||||
*/
|
||||
scripts?: Record<string, string>;
|
||||
/**
|
||||
* If you set `"private": true` in your package.json, then npm will refuse to publish it.
|
||||
*/
|
||||
private?: boolean;
|
||||
/**
|
||||
* The “author” is one person.
|
||||
*/
|
||||
author?: PackageJsonPerson;
|
||||
/**
|
||||
* “contributors” is an array of people.
|
||||
*/
|
||||
contributors?: PackageJsonPerson[];
|
||||
/**
|
||||
* The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**\/*`, and such) will make it so that file is included in the tarball when it’s packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
|
||||
*/
|
||||
files?: string[];
|
||||
/**
|
||||
* The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module’s exports object will be returned.
|
||||
* This should be a module ID relative to the root of your package folder.
|
||||
* For most modules, it makes the most sense to have a main script and often not much else.
|
||||
*/
|
||||
main?: string;
|
||||
/**
|
||||
* If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
|
||||
*/
|
||||
browser?: string | Record<string, string | false>;
|
||||
/**
|
||||
* The `unpkg` field is used to specify the URL to a UMD module for your package. This is used by default in the unpkg.com CDN service.
|
||||
*/
|
||||
unpkg?: string;
|
||||
/**
|
||||
* A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
|
||||
*/
|
||||
bin?: string | Record<string, string>;
|
||||
/**
|
||||
* Specify either a single file or an array of filenames to put in place for the `man` program to find.
|
||||
*/
|
||||
man?: string | string[];
|
||||
/**
|
||||
* Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
|
||||
*/
|
||||
dependencies?: Record<string, string>;
|
||||
/**
|
||||
* If someone is planning on downloading and using your module in their program, then they probably don’t want or need to download and build the external test or documentation framework that you use.
|
||||
* In this case, it’s best to map these additional items in a `devDependencies` object.
|
||||
*/
|
||||
devDependencies?: Record<string, string>;
|
||||
/**
|
||||
* If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail.
|
||||
*/
|
||||
optionalDependencies?: Record<string, string>;
|
||||
/**
|
||||
* In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
|
||||
*/
|
||||
peerDependencies?: Record<string, string>;
|
||||
/**
|
||||
* TypeScript typings, typically ending by `.d.ts`.
|
||||
*/
|
||||
types?: string;
|
||||
/**
|
||||
* This field is synonymous with `types`.
|
||||
*/
|
||||
typings?: string;
|
||||
/**
|
||||
* Non-Standard Node.js alternate entry-point to main.
|
||||
* An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
|
||||
*/
|
||||
module?: string;
|
||||
/**
|
||||
* Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
|
||||
*
|
||||
* Docs:
|
||||
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
|
||||
*
|
||||
* @default 'commonjs'
|
||||
* @since Node.js v14
|
||||
*/
|
||||
type?: "module" | "commonjs";
|
||||
/**
|
||||
* Alternate and extensible alternative to "main" entry point.
|
||||
*
|
||||
* When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
|
||||
*
|
||||
* Docs:
|
||||
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
|
||||
*
|
||||
* @since Node.js v12.7
|
||||
*/
|
||||
exports?: PackageJsonExports;
|
||||
/**
|
||||
* Docs:
|
||||
* - https://nodejs.org/api/packages.html#imports
|
||||
*/
|
||||
imports?: Record<string, string | Record<string, string>>;
|
||||
/**
|
||||
* The field is used to define a set of sub-packages (or workspaces) within a monorepo.
|
||||
*
|
||||
* This field is an array of glob patterns or an object with specific configurations for managing
|
||||
* multiple packages in a single repository.
|
||||
*/
|
||||
workspaces?: string[];
|
||||
/**
|
||||
* The field is is used to specify different TypeScript declaration files for
|
||||
* different versions of TypeScript, allowing for version-specific type definitions.
|
||||
*/
|
||||
typesVersions?: Record<string, Record<string, string[]>>;
|
||||
/**
|
||||
* You can specify which operating systems your module will run on:
|
||||
* ```json
|
||||
* {
|
||||
* "os": ["darwin", "linux"]
|
||||
* }
|
||||
* ```
|
||||
* You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
|
||||
* ```json
|
||||
* {
|
||||
* "os": ["!win32"]
|
||||
* }
|
||||
* ```
|
||||
* The host operating system is determined by `process.platform`
|
||||
* It is allowed to both block and allow an item, although there isn't any good reason to do this.
|
||||
*/
|
||||
os?: string[];
|
||||
/**
|
||||
* If your code only runs on certain cpu architectures, you can specify which ones.
|
||||
* ```json
|
||||
* {
|
||||
* "cpu": ["x64", "ia32"]
|
||||
* }
|
||||
* ```
|
||||
* Like the `os` option, you can also block architectures:
|
||||
* ```json
|
||||
* {
|
||||
* "cpu": ["!arm", "!mips"]
|
||||
* }
|
||||
* ```
|
||||
* The host architecture is determined by `process.arch`
|
||||
*/
|
||||
cpu?: string[];
|
||||
/**
|
||||
* This is a set of config values that will be used at publish-time.
|
||||
*/
|
||||
publishConfig?: {
|
||||
/**
|
||||
* The registry that will be used if the package is published.
|
||||
*/
|
||||
registry?: string;
|
||||
/**
|
||||
* The tag that will be used if the package is published.
|
||||
*/
|
||||
tag?: string;
|
||||
/**
|
||||
* The access level that will be used if the package is published.
|
||||
*/
|
||||
access?: "public" | "restricted";
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* By default, for portability reasons, no files except those listed in
|
||||
* the bin field will be marked as executable in the resulting package
|
||||
* archive. The executableFiles field lets you declare additional fields
|
||||
* that must have the executable flag (+x) set even if
|
||||
* they aren't directly accessible through the bin field.
|
||||
*/
|
||||
executableFiles?: string[];
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* You also can use the field `publishConfig.directory` to customize
|
||||
* the published subdirectory relative to the current `package.json`.
|
||||
*
|
||||
* It is expected to have a modified version of the current package in
|
||||
* the specified directory (usually using third party build tools).
|
||||
*/
|
||||
directory?: string;
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* When set to `true`, the project will be symlinked from the
|
||||
* `publishConfig.directory` location during local development.
|
||||
* @default true
|
||||
*/
|
||||
linkDirectory?: boolean;
|
||||
} & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
|
||||
/**
|
||||
* See: https://nodejs.org/api/packages.html#packagemanager
|
||||
* This field defines which package manager is expected to be used when working on the current project.
|
||||
* Should be of the format: `<name>@<version>[#hash]`
|
||||
*/
|
||||
packageManager?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
/**
|
||||
* A “person” is an object with a “name” field and optionally “url” and “email”. Or you can shorten that all into a single string, and npm will parse it for you.
|
||||
*/
|
||||
type PackageJsonPerson = string | {
|
||||
name: string;
|
||||
email?: string;
|
||||
url?: string;
|
||||
};
|
||||
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
||||
type PackageJsonExportsObject = {
|
||||
[P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
||||
};
|
||||
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
||||
|
||||
/**
|
||||
* Represents the options for resolving paths with additional file finding capabilities.
|
||||
*/
|
||||
type ResolveOptions = ResolveOptions$1 & FindFileOptions;
|
||||
/**
|
||||
* Options for reading files with optional caching.
|
||||
*/
|
||||
type ReadOptions = {
|
||||
/**
|
||||
* Specifies whether the read results should be cached.
|
||||
* Can be a boolean or a map to hold the cached data.
|
||||
*/
|
||||
cache?: boolean | Map<string, Record<string, any>>;
|
||||
};
|
||||
/**
|
||||
* Defines a PackageJson structure.
|
||||
* @param package_ - The `package.json` content as an object. See {@link PackageJson}.
|
||||
* @returns the same `package.json` object.
|
||||
*/
|
||||
declare function definePackageJSON(package_: PackageJson): PackageJson;
|
||||
/**
|
||||
* Defines a TSConfig structure.
|
||||
* @param tsconfig - The contents of `tsconfig.json` as an object. See {@link TSConfig}.
|
||||
* @returns the same `tsconfig.json` object.
|
||||
*/
|
||||
declare function defineTSConfig(tsconfig: TSConfig): TSConfig;
|
||||
/**
|
||||
* Asynchronously reads a `package.json` file.
|
||||
* @param id - The path identifier for the package.json, defaults to the current working directory.
|
||||
* @param options - The options for resolving and reading the file. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the parsed `package.json` object.
|
||||
*/
|
||||
declare function readPackageJSON(id?: string, options?: ResolveOptions & ReadOptions): Promise<PackageJson>;
|
||||
/**
|
||||
* Asynchronously writes data to a `package.json` file.
|
||||
* @param path - The path to the file where the `package.json` is written.
|
||||
* @param package_ - The `package.json` object to write. See {@link PackageJson}.
|
||||
*/
|
||||
declare function writePackageJSON(path: string, package_: PackageJson): Promise<void>;
|
||||
/**
|
||||
* Asynchronously reads a `tsconfig.json` file.
|
||||
* @param id - The path to the `tsconfig.json` file, defaults to the current working directory.
|
||||
* @param options - The options for resolving and reading the file. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the parsed `tsconfig.json` object.
|
||||
*/
|
||||
declare function readTSConfig(id?: string, options?: ResolveOptions & ReadOptions): Promise<TSConfig>;
|
||||
/**
|
||||
* Asynchronously writes data to a `tsconfig.json` file.
|
||||
* @param path - The path to the file where the `tsconfig.json` is written.
|
||||
* @param tsconfig - The `tsconfig.json` object to write. See {@link TSConfig}.
|
||||
*/
|
||||
declare function writeTSConfig(path: string, tsconfig: TSConfig): Promise<void>;
|
||||
/**
|
||||
* Resolves the path to the nearest `package.json` file from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest `package.json` file.
|
||||
*/
|
||||
declare function resolvePackageJSON(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves the path to the nearest `tsconfig.json` file from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest `tsconfig.json` file.
|
||||
*/
|
||||
declare function resolveTSConfig(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves the path to the nearest lockfile from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest lockfile.
|
||||
*/
|
||||
declare function resolveLockfile(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Detects the workspace directory based on common project markers (`.git`, lockfiles, `package.json`).
|
||||
* Throws an error if the workspace root cannot be detected.
|
||||
* @param id - The base path to search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the path of the detected workspace directory.
|
||||
*/
|
||||
declare function findWorkspaceDir(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
|
||||
export { type FindFileOptions, type FindNearestFileOptions, type PackageJson, type PackageJsonExports, type PackageJsonPerson, type ReadOptions, type ResolveOptions, type StripEnums, type TSConfig, definePackageJSON, defineTSConfig, findFarthestFile, findFile, findNearestFile, findWorkspaceDir, readPackageJSON, readTSConfig, resolveLockfile, resolvePackageJSON, resolveTSConfig, writePackageJSON, writeTSConfig };
|
||||
411
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.d.mts
generated
vendored
Normal file
411
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,411 @@
|
|||
import { ResolveOptions as ResolveOptions$1 } from 'mlly';
|
||||
import { CompilerOptions, TypeAcquisition } from 'typescript';
|
||||
|
||||
interface FindFileOptions {
|
||||
/**
|
||||
* The starting directory for the search.
|
||||
* @default . (same as `process.cwd()`)
|
||||
*/
|
||||
startingFrom?: string;
|
||||
/**
|
||||
* A pattern to match a path segment above which you don't want to ascend
|
||||
* @default /^node_modules$/
|
||||
*/
|
||||
rootPattern?: RegExp;
|
||||
/**
|
||||
* If true, search starts from root level descending into subdirectories
|
||||
*/
|
||||
reverse?: boolean;
|
||||
/**
|
||||
* A matcher that can evaluate whether the given path is a valid file (for example,
|
||||
* by testing whether the file path exists.
|
||||
*
|
||||
* @default fs.statSync(path).isFile()
|
||||
*/
|
||||
test?: (filePath: string) => boolean | undefined | Promise<boolean | undefined>;
|
||||
}
|
||||
/** @deprecated */
|
||||
type FindNearestFileOptions = FindFileOptions;
|
||||
/**
|
||||
* Asynchronously finds a file by name, starting from the specified directory and traversing up (or down if reverse).
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour.
|
||||
* @returns a promise that resolves to the path of the file found.
|
||||
* @throws Will throw an error if the file cannot be found.
|
||||
*/
|
||||
declare function findFile(filename: string | string[], _options?: FindFileOptions): Promise<string>;
|
||||
/**
|
||||
* Asynchronously finds the next file with the given name, starting in the given directory and moving up.
|
||||
* Alias for findFile without reversing the search.
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour.
|
||||
* @returns A promise that resolves to the path of the next file found.
|
||||
*/
|
||||
declare function findNearestFile(filename: string | string[], _options?: FindFileOptions): Promise<string>;
|
||||
/**
|
||||
* Asynchronously finds the furthest file with the given name, starting from the root directory and moving downwards.
|
||||
* This is essentially the reverse of `findNearestFile'.
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour, with reverse set to true.
|
||||
* @returns A promise that resolves to the path of the farthest file found.
|
||||
*/
|
||||
declare function findFarthestFile(filename: string, _options?: FindFileOptions): Promise<string>;
|
||||
|
||||
type StripEnums<T extends Record<string, any>> = {
|
||||
[K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any;
|
||||
};
|
||||
interface TSConfig {
|
||||
compilerOptions?: StripEnums<CompilerOptions>;
|
||||
exclude?: string[];
|
||||
compileOnSave?: boolean;
|
||||
extends?: string | string[];
|
||||
files?: string[];
|
||||
include?: string[];
|
||||
typeAcquisition?: TypeAcquisition;
|
||||
references?: {
|
||||
path: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
interface PackageJson {
|
||||
/**
|
||||
* The name is what your thing is called.
|
||||
* Some rules:
|
||||
* - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
|
||||
* - The name can’t start with a dot or an underscore.
|
||||
* - New packages must not have uppercase letters in the name.
|
||||
* - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can’t contain any non-URL-safe characters.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
|
||||
*/
|
||||
version?: string;
|
||||
/**
|
||||
* Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
|
||||
*/
|
||||
keywords?: string[];
|
||||
/**
|
||||
* The url to the project homepage.
|
||||
*/
|
||||
homepage?: string;
|
||||
/**
|
||||
* The url to your project’s issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
|
||||
*/
|
||||
bugs?: string | {
|
||||
url?: string;
|
||||
email?: string;
|
||||
};
|
||||
/**
|
||||
* You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
|
||||
*/
|
||||
license?: string;
|
||||
/**
|
||||
* Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
|
||||
* For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
|
||||
*/
|
||||
repository?: string | {
|
||||
type: string;
|
||||
url: string;
|
||||
/**
|
||||
* If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
|
||||
*/
|
||||
directory?: string;
|
||||
};
|
||||
/**
|
||||
* The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
|
||||
*/
|
||||
scripts?: Record<string, string>;
|
||||
/**
|
||||
* If you set `"private": true` in your package.json, then npm will refuse to publish it.
|
||||
*/
|
||||
private?: boolean;
|
||||
/**
|
||||
* The “author” is one person.
|
||||
*/
|
||||
author?: PackageJsonPerson;
|
||||
/**
|
||||
* “contributors” is an array of people.
|
||||
*/
|
||||
contributors?: PackageJsonPerson[];
|
||||
/**
|
||||
* The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**\/*`, and such) will make it so that file is included in the tarball when it’s packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
|
||||
*/
|
||||
files?: string[];
|
||||
/**
|
||||
* The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module’s exports object will be returned.
|
||||
* This should be a module ID relative to the root of your package folder.
|
||||
* For most modules, it makes the most sense to have a main script and often not much else.
|
||||
*/
|
||||
main?: string;
|
||||
/**
|
||||
* If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
|
||||
*/
|
||||
browser?: string | Record<string, string | false>;
|
||||
/**
|
||||
* The `unpkg` field is used to specify the URL to a UMD module for your package. This is used by default in the unpkg.com CDN service.
|
||||
*/
|
||||
unpkg?: string;
|
||||
/**
|
||||
* A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
|
||||
*/
|
||||
bin?: string | Record<string, string>;
|
||||
/**
|
||||
* Specify either a single file or an array of filenames to put in place for the `man` program to find.
|
||||
*/
|
||||
man?: string | string[];
|
||||
/**
|
||||
* Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
|
||||
*/
|
||||
dependencies?: Record<string, string>;
|
||||
/**
|
||||
* If someone is planning on downloading and using your module in their program, then they probably don’t want or need to download and build the external test or documentation framework that you use.
|
||||
* In this case, it’s best to map these additional items in a `devDependencies` object.
|
||||
*/
|
||||
devDependencies?: Record<string, string>;
|
||||
/**
|
||||
* If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail.
|
||||
*/
|
||||
optionalDependencies?: Record<string, string>;
|
||||
/**
|
||||
* In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
|
||||
*/
|
||||
peerDependencies?: Record<string, string>;
|
||||
/**
|
||||
* TypeScript typings, typically ending by `.d.ts`.
|
||||
*/
|
||||
types?: string;
|
||||
/**
|
||||
* This field is synonymous with `types`.
|
||||
*/
|
||||
typings?: string;
|
||||
/**
|
||||
* Non-Standard Node.js alternate entry-point to main.
|
||||
* An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
|
||||
*/
|
||||
module?: string;
|
||||
/**
|
||||
* Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
|
||||
*
|
||||
* Docs:
|
||||
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
|
||||
*
|
||||
* @default 'commonjs'
|
||||
* @since Node.js v14
|
||||
*/
|
||||
type?: "module" | "commonjs";
|
||||
/**
|
||||
* Alternate and extensible alternative to "main" entry point.
|
||||
*
|
||||
* When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
|
||||
*
|
||||
* Docs:
|
||||
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
|
||||
*
|
||||
* @since Node.js v12.7
|
||||
*/
|
||||
exports?: PackageJsonExports;
|
||||
/**
|
||||
* Docs:
|
||||
* - https://nodejs.org/api/packages.html#imports
|
||||
*/
|
||||
imports?: Record<string, string | Record<string, string>>;
|
||||
/**
|
||||
* The field is used to define a set of sub-packages (or workspaces) within a monorepo.
|
||||
*
|
||||
* This field is an array of glob patterns or an object with specific configurations for managing
|
||||
* multiple packages in a single repository.
|
||||
*/
|
||||
workspaces?: string[];
|
||||
/**
|
||||
* The field is is used to specify different TypeScript declaration files for
|
||||
* different versions of TypeScript, allowing for version-specific type definitions.
|
||||
*/
|
||||
typesVersions?: Record<string, Record<string, string[]>>;
|
||||
/**
|
||||
* You can specify which operating systems your module will run on:
|
||||
* ```json
|
||||
* {
|
||||
* "os": ["darwin", "linux"]
|
||||
* }
|
||||
* ```
|
||||
* You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
|
||||
* ```json
|
||||
* {
|
||||
* "os": ["!win32"]
|
||||
* }
|
||||
* ```
|
||||
* The host operating system is determined by `process.platform`
|
||||
* It is allowed to both block and allow an item, although there isn't any good reason to do this.
|
||||
*/
|
||||
os?: string[];
|
||||
/**
|
||||
* If your code only runs on certain cpu architectures, you can specify which ones.
|
||||
* ```json
|
||||
* {
|
||||
* "cpu": ["x64", "ia32"]
|
||||
* }
|
||||
* ```
|
||||
* Like the `os` option, you can also block architectures:
|
||||
* ```json
|
||||
* {
|
||||
* "cpu": ["!arm", "!mips"]
|
||||
* }
|
||||
* ```
|
||||
* The host architecture is determined by `process.arch`
|
||||
*/
|
||||
cpu?: string[];
|
||||
/**
|
||||
* This is a set of config values that will be used at publish-time.
|
||||
*/
|
||||
publishConfig?: {
|
||||
/**
|
||||
* The registry that will be used if the package is published.
|
||||
*/
|
||||
registry?: string;
|
||||
/**
|
||||
* The tag that will be used if the package is published.
|
||||
*/
|
||||
tag?: string;
|
||||
/**
|
||||
* The access level that will be used if the package is published.
|
||||
*/
|
||||
access?: "public" | "restricted";
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* By default, for portability reasons, no files except those listed in
|
||||
* the bin field will be marked as executable in the resulting package
|
||||
* archive. The executableFiles field lets you declare additional fields
|
||||
* that must have the executable flag (+x) set even if
|
||||
* they aren't directly accessible through the bin field.
|
||||
*/
|
||||
executableFiles?: string[];
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* You also can use the field `publishConfig.directory` to customize
|
||||
* the published subdirectory relative to the current `package.json`.
|
||||
*
|
||||
* It is expected to have a modified version of the current package in
|
||||
* the specified directory (usually using third party build tools).
|
||||
*/
|
||||
directory?: string;
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* When set to `true`, the project will be symlinked from the
|
||||
* `publishConfig.directory` location during local development.
|
||||
* @default true
|
||||
*/
|
||||
linkDirectory?: boolean;
|
||||
} & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
|
||||
/**
|
||||
* See: https://nodejs.org/api/packages.html#packagemanager
|
||||
* This field defines which package manager is expected to be used when working on the current project.
|
||||
* Should be of the format: `<name>@<version>[#hash]`
|
||||
*/
|
||||
packageManager?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
/**
|
||||
* A “person” is an object with a “name” field and optionally “url” and “email”. Or you can shorten that all into a single string, and npm will parse it for you.
|
||||
*/
|
||||
type PackageJsonPerson = string | {
|
||||
name: string;
|
||||
email?: string;
|
||||
url?: string;
|
||||
};
|
||||
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
||||
type PackageJsonExportsObject = {
|
||||
[P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
||||
};
|
||||
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
||||
|
||||
/**
|
||||
* Represents the options for resolving paths with additional file finding capabilities.
|
||||
*/
|
||||
type ResolveOptions = ResolveOptions$1 & FindFileOptions;
|
||||
/**
|
||||
* Options for reading files with optional caching.
|
||||
*/
|
||||
type ReadOptions = {
|
||||
/**
|
||||
* Specifies whether the read results should be cached.
|
||||
* Can be a boolean or a map to hold the cached data.
|
||||
*/
|
||||
cache?: boolean | Map<string, Record<string, any>>;
|
||||
};
|
||||
/**
|
||||
* Defines a PackageJson structure.
|
||||
* @param package_ - The `package.json` content as an object. See {@link PackageJson}.
|
||||
* @returns the same `package.json` object.
|
||||
*/
|
||||
declare function definePackageJSON(package_: PackageJson): PackageJson;
|
||||
/**
|
||||
* Defines a TSConfig structure.
|
||||
* @param tsconfig - The contents of `tsconfig.json` as an object. See {@link TSConfig}.
|
||||
* @returns the same `tsconfig.json` object.
|
||||
*/
|
||||
declare function defineTSConfig(tsconfig: TSConfig): TSConfig;
|
||||
/**
|
||||
* Asynchronously reads a `package.json` file.
|
||||
* @param id - The path identifier for the package.json, defaults to the current working directory.
|
||||
* @param options - The options for resolving and reading the file. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the parsed `package.json` object.
|
||||
*/
|
||||
declare function readPackageJSON(id?: string, options?: ResolveOptions & ReadOptions): Promise<PackageJson>;
|
||||
/**
|
||||
* Asynchronously writes data to a `package.json` file.
|
||||
* @param path - The path to the file where the `package.json` is written.
|
||||
* @param package_ - The `package.json` object to write. See {@link PackageJson}.
|
||||
*/
|
||||
declare function writePackageJSON(path: string, package_: PackageJson): Promise<void>;
|
||||
/**
|
||||
* Asynchronously reads a `tsconfig.json` file.
|
||||
* @param id - The path to the `tsconfig.json` file, defaults to the current working directory.
|
||||
* @param options - The options for resolving and reading the file. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the parsed `tsconfig.json` object.
|
||||
*/
|
||||
declare function readTSConfig(id?: string, options?: ResolveOptions & ReadOptions): Promise<TSConfig>;
|
||||
/**
|
||||
* Asynchronously writes data to a `tsconfig.json` file.
|
||||
* @param path - The path to the file where the `tsconfig.json` is written.
|
||||
* @param tsconfig - The `tsconfig.json` object to write. See {@link TSConfig}.
|
||||
*/
|
||||
declare function writeTSConfig(path: string, tsconfig: TSConfig): Promise<void>;
|
||||
/**
|
||||
* Resolves the path to the nearest `package.json` file from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest `package.json` file.
|
||||
*/
|
||||
declare function resolvePackageJSON(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves the path to the nearest `tsconfig.json` file from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest `tsconfig.json` file.
|
||||
*/
|
||||
declare function resolveTSConfig(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves the path to the nearest lockfile from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest lockfile.
|
||||
*/
|
||||
declare function resolveLockfile(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Detects the workspace directory based on common project markers (`.git`, lockfiles, `package.json`).
|
||||
* Throws an error if the workspace root cannot be detected.
|
||||
* @param id - The base path to search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the path of the detected workspace directory.
|
||||
*/
|
||||
declare function findWorkspaceDir(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
|
||||
export { type FindFileOptions, type FindNearestFileOptions, type PackageJson, type PackageJsonExports, type PackageJsonPerson, type ReadOptions, type ResolveOptions, type StripEnums, type TSConfig, definePackageJSON, defineTSConfig, findFarthestFile, findFile, findNearestFile, findWorkspaceDir, readPackageJSON, readTSConfig, resolveLockfile, resolvePackageJSON, resolveTSConfig, writePackageJSON, writeTSConfig };
|
||||
411
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.d.ts
generated
vendored
Normal file
411
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,411 @@
|
|||
import { ResolveOptions as ResolveOptions$1 } from 'mlly';
|
||||
import { CompilerOptions, TypeAcquisition } from 'typescript';
|
||||
|
||||
interface FindFileOptions {
|
||||
/**
|
||||
* The starting directory for the search.
|
||||
* @default . (same as `process.cwd()`)
|
||||
*/
|
||||
startingFrom?: string;
|
||||
/**
|
||||
* A pattern to match a path segment above which you don't want to ascend
|
||||
* @default /^node_modules$/
|
||||
*/
|
||||
rootPattern?: RegExp;
|
||||
/**
|
||||
* If true, search starts from root level descending into subdirectories
|
||||
*/
|
||||
reverse?: boolean;
|
||||
/**
|
||||
* A matcher that can evaluate whether the given path is a valid file (for example,
|
||||
* by testing whether the file path exists.
|
||||
*
|
||||
* @default fs.statSync(path).isFile()
|
||||
*/
|
||||
test?: (filePath: string) => boolean | undefined | Promise<boolean | undefined>;
|
||||
}
|
||||
/** @deprecated */
|
||||
type FindNearestFileOptions = FindFileOptions;
|
||||
/**
|
||||
* Asynchronously finds a file by name, starting from the specified directory and traversing up (or down if reverse).
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour.
|
||||
* @returns a promise that resolves to the path of the file found.
|
||||
* @throws Will throw an error if the file cannot be found.
|
||||
*/
|
||||
declare function findFile(filename: string | string[], _options?: FindFileOptions): Promise<string>;
|
||||
/**
|
||||
* Asynchronously finds the next file with the given name, starting in the given directory and moving up.
|
||||
* Alias for findFile without reversing the search.
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour.
|
||||
* @returns A promise that resolves to the path of the next file found.
|
||||
*/
|
||||
declare function findNearestFile(filename: string | string[], _options?: FindFileOptions): Promise<string>;
|
||||
/**
|
||||
* Asynchronously finds the furthest file with the given name, starting from the root directory and moving downwards.
|
||||
* This is essentially the reverse of `findNearestFile'.
|
||||
* @param filename - The name of the file to find.
|
||||
* @param _options - Options to customise the search behaviour, with reverse set to true.
|
||||
* @returns A promise that resolves to the path of the farthest file found.
|
||||
*/
|
||||
declare function findFarthestFile(filename: string, _options?: FindFileOptions): Promise<string>;
|
||||
|
||||
type StripEnums<T extends Record<string, any>> = {
|
||||
[K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any;
|
||||
};
|
||||
interface TSConfig {
|
||||
compilerOptions?: StripEnums<CompilerOptions>;
|
||||
exclude?: string[];
|
||||
compileOnSave?: boolean;
|
||||
extends?: string | string[];
|
||||
files?: string[];
|
||||
include?: string[];
|
||||
typeAcquisition?: TypeAcquisition;
|
||||
references?: {
|
||||
path: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
interface PackageJson {
|
||||
/**
|
||||
* The name is what your thing is called.
|
||||
* Some rules:
|
||||
* - The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
|
||||
* - The name can’t start with a dot or an underscore.
|
||||
* - New packages must not have uppercase letters in the name.
|
||||
* - The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can’t contain any non-URL-safe characters.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Version must be parseable by `node-semver`, which is bundled with npm as a dependency. (`npm install semver` to use it yourself.)
|
||||
*/
|
||||
version?: string;
|
||||
/**
|
||||
* Put a description in it. It’s a string. This helps people discover your package, as it’s listed in `npm search`.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Put keywords in it. It’s an array of strings. This helps people discover your package as it’s listed in `npm search`.
|
||||
*/
|
||||
keywords?: string[];
|
||||
/**
|
||||
* The url to the project homepage.
|
||||
*/
|
||||
homepage?: string;
|
||||
/**
|
||||
* The url to your project’s issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
|
||||
*/
|
||||
bugs?: string | {
|
||||
url?: string;
|
||||
email?: string;
|
||||
};
|
||||
/**
|
||||
* You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you’re placing on it.
|
||||
*/
|
||||
license?: string;
|
||||
/**
|
||||
* Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you.
|
||||
* For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
|
||||
*/
|
||||
repository?: string | {
|
||||
type: string;
|
||||
url: string;
|
||||
/**
|
||||
* If the `package.json` for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:
|
||||
*/
|
||||
directory?: string;
|
||||
};
|
||||
/**
|
||||
* The `scripts` field is a dictionary containing script commands that are run at various times in the lifecycle of your package.
|
||||
*/
|
||||
scripts?: Record<string, string>;
|
||||
/**
|
||||
* If you set `"private": true` in your package.json, then npm will refuse to publish it.
|
||||
*/
|
||||
private?: boolean;
|
||||
/**
|
||||
* The “author” is one person.
|
||||
*/
|
||||
author?: PackageJsonPerson;
|
||||
/**
|
||||
* “contributors” is an array of people.
|
||||
*/
|
||||
contributors?: PackageJsonPerson[];
|
||||
/**
|
||||
* The optional `files` field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a similar syntax to `.gitignore`, but reversed: including a file, directory, or glob pattern (`*`, `**\/*`, and such) will make it so that file is included in the tarball when it’s packed. Omitting the field will make it default to `["*"]`, which means it will include all files.
|
||||
*/
|
||||
files?: string[];
|
||||
/**
|
||||
* The main field is a module ID that is the primary entry point to your program. That is, if your package is named `foo`, and a user installs it, and then does `require("foo")`, then your main module’s exports object will be returned.
|
||||
* This should be a module ID relative to the root of your package folder.
|
||||
* For most modules, it makes the most sense to have a main script and often not much else.
|
||||
*/
|
||||
main?: string;
|
||||
/**
|
||||
* If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren’t available in Node.js modules. (e.g. window)
|
||||
*/
|
||||
browser?: string | Record<string, string | false>;
|
||||
/**
|
||||
* The `unpkg` field is used to specify the URL to a UMD module for your package. This is used by default in the unpkg.com CDN service.
|
||||
*/
|
||||
unpkg?: string;
|
||||
/**
|
||||
* A map of command name to local file name. On install, npm will symlink that file into `prefix/bin` for global installs, or `./node_modules/.bin/` for local installs.
|
||||
*/
|
||||
bin?: string | Record<string, string>;
|
||||
/**
|
||||
* Specify either a single file or an array of filenames to put in place for the `man` program to find.
|
||||
*/
|
||||
man?: string | string[];
|
||||
/**
|
||||
* Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
|
||||
*/
|
||||
dependencies?: Record<string, string>;
|
||||
/**
|
||||
* If someone is planning on downloading and using your module in their program, then they probably don’t want or need to download and build the external test or documentation framework that you use.
|
||||
* In this case, it’s best to map these additional items in a `devDependencies` object.
|
||||
*/
|
||||
devDependencies?: Record<string, string>;
|
||||
/**
|
||||
* If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail.
|
||||
*/
|
||||
optionalDependencies?: Record<string, string>;
|
||||
/**
|
||||
* In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a `require` of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
|
||||
*/
|
||||
peerDependencies?: Record<string, string>;
|
||||
/**
|
||||
* TypeScript typings, typically ending by `.d.ts`.
|
||||
*/
|
||||
types?: string;
|
||||
/**
|
||||
* This field is synonymous with `types`.
|
||||
*/
|
||||
typings?: string;
|
||||
/**
|
||||
* Non-Standard Node.js alternate entry-point to main.
|
||||
* An initial implementation for supporting CJS packages (from main), and use module for ESM modules.
|
||||
*/
|
||||
module?: string;
|
||||
/**
|
||||
* Make main entry-point be loaded as an ESM module, support "export" syntax instead of "require"
|
||||
*
|
||||
* Docs:
|
||||
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_package_json_type_field
|
||||
*
|
||||
* @default 'commonjs'
|
||||
* @since Node.js v14
|
||||
*/
|
||||
type?: "module" | "commonjs";
|
||||
/**
|
||||
* Alternate and extensible alternative to "main" entry point.
|
||||
*
|
||||
* When using `{type: "module"}`, any ESM module file MUST end with `.mjs` extension.
|
||||
*
|
||||
* Docs:
|
||||
* - https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_exports_sugar
|
||||
*
|
||||
* @since Node.js v12.7
|
||||
*/
|
||||
exports?: PackageJsonExports;
|
||||
/**
|
||||
* Docs:
|
||||
* - https://nodejs.org/api/packages.html#imports
|
||||
*/
|
||||
imports?: Record<string, string | Record<string, string>>;
|
||||
/**
|
||||
* The field is used to define a set of sub-packages (or workspaces) within a monorepo.
|
||||
*
|
||||
* This field is an array of glob patterns or an object with specific configurations for managing
|
||||
* multiple packages in a single repository.
|
||||
*/
|
||||
workspaces?: string[];
|
||||
/**
|
||||
* The field is is used to specify different TypeScript declaration files for
|
||||
* different versions of TypeScript, allowing for version-specific type definitions.
|
||||
*/
|
||||
typesVersions?: Record<string, Record<string, string[]>>;
|
||||
/**
|
||||
* You can specify which operating systems your module will run on:
|
||||
* ```json
|
||||
* {
|
||||
* "os": ["darwin", "linux"]
|
||||
* }
|
||||
* ```
|
||||
* You can also block instead of allowing operating systems, just prepend the blocked os with a '!':
|
||||
* ```json
|
||||
* {
|
||||
* "os": ["!win32"]
|
||||
* }
|
||||
* ```
|
||||
* The host operating system is determined by `process.platform`
|
||||
* It is allowed to both block and allow an item, although there isn't any good reason to do this.
|
||||
*/
|
||||
os?: string[];
|
||||
/**
|
||||
* If your code only runs on certain cpu architectures, you can specify which ones.
|
||||
* ```json
|
||||
* {
|
||||
* "cpu": ["x64", "ia32"]
|
||||
* }
|
||||
* ```
|
||||
* Like the `os` option, you can also block architectures:
|
||||
* ```json
|
||||
* {
|
||||
* "cpu": ["!arm", "!mips"]
|
||||
* }
|
||||
* ```
|
||||
* The host architecture is determined by `process.arch`
|
||||
*/
|
||||
cpu?: string[];
|
||||
/**
|
||||
* This is a set of config values that will be used at publish-time.
|
||||
*/
|
||||
publishConfig?: {
|
||||
/**
|
||||
* The registry that will be used if the package is published.
|
||||
*/
|
||||
registry?: string;
|
||||
/**
|
||||
* The tag that will be used if the package is published.
|
||||
*/
|
||||
tag?: string;
|
||||
/**
|
||||
* The access level that will be used if the package is published.
|
||||
*/
|
||||
access?: "public" | "restricted";
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* By default, for portability reasons, no files except those listed in
|
||||
* the bin field will be marked as executable in the resulting package
|
||||
* archive. The executableFiles field lets you declare additional fields
|
||||
* that must have the executable flag (+x) set even if
|
||||
* they aren't directly accessible through the bin field.
|
||||
*/
|
||||
executableFiles?: string[];
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* You also can use the field `publishConfig.directory` to customize
|
||||
* the published subdirectory relative to the current `package.json`.
|
||||
*
|
||||
* It is expected to have a modified version of the current package in
|
||||
* the specified directory (usually using third party build tools).
|
||||
*/
|
||||
directory?: string;
|
||||
/**
|
||||
* **pnpm-only**
|
||||
*
|
||||
* When set to `true`, the project will be symlinked from the
|
||||
* `publishConfig.directory` location during local development.
|
||||
* @default true
|
||||
*/
|
||||
linkDirectory?: boolean;
|
||||
} & Pick<PackageJson, "bin" | "main" | "exports" | "types" | "typings" | "module" | "browser" | "unpkg" | "typesVersions" | "os" | "cpu">;
|
||||
/**
|
||||
* See: https://nodejs.org/api/packages.html#packagemanager
|
||||
* This field defines which package manager is expected to be used when working on the current project.
|
||||
* Should be of the format: `<name>@<version>[#hash]`
|
||||
*/
|
||||
packageManager?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
/**
|
||||
* A “person” is an object with a “name” field and optionally “url” and “email”. Or you can shorten that all into a single string, and npm will parse it for you.
|
||||
*/
|
||||
type PackageJsonPerson = string | {
|
||||
name: string;
|
||||
email?: string;
|
||||
url?: string;
|
||||
};
|
||||
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
||||
type PackageJsonExportsObject = {
|
||||
[P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
||||
};
|
||||
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
||||
|
||||
/**
|
||||
* Represents the options for resolving paths with additional file finding capabilities.
|
||||
*/
|
||||
type ResolveOptions = ResolveOptions$1 & FindFileOptions;
|
||||
/**
|
||||
* Options for reading files with optional caching.
|
||||
*/
|
||||
type ReadOptions = {
|
||||
/**
|
||||
* Specifies whether the read results should be cached.
|
||||
* Can be a boolean or a map to hold the cached data.
|
||||
*/
|
||||
cache?: boolean | Map<string, Record<string, any>>;
|
||||
};
|
||||
/**
|
||||
* Defines a PackageJson structure.
|
||||
* @param package_ - The `package.json` content as an object. See {@link PackageJson}.
|
||||
* @returns the same `package.json` object.
|
||||
*/
|
||||
declare function definePackageJSON(package_: PackageJson): PackageJson;
|
||||
/**
|
||||
* Defines a TSConfig structure.
|
||||
* @param tsconfig - The contents of `tsconfig.json` as an object. See {@link TSConfig}.
|
||||
* @returns the same `tsconfig.json` object.
|
||||
*/
|
||||
declare function defineTSConfig(tsconfig: TSConfig): TSConfig;
|
||||
/**
|
||||
* Asynchronously reads a `package.json` file.
|
||||
* @param id - The path identifier for the package.json, defaults to the current working directory.
|
||||
* @param options - The options for resolving and reading the file. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the parsed `package.json` object.
|
||||
*/
|
||||
declare function readPackageJSON(id?: string, options?: ResolveOptions & ReadOptions): Promise<PackageJson>;
|
||||
/**
|
||||
* Asynchronously writes data to a `package.json` file.
|
||||
* @param path - The path to the file where the `package.json` is written.
|
||||
* @param package_ - The `package.json` object to write. See {@link PackageJson}.
|
||||
*/
|
||||
declare function writePackageJSON(path: string, package_: PackageJson): Promise<void>;
|
||||
/**
|
||||
* Asynchronously reads a `tsconfig.json` file.
|
||||
* @param id - The path to the `tsconfig.json` file, defaults to the current working directory.
|
||||
* @param options - The options for resolving and reading the file. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the parsed `tsconfig.json` object.
|
||||
*/
|
||||
declare function readTSConfig(id?: string, options?: ResolveOptions & ReadOptions): Promise<TSConfig>;
|
||||
/**
|
||||
* Asynchronously writes data to a `tsconfig.json` file.
|
||||
* @param path - The path to the file where the `tsconfig.json` is written.
|
||||
* @param tsconfig - The `tsconfig.json` object to write. See {@link TSConfig}.
|
||||
*/
|
||||
declare function writeTSConfig(path: string, tsconfig: TSConfig): Promise<void>;
|
||||
/**
|
||||
* Resolves the path to the nearest `package.json` file from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest `package.json` file.
|
||||
*/
|
||||
declare function resolvePackageJSON(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves the path to the nearest `tsconfig.json` file from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest `tsconfig.json` file.
|
||||
*/
|
||||
declare function resolveTSConfig(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Resolves the path to the nearest lockfile from a given directory.
|
||||
* @param id - The base path for the search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns A promise resolving to the path of the nearest lockfile.
|
||||
*/
|
||||
declare function resolveLockfile(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
/**
|
||||
* Detects the workspace directory based on common project markers (`.git`, lockfiles, `package.json`).
|
||||
* Throws an error if the workspace root cannot be detected.
|
||||
* @param id - The base path to search, defaults to the current working directory.
|
||||
* @param options - Options to modify the search behaviour. See {@link ResolveOptions}.
|
||||
* @returns a promise resolving to the path of the detected workspace directory.
|
||||
*/
|
||||
declare function findWorkspaceDir(id?: string, options?: ResolveOptions): Promise<string>;
|
||||
|
||||
export { type FindFileOptions, type FindNearestFileOptions, type PackageJson, type PackageJsonExports, type PackageJsonPerson, type ReadOptions, type ResolveOptions, type StripEnums, type TSConfig, definePackageJSON, defineTSConfig, findFarthestFile, findFile, findNearestFile, findWorkspaceDir, readPackageJSON, readTSConfig, resolveLockfile, resolvePackageJSON, resolveTSConfig, writePackageJSON, writeTSConfig };
|
||||
157
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.mjs
generated
vendored
Normal file
157
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/dist/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
import { statSync, promises } from 'node:fs';
|
||||
import { resolve, join, isAbsolute, dirname } from 'pathe';
|
||||
import { resolvePath } from 'mlly';
|
||||
import { parseJSON, parseJSONC, stringifyJSON, stringifyJSONC } from 'confbox';
|
||||
|
||||
const defaultFindOptions = {
|
||||
startingFrom: ".",
|
||||
rootPattern: /^node_modules$/,
|
||||
reverse: false,
|
||||
test: (filePath) => {
|
||||
try {
|
||||
if (statSync(filePath).isFile()) {
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
};
|
||||
async function findFile(filename, _options = {}) {
|
||||
const filenames = Array.isArray(filename) ? filename : [filename];
|
||||
const options = { ...defaultFindOptions, ..._options };
|
||||
const basePath = resolve(options.startingFrom);
|
||||
const leadingSlash = basePath[0] === "/";
|
||||
const segments = basePath.split("/").filter(Boolean);
|
||||
if (leadingSlash) {
|
||||
segments[0] = "/" + segments[0];
|
||||
}
|
||||
let root = segments.findIndex((r) => r.match(options.rootPattern));
|
||||
if (root === -1) {
|
||||
root = 0;
|
||||
}
|
||||
if (options.reverse) {
|
||||
for (let index = root + 1; index <= segments.length; index++) {
|
||||
for (const filename2 of filenames) {
|
||||
const filePath = join(...segments.slice(0, index), filename2);
|
||||
if (await options.test(filePath)) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let index = segments.length; index > root; index--) {
|
||||
for (const filename2 of filenames) {
|
||||
const filePath = join(...segments.slice(0, index), filename2);
|
||||
if (await options.test(filePath)) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`
|
||||
);
|
||||
}
|
||||
function findNearestFile(filename, _options = {}) {
|
||||
return findFile(filename, _options);
|
||||
}
|
||||
function findFarthestFile(filename, _options = {}) {
|
||||
return findFile(filename, { ..._options, reverse: true });
|
||||
}
|
||||
|
||||
function definePackageJSON(package_) {
|
||||
return package_;
|
||||
}
|
||||
function defineTSConfig(tsconfig) {
|
||||
return tsconfig;
|
||||
}
|
||||
const FileCache = /* @__PURE__ */ new Map();
|
||||
async function readPackageJSON(id, options = {}) {
|
||||
const resolvedPath = await resolvePackageJSON(id, options);
|
||||
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
||||
if (options.cache && cache.has(resolvedPath)) {
|
||||
return cache.get(resolvedPath);
|
||||
}
|
||||
const blob = await promises.readFile(resolvedPath, "utf8");
|
||||
let parsed;
|
||||
try {
|
||||
parsed = parseJSON(blob);
|
||||
} catch {
|
||||
parsed = parseJSONC(blob);
|
||||
}
|
||||
cache.set(resolvedPath, parsed);
|
||||
return parsed;
|
||||
}
|
||||
async function writePackageJSON(path, package_) {
|
||||
await promises.writeFile(path, stringifyJSON(package_));
|
||||
}
|
||||
async function readTSConfig(id, options = {}) {
|
||||
const resolvedPath = await resolveTSConfig(id, options);
|
||||
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
||||
if (options.cache && cache.has(resolvedPath)) {
|
||||
return cache.get(resolvedPath);
|
||||
}
|
||||
const text = await promises.readFile(resolvedPath, "utf8");
|
||||
const parsed = parseJSONC(text);
|
||||
cache.set(resolvedPath, parsed);
|
||||
return parsed;
|
||||
}
|
||||
async function writeTSConfig(path, tsconfig) {
|
||||
await promises.writeFile(path, stringifyJSONC(tsconfig));
|
||||
}
|
||||
async function resolvePackageJSON(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id, options);
|
||||
return findNearestFile("package.json", {
|
||||
startingFrom: resolvedPath,
|
||||
...options
|
||||
});
|
||||
}
|
||||
async function resolveTSConfig(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id, options);
|
||||
return findNearestFile("tsconfig.json", {
|
||||
startingFrom: resolvedPath,
|
||||
...options
|
||||
});
|
||||
}
|
||||
const lockFiles = [
|
||||
"yarn.lock",
|
||||
"package-lock.json",
|
||||
"pnpm-lock.yaml",
|
||||
"npm-shrinkwrap.json",
|
||||
"bun.lockb",
|
||||
"bun.lock"
|
||||
];
|
||||
async function resolveLockfile(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id, options);
|
||||
const _options = { startingFrom: resolvedPath, ...options };
|
||||
try {
|
||||
return await findNearestFile(lockFiles, _options);
|
||||
} catch {
|
||||
}
|
||||
throw new Error("No lockfile found from " + id);
|
||||
}
|
||||
async function findWorkspaceDir(id = process.cwd(), options = {}) {
|
||||
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id, options);
|
||||
const _options = { startingFrom: resolvedPath, ...options };
|
||||
try {
|
||||
const r = await findNearestFile(".git/config", _options);
|
||||
return resolve(r, "../..");
|
||||
} catch {
|
||||
}
|
||||
try {
|
||||
const r = await resolveLockfile(resolvedPath, {
|
||||
..._options,
|
||||
reverse: true
|
||||
});
|
||||
return dirname(r);
|
||||
} catch {
|
||||
}
|
||||
try {
|
||||
const r = await findFile(resolvedPath, _options);
|
||||
return dirname(r);
|
||||
} catch {
|
||||
}
|
||||
throw new Error("Cannot detect workspace root from " + id);
|
||||
}
|
||||
|
||||
export { definePackageJSON, defineTSConfig, findFarthestFile, findFile, findNearestFile, findWorkspaceDir, readPackageJSON, readTSConfig, resolveLockfile, resolvePackageJSON, resolveTSConfig, writePackageJSON, writeTSConfig };
|
||||
47
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/package.json
generated
vendored
Normal file
47
Frontend-Learner/node_modules/mlly/node_modules/pkg-types/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "pkg-types",
|
||||
"version": "1.3.1",
|
||||
"description": "Node.js utilities and TypeScript definitions for `package.json` and `tsconfig.json`",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.cjs",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"types": "./dist/index.d.ts",
|
||||
"repository": "unjs/pkg-types",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"prepack": "pnpm build",
|
||||
"dev": "vitest --typecheck",
|
||||
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
|
||||
"lint": "eslint && prettier -c src test",
|
||||
"lint:fix": "automd && eslint --fix . && prettier -w src test",
|
||||
"test": "vitest run --typecheck --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"confbox": "^0.1.8",
|
||||
"mlly": "^1.7.4",
|
||||
"pathe": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.6",
|
||||
"@vitest/coverage-v8": "^2.1.8",
|
||||
"automd": "^0.3.12",
|
||||
"changelogen": "^0.5.7",
|
||||
"eslint": "^9.18.0",
|
||||
"eslint-config-unjs": "^0.4.2",
|
||||
"expect-type": "^1.1.0",
|
||||
"jiti": "^2.4.2",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "^5.7.3",
|
||||
"unbuild": "^3.3.1",
|
||||
"vitest": "^2.1.8"
|
||||
},
|
||||
"packageManager": "pnpm@9.15.4"
|
||||
}
|
||||
55
Frontend-Learner/node_modules/mlly/package.json
generated
vendored
Normal file
55
Frontend-Learner/node_modules/mlly/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"name": "mlly",
|
||||
"version": "1.8.0",
|
||||
"description": "Missing ECMAScript module utils for Node.js",
|
||||
"repository": "unjs/mlly",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "vitest",
|
||||
"lint": "eslint src test && prettier -c src test",
|
||||
"lint:fix": "eslint src test --fix && prettier -w src test",
|
||||
"release": "pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags",
|
||||
"test": "pnpm lint && pnpm test:types && vitest run",
|
||||
"test:types": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": "^8.15.0",
|
||||
"pathe": "^2.0.3",
|
||||
"pkg-types": "^1.3.1",
|
||||
"ufo": "^1.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.3.0",
|
||||
"@vitest/coverage-v8": "^3.2.4",
|
||||
"changelogen": "^0.6.2",
|
||||
"eslint": "^9.33.0",
|
||||
"eslint-config-unjs": "^0.5.0",
|
||||
"import-meta-resolve": "^4.1.0",
|
||||
"jiti": "^2.5.1",
|
||||
"prettier": "^3.6.2",
|
||||
"std-env": "^3.9.0",
|
||||
"typescript": "^5.9.2",
|
||||
"unbuild": "^3.6.1",
|
||||
"vitest": "^3.2.4"
|
||||
},
|
||||
"packageManager": "pnpm@10.15.0",
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"esbuild"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue