
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@bootstrapp/types
Advanced tools
Type validation and coercion library for model fields and component properties
Type validation and coercion library for model fields and component properties.
npm install @bootstrapp/types
The @bootstrapp/types library provides a runtime type system for JavaScript applications with two primary use cases:
import T from '@bootstrapp/types';
const properties = {
count: T.number({ defaultValue: 0 }),
label: T.string({ required: true }),
enabled: T.boolean({ defaultValue: true })
};
// Validate a single property
const result = properties.count.validate("42");
// { valid: true, value: 42, error: null, details: null }
import T from '@bootstrapp/types';
const UserSchema = {
name: T.string({ required: true }),
email: T.string({ format: 'email' }),
age: T.number({ min: 18 }),
posts: T.many('Post', 'author')
};
const [errors, validatedUser] = T.validateType(userData, {
schema: UserSchema
});
if (!errors) {
// User data is valid
console.log(validatedUser);
}
string, number, boolean, array, object, date, datetime, any, functionbelongs, belongs_many, one, manydefaultValue - Default value if input is undefined/nullrequired - Value cannot be undefined/nullmin/max - Min/max values for numbers and datesformat - Format validation (e.g., 'email')customValidator - Custom validation functionFor complete API documentation and advanced usage, see types.md.
AGPL-3.0
FAQs
Type validation and coercion library for model fields and component properties
We found that @bootstrapp/types demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.