Skip to content

Commit 5cf2c48

Browse files
mattywongMatthew Wong
andauthored
fix(types): reach and getIn make last 2 arguments optional (#1194)
Co-authored-by: Matthew Wong <matthew@eduka.com>
1 parent e6dbef1 commit 5cf2c48

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/util/reach.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { forEach } from 'property-expr';
22

33
let trim = (part: string) => part.substr(0, part.length - 1).substr(1);
44

5-
export function getIn(schema: any, path: string, value: any, context = value) {
5+
export function getIn(schema: any, path: string, value?: any, context = value) {
66
let parent: any, lastPart: string, lastPartDebug: string;
77

88
// root path: ''
@@ -50,7 +50,7 @@ export function getIn(schema: any, path: string, value: any, context = value) {
5050
return { schema, parent, parentPath: lastPart! };
5151
}
5252

53-
const reach = (obj: {}, path: string, value: any, context: any) =>
53+
const reach = (obj: {}, path: string, value?: any, context?: any) =>
5454
getIn(obj, path, value, context).schema;
5555

5656
export default reach;

0 commit comments

Comments
 (0)