
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
@typeofweb/schema
Advanced tools
`@typeofweb/schema` is a lightweight and extensible library for data validation with full TypeScript support!
@typeofweb/schema is a lightweight and extensible library for data validation with full TypeScript support!
Thanks goes to these wonderful people (emoji key):
Michał Miszczyszyn 💻 🚧 📆 👀 | Bartłomiej Wiśniewski 💻 👀 🐛 📖 | Adam Siekierski 👀 |
Anthony Sottile 🛡️ | Marek 📖 | Olzhas Alexandrov 🐛 |
Bartek Słysz 🐛 | Mateusz Stepaniuk 🤔 |
This project follows the all-contributors specification. Contributions of any kind welcome!
import { number, object, optional, string, validate } from '@typeofweb/schema';
const personSchema = object({
name: string(),
age: number(),
email: optional(string()),
})();
const mark = {
name: 'Mark',
age: 29,
};
const personValidator = validate(personSchema);
// If validation is successful returns data with correct type, throws ValidationError otherwise
const validatedPerson = personValidator(mark);
Early benchmarks show some really promising performance of @typeofweb/schema when compared to other industry-leading solutions:
Platform info:
==============
Darwin 20.3.0 x64
Node.JS: 14.16.0
V8: 8.4.371.19-node.18
Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz × 8
| library | relative speed | operations per second | avg. operation time |
|---|---|---|---|
| @typeofweb/schema | ref | (1,934,098 rps) | (avg: 0.517μs) |
| io-ts@2.2.13 | -7.21% | (1,794,594 rps) | (avg: 0.557μs) |
| mschema@0.5.6 | -69.8% | (584,151 rps) | (avg: 1μs) |
| validator.js@2.0.4 | -76.16% | (461,088 rps) | (avg: 2μs) |
| validate.js@0.13.1 | -89.02% | (212,408 rps) | (avg: 4μs) |
| validatorjs@3.22.1 | -92.2% | (150,791 rps) | (avg: 6μs) |
| joi@17.3.0 | -93.25% | (130,541 rps) | (avg: 7μs) |
| superstruct@0.13.3 | -96.99% | (58,197 rps) | (avg: 17μs) |
| yup@0.32.8 | -97.09% | (56,243 rps) | (avg: 17μs) |
| parambulator@1.5.2 | -98.99% | (19,492 rps) | (avg: 51μs) |
| zod@1.11.11 | -99.03% | (18,827 rps) | (avg: 53μs) |
FAQs
`@typeofweb/schema` is a lightweight and extensible library for data validation with full TypeScript support!
The npm package @typeofweb/schema receives a total of 232 weekly downloads. As such, @typeofweb/schema popularity was classified as not popular.
We found that @typeofweb/schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.