
Research
/Security News
Popular Go Decimal Library Targeted by Long-Running Typosquat with DNS Backdoor
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.
@adaptate/core
Advanced tools
Dynamic and Adaptable Model Validator Using Zod, Interoperable with OpenAPI
Schema transformation engine — make Zod schema fields required based on configuration objects.
pnpm add @adaptate/core
# or
npm install @adaptate/core
Peer dependency: zod@^3.23.8 || ^4.0.0
Monorepo development: If you clone the adaptate repo to work on source, use pnpm at the repo root only — required for the repo’s supply-chain protections (Development in the root README). The install commands above remain correct when installing published packages from npm.
transformSchema(schema, config)Transforms a Zod schema by making specified fields required based on a config object.
Config values:
true — make the field required (strip optionality)false — keep the field optional{ '*': config } — apply config to all array elementsimport { z } from 'zod';
import { transformSchema, type Config } from '@adaptate/core';
const schema = z.object({
name: z.string().optional(),
age: z.number().optional(),
address: z.object({
street: z.string().optional(),
city: z.string().optional(),
}).optional(),
});
const config = {
name: true,
age: true,
address: { city: true },
} satisfies Config<z.infer<typeof schema>>;
const updatedSchema = transformSchema(schema, config);
updatedSchema.parse({ name: 'Davin', age: 30, address: { city: 'Pettit' } }); // passes
updatedSchema.parse({ name: 'Davin', age: 30, address: { street: 'Main St' } } ); // throws
Config<T> (Type Helper)Fully typed config for autocomplete and compile-time safety.
const config = {
name: true,
address: { city: true },
tags: { '*': true },
} satisfies Config<z.infer<typeof userSchema>>;
makeConditionalSchemaTransformer(data)Creates a transformer that can apply conditional requirements based on runtime data.
Config values (in addition to above):
(data) => boolean — function that determines if field is required{ requiredIf: (data) => boolean } — explicit conditional syntaximport { z } from 'zod';
import { makeConditionalSchemaTransformer } from '@adaptate/core';
const schema = z.object({
parentContactNumber: z.number().optional(),
age: z.number().optional(),
});
const config = {
parentContactNumber: { requiredIf: (data: any) => data.age < 18 },
age: true,
};
const data = { age: 17 };
const transformer = makeConditionalSchemaTransformer(data)(schema, config);
transformer.run(); // throws — parentContactNumber required because age < 18
Transformer properties:
transformer.schema — the transformed Zod schematransformer.run() — shorthand for transformer.schema.parse(data)transformer.staticConfig — config with conditionals removed (for use with transformSchema)The engine recursively traverses the Zod schema tree:
.unwrap() to strip optionality'*' config → applies config to element schemaZodObject.merge()This preserves all fields not mentioned in the config while making specified fields required.
FAQs
Dynamic and Adaptable Model Validator Using Zod, Interoperable with OpenAPI
The npm package @adaptate/core receives a total of 88 weekly downloads. As such, @adaptate/core popularity was classified as not popular.
We found that @adaptate/core 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.

Research
/Security News
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.