import { expectType } from 'tsd' ; import setWith from '../setWith' ; const someObj = { } ; const anyValue = 'any value' ; expectType < object > ( setWith ( someObj , 'a.b.c' , anyValue , ( value , key , obj ) => { expectType < any > ( value ) ; expectType < string > ( key ) ; expectType < object > ( obj ) ; } ) ) ; expectType < object > ( setWith ( someObj , [ 'a.b.c' ] , anyValue , ( value , key , obj ) => { expectType < any > ( value ) ; expectType < string > ( key ) ; expectType < object > ( obj ) ; } ) ) ; expectType < object > ( setWith ( someObj , [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue , ( value , key , obj ) => { expectType < any > ( value ) ; expectType < string > ( key ) ; expectType < object > ( obj ) ; } ) ) ;