full site update

This commit is contained in:
2025-07-24 18:46:24 +02:00
parent bfe2b90d8d
commit 37a6e0ab31
6912 changed files with 540482 additions and 361712 deletions

21
node_modules/defu/LICENSE generated vendored Normal file
View 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.

171
node_modules/defu/README.md generated vendored Normal file
View File

@@ -0,0 +1,171 @@
# 🌊 defu
Assign default properties, recursively. Lightweight and Fast.
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![Codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]
## Install
Install package:
```bash
# yarn
yarn add defu
# npm
npm install defu
# pnpm
pnpm install defu
```
## Usage
```js
import { defu } from "defu";
const options = defu(object, ...defaults);
```
Leftmost arguments have more priority when assigning defaults.
### Arguments
- **object (Object):** The destination object.
- **source (Object):** The source object.
```js
import { defu } from "defu";
console.log(defu({ a: { b: 2 } }, { a: { b: 1, c: 3 } }));
// => { a: { b: 2, c: 3 } }
```
### Using with CommonJS
```js
const { defu } = require("defu");
```
## Custom Merger
Sometimes default merging strategy is not desirable. Using `createDefu` we can create a custom instance with different merging strategy.
This function accepts `obj` (source object), `key` and `value` (current value) and should return `true` if applied custom merging.
**Example:** Sum numbers instead of overriding
```js
import { createDefu } from "defu";
const ext = createDefu((obj, key, value) => {
if (typeof obj[key] === "number" && typeof value === "number") {
obj[key] += value;
return true;
}
});
ext({ cost: 15 }, { cost: 10 }); // { cost: 25 }
```
## Function Merger
Using `defuFn`, if user provided a function, it will be called with default value instead of merging.
It can be useful for default values manipulation.
**Example:** Filter some items from defaults (array) and add 20 to the count default value.
```js
import { defuFn } from "defu";
defuFn(
{
ignore: (val) => val.filter((item) => item !== "dist"),
count: (count) => count + 20,
},
{
ignore: ["node_modules", "dist"],
count: 10,
},
);
/*
{
ignore: ['node_modules'],
count: 30
}
*/
```
**Note:** if the default value is not defined, the function defined won't be called and kept as value.
## Array Function Merger
`defuArrayFn` is similar to `defuFn` but **only applies to array values defined in defaults**.
**Example:** Filter some items from defaults (array) and add 20 to the count default value.
```js
import { defuArrayFn } from 'defu'
defuArrayFn({
ignore: (val) => val.filter(i => i !== 'dist'),
count: () => 20
}, {
ignore: [
'node_modules',
'dist'
],
count: 10
})
/*
{
ignore: ['node_modules'],
count: () => 20
}
*/
```
**Note:** the function is called only if the value defined in defaults is an aray.
### Remarks
- `object` and `defaults` are not modified
- Nullish values ([`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null) and [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)) are skipped. Please use [defaults-deep](https://www.npmjs.com/package/defaults-deep) or [omit-deep](http://npmjs.com/package/omit-deep) or [lodash.defaultsdeep](https://www.npmjs.com/package/lodash.defaultsdeep) if you need to preserve or different behavior.
- Assignment of `__proto__` and `constructor` keys will be skipped to prevent security issues with object pollution.
- Will concat `array` values (if default property is defined)
```js
console.log(defu({ array: ["b", "c"] }, { array: ["a"] }));
// => { array: ['b', 'c', 'a'] }
```
## Type
We expose `Defu` as a type utility to return a merged type that follows the rules that defu follows.
```js
import type { Defu } from 'defu'
type Options = Defu<{ foo: 'bar' }, [{}, { bar: 'baz' }, { something: 42 }]>
// returns { foo: 'bar', bar: 'baz', 'something': 42 }
```
## License
MIT. Made with 💖
<!-- Refs -->
[npm-version-src]: https://img.shields.io/npm/v/defu?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/defu
[npm-downloads-src]: https://img.shields.io/npm/dm/defu?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/defu
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/defu/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/defu
[bundle-src]: https://img.shields.io/bundlephobia/minzip/defu?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=defu
[license-src]: https://img.shields.io/github/license/unjs/defu.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/defu/blob/main/LICENSE

77
node_modules/defu/dist/defu.cjs generated vendored Normal file
View File

@@ -0,0 +1,77 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function isPlainObject(value) {
if (value === null || typeof value !== "object") {
return false;
}
const prototype = Object.getPrototypeOf(value);
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
return false;
}
if (Symbol.iterator in value) {
return false;
}
if (Symbol.toStringTag in value) {
return Object.prototype.toString.call(value) === "[object Module]";
}
return true;
}
function _defu(baseObject, defaults, namespace = ".", merger) {
if (!isPlainObject(defaults)) {
return _defu(baseObject, {}, namespace, merger);
}
const object = Object.assign({}, defaults);
for (const key in baseObject) {
if (key === "__proto__" || key === "constructor") {
continue;
}
const value = baseObject[key];
if (value === null || value === void 0) {
continue;
}
if (merger && merger(object, key, value, namespace)) {
continue;
}
if (Array.isArray(value) && Array.isArray(object[key])) {
object[key] = [...value, ...object[key]];
} else if (isPlainObject(value) && isPlainObject(object[key])) {
object[key] = _defu(
value,
object[key],
(namespace ? `${namespace}.` : "") + key.toString(),
merger
);
} else {
object[key] = value;
}
}
return object;
}
function createDefu(merger) {
return (...arguments_) => (
// eslint-disable-next-line unicorn/no-array-reduce
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
);
}
const defu = createDefu();
const defuFn = createDefu((object, key, currentValue) => {
if (object[key] !== void 0 && typeof currentValue === "function") {
object[key] = currentValue(object[key]);
return true;
}
});
const defuArrayFn = createDefu((object, key, currentValue) => {
if (Array.isArray(object[key]) && typeof currentValue === "function") {
object[key] = currentValue(object[key]);
return true;
}
});
exports.createDefu = createDefu;
exports.default = defu;
exports.defu = defu;
exports.defuArrayFn = defuArrayFn;
exports.defuFn = defuFn;

25
node_modules/defu/dist/defu.d.cts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
type Input = Record<string | number | symbol, any>;
type IgnoredInput = boolean | number | null | any[] | Record<never, any> | undefined;
type Merger = <T extends Input, K extends keyof T>(object: T, key: keyof T, value: T[K], namespace: string) => any;
type nullish = null | undefined | void;
type MergeObjects<Destination extends Input, Defaults extends Input> = Destination extends Defaults ? Destination : Omit<Destination, keyof Destination & keyof Defaults> & Omit<Defaults, keyof Destination & keyof Defaults> & {
-readonly [Key in keyof Destination & keyof Defaults]: Destination[Key] extends nullish ? Defaults[Key] extends nullish ? nullish : Defaults[Key] : Defaults[Key] extends nullish ? Destination[Key] : Merge<Destination[Key], Defaults[Key]>;
};
type Defu<S extends Input, D extends Array<Input | IgnoredInput>> = D extends [infer F, ...infer Rest] ? F extends Input ? Rest extends Array<Input | IgnoredInput> ? Defu<MergeObjects<S, F>, Rest> : MergeObjects<S, F> : F extends IgnoredInput ? Rest extends Array<Input | IgnoredInput> ? Defu<S, Rest> : S : S : S;
type DefuFn = <Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source, ...defaults: Defaults) => Defu<Source, Defaults>;
interface DefuInstance {
<Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source | IgnoredInput, ...defaults: Defaults): Defu<Source, Defaults>;
fn: DefuFn;
arrayFn: DefuFn;
extend(merger?: Merger): DefuFn;
}
type MergeArrays<Destination, Source> = Destination extends Array<infer DestinationType> ? Source extends Array<infer SourceType> ? Array<DestinationType | SourceType> : Source | Array<DestinationType> : Source | Destination;
type Merge<Destination extends Input, Defaults extends Input> = Destination extends nullish ? Defaults extends nullish ? nullish : Defaults : Defaults extends nullish ? Destination : Destination extends Array<any> ? Defaults extends Array<any> ? MergeArrays<Destination, Defaults> : Destination | Defaults : Destination extends Function ? Destination | Defaults : Destination extends RegExp ? Destination | Defaults : Destination extends Promise<any> ? Destination | Defaults : Defaults extends Function ? Destination | Defaults : Defaults extends RegExp ? Destination | Defaults : Defaults extends Promise<any> ? Destination | Defaults : Destination extends Input ? Defaults extends Input ? MergeObjects<Destination, Defaults> : Destination | Defaults : Destination | Defaults;
declare function createDefu(merger?: Merger): DefuFn;
declare const defu: DefuInstance;
declare const defuFn: DefuFn;
declare const defuArrayFn: DefuFn;
export { type Defu, createDefu, defu as default, defu, defuArrayFn, defuFn };

25
node_modules/defu/dist/defu.d.mts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
type Input = Record<string | number | symbol, any>;
type IgnoredInput = boolean | number | null | any[] | Record<never, any> | undefined;
type Merger = <T extends Input, K extends keyof T>(object: T, key: keyof T, value: T[K], namespace: string) => any;
type nullish = null | undefined | void;
type MergeObjects<Destination extends Input, Defaults extends Input> = Destination extends Defaults ? Destination : Omit<Destination, keyof Destination & keyof Defaults> & Omit<Defaults, keyof Destination & keyof Defaults> & {
-readonly [Key in keyof Destination & keyof Defaults]: Destination[Key] extends nullish ? Defaults[Key] extends nullish ? nullish : Defaults[Key] : Defaults[Key] extends nullish ? Destination[Key] : Merge<Destination[Key], Defaults[Key]>;
};
type Defu<S extends Input, D extends Array<Input | IgnoredInput>> = D extends [infer F, ...infer Rest] ? F extends Input ? Rest extends Array<Input | IgnoredInput> ? Defu<MergeObjects<S, F>, Rest> : MergeObjects<S, F> : F extends IgnoredInput ? Rest extends Array<Input | IgnoredInput> ? Defu<S, Rest> : S : S : S;
type DefuFn = <Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source, ...defaults: Defaults) => Defu<Source, Defaults>;
interface DefuInstance {
<Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source | IgnoredInput, ...defaults: Defaults): Defu<Source, Defaults>;
fn: DefuFn;
arrayFn: DefuFn;
extend(merger?: Merger): DefuFn;
}
type MergeArrays<Destination, Source> = Destination extends Array<infer DestinationType> ? Source extends Array<infer SourceType> ? Array<DestinationType | SourceType> : Source | Array<DestinationType> : Source | Destination;
type Merge<Destination extends Input, Defaults extends Input> = Destination extends nullish ? Defaults extends nullish ? nullish : Defaults : Defaults extends nullish ? Destination : Destination extends Array<any> ? Defaults extends Array<any> ? MergeArrays<Destination, Defaults> : Destination | Defaults : Destination extends Function ? Destination | Defaults : Destination extends RegExp ? Destination | Defaults : Destination extends Promise<any> ? Destination | Defaults : Defaults extends Function ? Destination | Defaults : Defaults extends RegExp ? Destination | Defaults : Defaults extends Promise<any> ? Destination | Defaults : Destination extends Input ? Defaults extends Input ? MergeObjects<Destination, Defaults> : Destination | Defaults : Destination | Defaults;
declare function createDefu(merger?: Merger): DefuFn;
declare const defu: DefuInstance;
declare const defuFn: DefuFn;
declare const defuArrayFn: DefuFn;
export { type Defu, createDefu, defu as default, defu, defuArrayFn, defuFn };

25
node_modules/defu/dist/defu.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
type Input = Record<string | number | symbol, any>;
type IgnoredInput = boolean | number | null | any[] | Record<never, any> | undefined;
type Merger = <T extends Input, K extends keyof T>(object: T, key: keyof T, value: T[K], namespace: string) => any;
type nullish = null | undefined | void;
type MergeObjects<Destination extends Input, Defaults extends Input> = Destination extends Defaults ? Destination : Omit<Destination, keyof Destination & keyof Defaults> & Omit<Defaults, keyof Destination & keyof Defaults> & {
-readonly [Key in keyof Destination & keyof Defaults]: Destination[Key] extends nullish ? Defaults[Key] extends nullish ? nullish : Defaults[Key] : Defaults[Key] extends nullish ? Destination[Key] : Merge<Destination[Key], Defaults[Key]>;
};
type Defu<S extends Input, D extends Array<Input | IgnoredInput>> = D extends [infer F, ...infer Rest] ? F extends Input ? Rest extends Array<Input | IgnoredInput> ? Defu<MergeObjects<S, F>, Rest> : MergeObjects<S, F> : F extends IgnoredInput ? Rest extends Array<Input | IgnoredInput> ? Defu<S, Rest> : S : S : S;
type DefuFn = <Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source, ...defaults: Defaults) => Defu<Source, Defaults>;
interface DefuInstance {
<Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source | IgnoredInput, ...defaults: Defaults): Defu<Source, Defaults>;
fn: DefuFn;
arrayFn: DefuFn;
extend(merger?: Merger): DefuFn;
}
type MergeArrays<Destination, Source> = Destination extends Array<infer DestinationType> ? Source extends Array<infer SourceType> ? Array<DestinationType | SourceType> : Source | Array<DestinationType> : Source | Destination;
type Merge<Destination extends Input, Defaults extends Input> = Destination extends nullish ? Defaults extends nullish ? nullish : Defaults : Defaults extends nullish ? Destination : Destination extends Array<any> ? Defaults extends Array<any> ? MergeArrays<Destination, Defaults> : Destination | Defaults : Destination extends Function ? Destination | Defaults : Destination extends RegExp ? Destination | Defaults : Destination extends Promise<any> ? Destination | Defaults : Defaults extends Function ? Destination | Defaults : Defaults extends RegExp ? Destination | Defaults : Defaults extends Promise<any> ? Destination | Defaults : Destination extends Input ? Defaults extends Input ? MergeObjects<Destination, Defaults> : Destination | Defaults : Destination | Defaults;
declare function createDefu(merger?: Merger): DefuFn;
declare const defu: DefuInstance;
declare const defuFn: DefuFn;
declare const defuArrayFn: DefuFn;
export { type Defu, createDefu, defu as default, defu, defuArrayFn, defuFn };

69
node_modules/defu/dist/defu.mjs generated vendored Normal file
View File

@@ -0,0 +1,69 @@
function isPlainObject(value) {
if (value === null || typeof value !== "object") {
return false;
}
const prototype = Object.getPrototypeOf(value);
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
return false;
}
if (Symbol.iterator in value) {
return false;
}
if (Symbol.toStringTag in value) {
return Object.prototype.toString.call(value) === "[object Module]";
}
return true;
}
function _defu(baseObject, defaults, namespace = ".", merger) {
if (!isPlainObject(defaults)) {
return _defu(baseObject, {}, namespace, merger);
}
const object = Object.assign({}, defaults);
for (const key in baseObject) {
if (key === "__proto__" || key === "constructor") {
continue;
}
const value = baseObject[key];
if (value === null || value === void 0) {
continue;
}
if (merger && merger(object, key, value, namespace)) {
continue;
}
if (Array.isArray(value) && Array.isArray(object[key])) {
object[key] = [...value, ...object[key]];
} else if (isPlainObject(value) && isPlainObject(object[key])) {
object[key] = _defu(
value,
object[key],
(namespace ? `${namespace}.` : "") + key.toString(),
merger
);
} else {
object[key] = value;
}
}
return object;
}
function createDefu(merger) {
return (...arguments_) => (
// eslint-disable-next-line unicorn/no-array-reduce
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
);
}
const defu = createDefu();
const defuFn = createDefu((object, key, currentValue) => {
if (object[key] !== void 0 && typeof currentValue === "function") {
object[key] = currentValue(object[key]);
return true;
}
});
const defuArrayFn = createDefu((object, key, currentValue) => {
if (Array.isArray(object[key]) && typeof currentValue === "function") {
object[key] = currentValue(object[key]);
return true;
}
});
export { createDefu, defu as default, defu, defuArrayFn, defuFn };

11
node_modules/defu/lib/defu.cjs generated vendored Normal file
View File

@@ -0,0 +1,11 @@
const { defu, createDefu, defuFn, defuArrayFn } = require('../dist/defu.cjs');
module.exports = defu;
module.exports.defu = defu;
module.exports.default = defu;
module.exports.createDefu = createDefu;
module.exports.defuFn = defuFn;
module.exports.defuArrayFn = defuArrayFn;

43
node_modules/defu/package.json generated vendored Normal file
View File

@@ -0,0 +1,43 @@
{
"name": "defu",
"version": "6.1.4",
"description": "Recursively assign default properties. Lightweight and Fast!",
"repository": "unjs/defu",
"license": "MIT",
"exports": {
".": {
"types": "./dist/defu.d.ts",
"import": "./dist/defu.mjs",
"require": "./lib/defu.cjs"
}
},
"main": "./lib/defu.cjs",
"module": "./dist/defu.mjs",
"types": "./dist/defu.d.ts",
"files": [
"dist",
"lib"
],
"devDependencies": {
"@types/node": "^20.10.6",
"@vitest/coverage-v8": "^1.1.3",
"changelogen": "^0.5.5",
"eslint": "^8.56.0",
"eslint-config-unjs": "^0.2.1",
"expect-type": "^0.17.3",
"prettier": "^3.1.1",
"typescript": "^5.3.3",
"unbuild": "^2.0.0",
"vitest": "^1.1.3"
},
"packageManager": "pnpm@8.10.2",
"scripts": {
"build": "unbuild",
"dev": "vitest",
"lint": "eslint --ext .ts src && prettier -c src test",
"lint:fix": "eslint --ext .ts src --fix && prettier -w src test",
"release": "pnpm test && changelogen --release && git push --follow-tags && pnpm publish",
"test": "pnpm lint && pnpm vitest run",
"test:types": "tsc --noEmit"
}
}