UNPKG

@adyen/kyc-components

Version:

`adyen-kyc-components` provides the required pieces to build an onboarding flow based on a legal entity. To onboard and verify users, you need to create a user interface (UI) to collect user data. To speed up building your integration, Adyen offers onboar

43 lines (41 loc) 1.26 kB
/** * returns the indicated property of an object, if it exists. * * @param object - The object to query * @param path - The property name or path to the property * @returns The value at `obj[p]`. * @example * ``` * getProp({x: 100}, 'x'); //=> 100 * getProp({}, 'x'); //=> undefined * ``` */ export declare function getProp(object: any, path: string): any; /** * assigns the value provided to the key in targetObject. * @param path - keys separated by a delimiter. * @param obj - object to which value will be assigned * @param val - value to be assigned * * @example * ``` * targetObject = {}; * assignToProp('x.y.z', targetObject, 'foo'); * console.log(targetObject); => {x:{y:{z:'foo'}}} * ``` */ export declare function assignToProp(path: any, obj: any, val: any): void; export declare function deleteProp(path: string, obj: object): void; /** * @param obj - source object * @param mapping - key mappings between target and source object structure * @example * ``` * let mapping={ 'a.b': 'x.y.z'} * let obj = {x: {y: {z: 'foo'}}} * formatObject(obj, mapping) => {a:{b:'foo'}} * ``` */ export declare const formatObject: <T>(obj: Record<string, any> | null, mapping: { [key: string]: string; }) => T | null;