Aktueller Stand
This commit is contained in:
9
backend/node_modules/valibot/LICENSE.md
generated
vendored
Normal file
9
backend/node_modules/valibot/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Fabian Hiller
|
||||
|
||||
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.
|
||||
92
backend/node_modules/valibot/README.md
generated
vendored
Normal file
92
backend/node_modules/valibot/README.md
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||

|
||||
|
||||
# Valibot
|
||||
|
||||
[![License: MIT][license-image]][license-url]
|
||||
[![CI][ci-image]][ci-url]
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![Downloads][downloads-image]][npm-url]
|
||||
[![JSR version][jsr-image]][jsr-url]
|
||||
[![Discord][discord-image]][discord-url]
|
||||
|
||||
Hello, I am Valibot and I would like to help you validate data easily using a schema. No matter if it is incoming data on a server, a form or even configuration files. I have no dependencies and can run in any JavaScript environment.
|
||||
|
||||
> I highly recommend you read the [announcement post](https://www.builder.io/blog/introducing-valibot), and if you are a nerd like me, the [bachelor's thesis](https://valibot.dev/thesis.pdf) I am based on.
|
||||
|
||||
## Highlights
|
||||
|
||||
- Fully type safe with static type inference
|
||||
- Small bundle size starting at less than 700 bytes
|
||||
- Validate everything from strings to complex objects
|
||||
- Open source and fully tested with 100 % coverage
|
||||
- Many transformation and validation actions included
|
||||
- Well structured source code without dependencies
|
||||
- Minimal, readable and well thought out API
|
||||
|
||||
## Example
|
||||
|
||||
First you create a schema that describes a structured data set. A schema can be compared to a type definition in TypeScript. The big difference is that TypeScript types are "not executed" and are more or less a DX feature. A schema on the other hand, apart from the inferred type definition, can also be executed at runtime to guarantee the type safety of unknown data.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```ts
|
||||
import * as v from 'valibot'; // 1.31 kB
|
||||
|
||||
// Create login schema with email and password
|
||||
const LoginSchema = v.object({
|
||||
email: v.pipe(v.string(), v.email()),
|
||||
password: v.pipe(v.string(), v.minLength(8)),
|
||||
});
|
||||
|
||||
// Infer output TypeScript type of login schema as
|
||||
// { email: string; password: string }
|
||||
type LoginData = v.InferOutput<typeof LoginSchema>;
|
||||
|
||||
// Throws error for email and password
|
||||
const output1 = v.parse(LoginSchema, { email: '', password: '' });
|
||||
|
||||
// Returns data as { email: string; password: string }
|
||||
const output2 = v.parse(LoginSchema, {
|
||||
email: 'jane@example.com',
|
||||
password: '12345678',
|
||||
});
|
||||
```
|
||||
|
||||
Apart from `parse` I also offer a non-exception-based API with `safeParse` and a type guard function with `is`. You can read more about it [here](https://valibot.dev/guides/parse-data/).
|
||||
|
||||
## Comparison
|
||||
|
||||
Instead of relying on a few large functions with many methods, my API design and source code is based on many small and independent functions, each with just a single task. This modular design has several advantages.
|
||||
|
||||
For example, this allows a bundler to use the import statements to remove code that is not needed. This way, only the code that is actually used gets into your production build. This can reduce the bundle size by up to 95 % compared to [Zod](https://zod.dev/).
|
||||
|
||||
In addition, it allows you to easily extend my functionality with external code and makes my source code more robust and secure because the functionality of the individual functions can be tested much more easily through unit tests.
|
||||
|
||||
## Partners
|
||||
|
||||
Thanks to our partners who support my development! [Join them](https://github.com/sponsors/fabian-hiller) and contribute to the sustainability of open source software!
|
||||
|
||||

|
||||
|
||||
## Credits
|
||||
|
||||
My friend [Fabian](https://github.com/fabian-hiller) created me as part of his [bachelor thesis](https://valibot.dev/thesis.pdf) at [Stuttgart Media University](https://www.hdm-stuttgart.de/en/), supervised by Walter Kriha, [Miško Hevery](https://github.com/mhevery) and [Ryan Carniato](https://github.com/ryansolid). My role models also include [Colin McDonnell](https://github.com/colinhacks), who had a big influence on my API design with [Zod](https://zod.dev/).
|
||||
|
||||
## Feedback
|
||||
|
||||
Find a bug or have an idea how to improve my code? Please fill out an [issue](https://github.com/open-circle/valibot/issues/new). Together we can make the library even better!
|
||||
|
||||
## License
|
||||
|
||||
I am completely free and licensed under the [MIT license](https://github.com/open-circle/valibot/blob/main/LICENSE.md). But if you like, you can feed me with a star on [GitHub](https://github.com/open-circle/valibot).
|
||||
|
||||
[license-image]: https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square
|
||||
[license-url]: https://opensource.org/licenses/MIT
|
||||
[ci-image]: https://img.shields.io/github/actions/workflow/status/open-circle/valibot/ci.yml?branch=main&logo=github&style=flat-square
|
||||
[ci-url]: https://github.com/open-circle/valibot/actions/workflows/ci.yml
|
||||
[npm-image]: https://img.shields.io/npm/v/valibot.svg?style=flat-square
|
||||
[npm-url]: https://npmjs.org/package/valibot
|
||||
[downloads-image]: https://img.shields.io/npm/dm/valibot.svg?style=flat-square
|
||||
[jsr-image]: https://jsr.io/badges/@valibot/valibot?style=flat-square
|
||||
[jsr-url]: https://jsr.io/@valibot/valibot
|
||||
[discord-image]: https://img.shields.io/discord/1252985447273992222?label=Discord&style=flat-square
|
||||
[discord-url]: https://discord.gg/tkMjQACf2P
|
||||
7318
backend/node_modules/valibot/dist/index.cjs
generated
vendored
Normal file
7318
backend/node_modules/valibot/dist/index.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
15211
backend/node_modules/valibot/dist/index.d.cts
generated
vendored
Normal file
15211
backend/node_modules/valibot/dist/index.d.cts
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15211
backend/node_modules/valibot/dist/index.d.mts
generated
vendored
Normal file
15211
backend/node_modules/valibot/dist/index.d.mts
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
backend/node_modules/valibot/dist/index.min.cjs
generated
vendored
Normal file
2
backend/node_modules/valibot/dist/index.min.cjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
backend/node_modules/valibot/dist/index.min.mjs
generated
vendored
Normal file
2
backend/node_modules/valibot/dist/index.min.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7026
backend/node_modules/valibot/dist/index.mjs
generated
vendored
Normal file
7026
backend/node_modules/valibot/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
79
backend/node_modules/valibot/package.json
generated
vendored
Normal file
79
backend/node_modules/valibot/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"name": "valibot",
|
||||
"description": "The modular and type safe schema library for validating structural data",
|
||||
"version": "1.2.0",
|
||||
"license": "MIT",
|
||||
"author": "Fabian Hiller",
|
||||
"homepage": "https://valibot.dev",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/open-circle/valibot"
|
||||
},
|
||||
"keywords": [
|
||||
"modular",
|
||||
"typescript",
|
||||
"schema",
|
||||
"validation",
|
||||
"parsing",
|
||||
"bundle-size",
|
||||
"type-safe",
|
||||
"runtime"
|
||||
],
|
||||
"type": "module",
|
||||
"main": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.cts",
|
||||
"default": "./dist/index.cjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@vitest/coverage-v8": "^4.0.13",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsdoc": "^61.4.0",
|
||||
"eslint-plugin-redos-detector": "^3.1.1",
|
||||
"eslint-plugin-regexp": "^2.10.0",
|
||||
"eslint-plugin-security": "^3.0.1",
|
||||
"jsdom": "^27.2.0",
|
||||
"tsdown": "^0.16.6",
|
||||
"tsm": "^2.3.0",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.47.0",
|
||||
"vite": "^7.2.4",
|
||||
"vitest": "4.0.13"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=5"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"play": "tsm ./playground.ts",
|
||||
"test": "vitest --typecheck",
|
||||
"coverage": "vitest run --coverage --isolate",
|
||||
"lint": "eslint \"src/**/*.ts*\" && tsc --noEmit && deno check ./src/index.ts",
|
||||
"lint.fix": "eslint \"src/**/*.ts*\" --fix",
|
||||
"format": "prettier --write ./src",
|
||||
"format.check": "prettier --check ./src",
|
||||
"build": "tsdown"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user