📄 json¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 🔧 Functions | 4 |
| 📦 Imports | 2 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/website/src/components/lib/json.ts
📦 Imports¶
| Name | Source |
|---|---|
json5 |
json5 |
isRecord |
../ast/utils |
Functions¶
ensureObject(obj: unknown): Record<string, unknown>¶
Validates that the passed value is a record, if not return an empty object
Calls:
isRecord (from ../ast/utils)
Code
parseJSONObject(code: string): Record<string, unknown>¶
Parse a JSON string into an object. If the string is not valid JSON, return an empty object.
Raw JSDoc
Calls:
ensureObjectjson5.parseconsole.error
Code
toJson(cfg: unknown): string¶
Convert a config object to a JSON string
Calls:
JSON.stringify
toJsonConfig(cfg: unknown, prop: string): string¶
Convert a config object to a JSON string, wrapping it in a property
Calls:
toJson
Code
Generated by Syntax Scribe