/** * Object Utilities * * Provides utilities for working with nested object paths and property access. * * @fileoverview Object manipulation utilities */ /** * Sets a value at a nested path in an object, creating intermediate objects as needed. * * @param obj - The target object to modify * @param path - Dot-separated path to the property (e.g., 'user.profile.name') * @param value - The value to set at the path * * @example * ```typescript * const obj = { user: { id: 1 } }; * setNestedProperty(obj, 'user.profile.name', 'John'); * // Result: { user: { id: 1, profile: { name: 'John' } } } * ``` */ export declare function setNestedProperty(obj: Record, path: string, value: unknown): void; /** * Gets a value at a nested path in an object. * * @param obj - The source object to read from * @param path - Dot-separated path to the property (e.g., 'user.profile.name') * @param defaultValue - Optional default value if the path doesn't exist * @returns The value at the path, or defaultValue if not found * * @example * ```typescript * const obj = { user: { profile: { name: 'John' } } }; * getNestedProperty(obj, 'user.profile.name'); // 'John' * getNestedProperty(obj, 'user.settings.theme', 'dark'); // 'dark' (default) * ``` */ export declare function getNestedProperty(obj: Record, path: string, defaultValue?: T): T | undefined; /** * Checks if a nested path exists in an object. * * @param obj - The object to check * @param path - Dot-separated path to check (e.g., 'user.profile.name') * @returns True if the path exists and is not undefined * * @example * ```typescript * const obj = { user: { profile: { name: 'John' } } }; * hasNestedProperty(obj, 'user.profile.name'); // true * hasNestedProperty(obj, 'user.settings.theme'); // false * ``` */ export declare function hasNestedProperty(obj: Record, path: string): boolean; /** * Object utilities namespace for convenient grouped access. * * @example * ```typescript * import { ObjectUtils } from '@plyaz/core/utils'; * * ObjectUtils.setNestedProperty(obj, 'user.name', 'John'); * const name = ObjectUtils.getNestedProperty(obj, 'user.name'); * ``` */ export declare const ObjectUtils: { readonly setNestedProperty: typeof setNestedProperty; readonly getNestedProperty: typeof getNestedProperty; readonly hasNestedProperty: typeof hasNestedProperty; }; //# sourceMappingURL=object.d.ts.map