Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function propEq(path: string, value: any, obj: Object): boolean; // Overload with obj
- /**
- * @param path dot delimited path to check
- * @param value value to test
- * @returns a function that the object to test
- * @example const checkValue = propEq('path.to.property'(charge: number) => Promise<any>, 'value');
- * checkValue({}) // call the check
- */
- export function propEq(path: string, value: any): (obj: Object) => boolean; // Overload for no obj
- export function propEq(path: string, value: any, obj?: Object): boolean | ((obj: Object) => boolean) { // Actual implementation signature
- return obj
- ? R.equals(pick(path, obj), value)
- : (target: Object) => R.equals(pick(path, target), value);
- }
Advertisement
Add Comment
Please, Sign In to add comment