UNPKG

findstate-cli

Version:

A CLI for querying data optimized for Real Estate

20 lines (19 loc) 566 B
import { mockData } from "../data/mock-data.js"; /** * Loads mock property data or throws an error for unsupported sources. * * @param {string} source - The source of the data ("mock" for preloaded data). * @returns {Property[]} - The list of properties. * * @throws {Error} If the specified source is not supported. * * @example * const properties = loadData("mock"); * console.log(properties); */ export function loadData(source) { if (source === "mock") { return mockData; } throw new Error(`Unsupported data source: ${source}`); }