
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
@amritk/helpers
Advanced tools
Shared schema-traversal and runtime helpers for the mjst code generation ecosystem.
@amritk/helpers is the shared utility belt used by mjst's generators and by the runtime code those generators produce. Each helper is published as its own subpath export so consumers (and generated output) only pull in what they need — no barrel, no incidental dependencies.
npm install @amritk/helpers
# or
pnpm add @amritk/helpers
# or
yarn add @amritk/helpers
# or
bun add @amritk/helpers
| Subpath | Exports | Purpose |
|---|---|---|
@amritk/helpers/extract-refs | extractRefs | Collect every $ref reachable from a schema. |
@amritk/helpers/resolve-ref | resolveRef | Resolve a $ref — JSON Pointer, $anchor name, or URI — against a root schema. |
@amritk/helpers/build-anchor-map | buildAnchorMap | Build a map of $anchor / $dynamicAnchor name → JSON Pointer. |
@amritk/helpers/build-dynamic-ref-map | buildDynamicRefMap | Build a map of $dynamicAnchor → resolved location. |
@amritk/helpers/resolve-dynamic-refs | resolveDynamicRefs | Replace $dynamicRef occurrences using the map above. |
@amritk/helpers/assert-id-scopes | assertIdScopes | Reject a document whose $id-scoped fragment ref resolves to nothing in its own resource. |
@amritk/helpers/max-schema-depth | MAX_SCHEMA_DEPTH, assertSchemaDepth | The nesting cap every recursive walker enforces. |
@amritk/helpers/upgrade-draft07-schema | upgradeDraft07Schema, isDraft07Schema | Upgrade a Draft-07 schema to 2020-12. |
@amritk/helpers/ref-to-filename | refToFilename, toKebabCase | Convert a $ref to a stable filename. |
@amritk/helpers/ref-to-name | refToName | Convert a $ref to a TypeScript identifier (PascalCase). |
@amritk/helpers/schema-guards | isSchemaObject, hasType, hasProperties, hasOneOf, hasAnyOf, hasAllOf, hasEnum, hasConst, hasPattern, hasFormat, hasDefault, hasExamples, hasRequired, hasItems, hasAdditionalProperties, hasMinLength, hasMaxLength, hasMinimum, hasMaximum, hasExclusiveMinimum, hasExclusiveMaximum, hasMultipleOf, hasMinItems, hasMaxItems, hasUniqueItems, hasMinProperties, hasMaxProperties, … | Type-narrowing predicates for JSON Schema keywords. |
| Subpath | Exports | Purpose |
|---|---|---|
@amritk/helpers/generate-type-definition | generateTypeDefinition | Render a TypeScript type from a schema node. |
@amritk/helpers/mjst-extension | MJST_EXTENSION_KEY, getMjstInstanceOf, getMjstPrimitive, getMjstBrand | Read the x-mjst vendor hints (instanceOf, primitive, brand) a schema carries. |
@amritk/helpers/parse-documentation | parseDocumentation, ObjectDocumentation | Parse a markdown doc file into per-property descriptions. |
| Subpath | Exports | Purpose |
|---|---|---|
@amritk/helpers/is-object | isObject | Narrow unknown → Record<string, unknown>. |
@amritk/helpers/safe-accessor | safeAccessor | Read a key from an unknown value without throwing. |
@amritk/helpers/validate-array | validateArray | Validate array shape and items. |
@amritk/helpers/validate-record | validateRecord | Validate record shape and additional properties. |
import { resolveRef } from '@amritk/helpers/resolve-ref'
import { isObjectSchema, hasProperties } from '@amritk/helpers/schema-guards'
const node = resolveRef('#/$defs/info', rootSchema)
if (isObjectSchema(node) && hasProperties(node)) {
for (const [name, property] of Object.entries(node.properties)) {
// ...
}
}
Each helper has its own colocated test file (*.test.ts) — read those for canonical examples.
@amritk/generate-parsers — primary consumer@amritk/generate-validators — primary consumer@amritk/mjst — the CLI surfaceFAQs
Shared utilities for the mjst code generation ecosystem.
The npm package @amritk/helpers receives a total of 8,952 weekly downloads. As such, @amritk/helpers popularity was classified as popular.
We found that @amritk/helpers 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.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.