
Research
/Security News
OpenAPI React Query Codegen Compromised in Mini Shai-Hulud npm Supply Chain Attack
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.
Library that allow you to describe data structures by subset of JavaScript syntax and validate them at runtime
npm i metaforge --save
const userSchema = new Schema({
$id: 'userSchema',
$meta: { name: 'user', description: 'schema for users testing' },
phone: { $type: 'union', types: ['number', 'string'] }, //? number or string
name: { $type: 'set', items: ['string', '?string'] }, //? set tuple
phrase: (sample, parent, root) => 'Hello ' + [...parent.name].join(' ') + ' !', // Calculated fields
mask: { $type: 'array', items: 'string' }, //? array
ip: {
$type: 'array',
$required: false,
$rules: [ip => ip[0] === '192'], //? custom rules
items: { $type: 'union', types: ['string', '?number'], condition: 'oneof', $required: false },
},
type: ['elite', 'member', 'guest'], //? enum
'/[a-Z]+Id/': { $type: '?number', isPattern: true }, // pattern fields
address: 'string',
secondAddress: '?string',
options: { notifications: 'boolean', lvls: ['number', 'string'] },
});
const systemSchema = new Schema({ $type: 'array', items: userSchema });
const sample = [
{
myId: 1,
phone: '7(***)...',
ip: ['192', 168, '1', null],
type: 'elite',
mask: ['255', '255', '255', '0'],
name: new Set(['Alexander', null]),
options: { notifications: true, lvls: [2, '["admin", "user"]'] },
address: 'Pushkin street',
},
//...
];
systemSchema.warnings; // Inspect warnings after build
systemSchema.calculate(sample); // Will assign calculated fields
systemSchema.test(sample); // Schema validation
systemSchema.dts('SystemInterface'); // Typescript generation
systemSchema.pull('userSchema').test(sample[0]); // Subschema validation
systemSchema.pull('userSchema').test({ phone: 123 }, 'root', true); // Partial validation
systemSchema.pull('userSchema'); // Metadata: {..., name: 'user', description: 'schema for users testing'}
Copyright © 2023 Astrohelm contributors.
This library is MIT licensed.
And it is part of Astrohelm ecosystem.
FAQs
Library that allow you to describe data structures by subset of JavaScript syntax and validate them at runtime
The npm package metaforge receives a total of 6 weekly downloads. As such, metaforge popularity was classified as not popular.
We found that metaforge 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.

Research
/Security News
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.

Security News
Socket joins more than 100 technology, cybersecurity, and financial organizations calling for a global surge in cyber defense.

Product
Enterprise security teams can now detect malware, credential theft, suspicious network activity, and risky updates across Microsoft Edge extensions.