
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
bun-plugin-typia
Advanced tools
Adds support for [typia](https://github.com/samchon/typia), a transformer library that features super-fast runtime validators.
bun-plugin-typiaAdds support for typia, a transformer library that features super-fast runtime validators.
bun add bun-plugin-typia -d
This plugin can be used to run typia validators at runtime with Bun without needing to create a template and generate the files:
Bun.plugin()// typiaPlugin.ts
import typiaPlugin from "bun-plugin-typia";
Bun.plugin(typiaPlugin());
# bunfig.toml
preload = ["./typiaPlugin.ts"]
# for using in tests
[test]
preload = ["./typiaPlugin.ts"]
// index.ts
import typia, { tags } from "typia";
const res: typia.IValidation<IMember> = typia.validate<IMember>({
id: 5, // wrong, must be string (uuid)
age: 20.75, // wrong, not integer
email: "danial@hambergerpls.com",
});
if (!res.success) console.log(res.errors);
// [
// {
// path: "$input.id",
// expected: "(string & Format<\"uuid\">)",
// value: 5,
// }, {
// path: "$input.age",
// expected: "number & Type<\"uint32\">",
// value: 20.75,
// }
// ]
interface IMember {
id: string & tags.Format<"uuid">;
email: string & tags.Format<"email">;
age: number &
tags.Type<"uint32"> &
tags.ExclusiveMinimum<19> &
tags.Maximum<100>;
}
// test.ts
test("should be able to use validate function", async () => {
const res: typia.IValidation<IMember> = typia.validate<IMember>({
id: 5, // wrong, must be string (uuid)
age: 20.75, // wrong, not integer
email: "danial@hambergerpls.com",
});
expect(res.success).toEqual(false);
expect(res.errors).toEqual([
{
path: "$input.id",
expected: "(string & Format<\"uuid\">)",
value: 5,
}, {
path: "$input.age",
expected: "number & Type<\"uint32\">",
value: 20.75,
}
]);
});
$ bun run index.ts
$ bun install # project setup
$ bun test # run tests
FAQs
Adds support for [typia](https://github.com/samchon/typia), a transformer library that features super-fast runtime validators.
We found that bun-plugin-typia 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.