
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
zod-semver
Advanced tools
A simple deno module by @codemonument with a zod schema for validating semver. Uses official regex and is cross-posted to npm as zod-semver
A simple deno module by @codemonument with a zod schema for validating semver. Uses official regex.
[!WARNING] Not published to
deno.land/x/zod_semveranymore! Use the jsr package instead:
jsr:@codemonument/zod-semver
!
deno add @codemonument/zod-semver
import {ZodSemver} from '@codemonument/zod-semver';
npm add @codemonument/zod-semver
import {ZodSemver} from 'zod-semver';
// Use like any other Zod Schema:
ZodSemver.parse('1.0.0');
// Or include in another Zod Schema like this:
const MyObjectSchema = z.object({
version: ZodSemver,
name: z.string(),
age: z.number().optional(),
});
At it's base, the ZodSemver type is simply a more refined string. So the TS type for it is string.
However, sometimes it might be useful for a function to make sure that it only receives an already parsed semver string.
This is possible via the branded ZodSemver
type.
'branded' means that the type is a string, but with a special property atached that makes it unique. See the zod docs for more information: https://zod.dev/?id=brand
Name | Target |
---|---|
Git Repo | https://github.com/codemonument/deno_zod_semver |
JSR | https://jsr.io/@codemonument/zod-semver/ |
NPM | https://www.npmjs.com/package/zod-semver |
deno task uv <newVersion>
deno task test
1.3.8 - 2023-04-01
FAQs
A simple deno module by @codemonument with a zod schema for validating semver. Uses official regex and is cross-posted to npm as zod-semver
The npm package zod-semver receives a total of 226 weekly downloads. As such, zod-semver popularity was classified as not popular.
We found that zod-semver 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
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.