ItemToObject
cartographer / itemToObject
Function: itemToObject()
Section titled “Function: itemToObject()”itemToObject(
item,settings):Record<string,string|number|boolean|string[] |Date|null>
Defined in: types/types.ts:104
Helper to work with items as strongly-typed objects. Converts a CatalogItem to a plain object with all schema fields included.
Parameters
Section titled “Parameters”The CatalogItem to convert
settings
Section titled “settings”Plugin settings (contains the schema)
Returns
Section titled “Returns”Record<string, string | number | boolean | string[] | Date | null>
- Plain object with all schema fields (missing fields are null)
Example
Section titled “Example”const obj = itemToObject(item, settings);// Returns: { title: 'The Story', authors: ['Author'], year: 1928, ... }