@augceo/schemistry
v0.1.11
Published
JSON Schema manipulation utilities
Downloads
3
Readme
JSONSchemer
JSON Schema manipulation utilities for TypeScript.
Features
Installation
npm install @augceo/schemistryUsage
import { Schema } from '@augceo/schemistry';
const options = {
support: {
optionalProperties: false,
},
};
// Define a schema
const schema = Schema({
type: 'object',
properties: {
name: { type: 'string' },
},
} as const);
// Create patch schema
const patch = Schema.Partial(schema, options);
// Merge schemas
const merged = Schema.Intersection(schema, patch);
// Wrap into instruction
const instruction = Instruction(merged);
// Adapt schema for LLM
const schema = Schema(
{
type: 'object',
properties: {
name: { type: 'string' },
},
},
options
);Development
# Install dependencies
npm install
# Run tests
npm test
# Build
npm run buildLicense
MIT
