@amritk/helpers
Advanced tools
+1
-1
| { | ||
| "name": "@amritk/helpers", | ||
| "version": "0.7.0", | ||
| "version": "0.7.1", | ||
| "description": "Shared utilities for the mjst code generation ecosystem.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -93,2 +93,17 @@ import { describe, expect, it, vi } from 'vitest' | ||
| it('handles circular refs (A → B → A) without infinite looping', () => { | ||
| const schema = { | ||
| properties: { root: { $ref: '#/$defs/a' } }, | ||
| $defs: { | ||
| a: { type: 'object', properties: { b: { $ref: '#/$defs/b' } } }, | ||
| b: { type: 'object', properties: { a: { $ref: '#/$defs/a' } } }, | ||
| }, | ||
| } | ||
| const nodes = collect(schema, 'Document') | ||
| // Both defs are visited exactly once each despite the cycle. | ||
| expect(nodes.map((n) => n.filename)).toEqual(['document', 'a', 'b']) | ||
| }) | ||
| it('reuses cached resolution across repeated walks of the same schema object', () => { | ||
@@ -95,0 +110,0 @@ // The second walk should produce the same nodes from the per-root cache, |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
285151
0.18%6594
0.18%