
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@bitkai/dynamic-fields
Advanced tools
A TypeScript library for handling dynamic form fields with validation.
A TypeScript library for handling dynamic form fields with validation.
npm install @bitkai/dynamic-fields
For complete examples, check out the examples folder:
Basic usage:
import { Field, validateField, getDefaultValue, InferFieldType } from '@bitkai/dynamic-fields';
// Define a field schema
const field = {
type: 'text',
key: 'name',
label: 'Name',
minLength: 2,
maxLength: 50,
optional: false
} as const satisfies Field;
// Infer the type of the field value
type FieldValue = InferFieldType<typeof field>; // string
// Get default value
const defaultValue = getDefaultValue(field); // returns ''
// Validate a value
try {
const value: FieldValue = 'John';
validateField(field, value);
console.log('Valid!');
} catch (error) {
console.error(error.message);
}
The InferFieldType helper provides automatic type inference for your field values based on the field definition. This ensures type safety when working with form values.
The library supports the following field types:
text: Text input with optional length constraintsnumber: Numeric inputboolean: Boolean/checkbox inputarray: Array of fieldsgroup: Group of fieldsselect: Single selection from optionsmultiselect: Multiple selection from optionsimage: Image inputcolor: Color inputdate: Date inputtime: Time inputgit checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)MIT
FAQs
A TypeScript library for handling dynamic form fields with validation.
We found that @bitkai/dynamic-fields 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.